]>
git.proxmox.com Git - ceph.git/blob - ceph/src/test/neorados/common_tests.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph - scalable distributed file system
6 * Copyright (C) 2020 Red Hat, Inc.
7 * Author: Adam C. Emerson <aemerson@redhat.com>
9 * This is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License version 2.1, as published by the Free Software
12 * Foundation. See file COPYING.
16 #include <string_view>
18 #include "include/neorados/RADOS.hpp"
20 std::string
get_temp_pool_name(std::string_view prefix
= {});
22 template<typename CompletionToken
>
23 auto create_pool(neorados::RADOS
& r
, std::string_view pname
,
24 CompletionToken
&& token
)
26 boost::asio::async_completion
<CompletionToken
,
27 void(boost::system::error_code
,
28 std::int64_t)> init(token
);
29 r
.create_pool(pname
, std::nullopt
,
30 [&r
, pname
= std::string(pname
),
31 h
= std::move(init
.completion_handler
)]
32 (boost::system::error_code ec
) mutable {
36 (boost::system::error_code ec
, std::int64_t pool
) mutable {
37 std::move(h
)(ec
, pool
);
40 return init
.result
.get();