]> git.proxmox.com Git - ceph.git/blob - ceph/src/test/neorados/start_stop.cc
import quincy beta 17.1.0
[ceph.git] / ceph / src / test / neorados / start_stop.cc
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3 /*
4 * Ceph - scalable distributed file system
5 *
6 * Copyright (C) 2019 Red Hat <contact@redhat.com>
7 * Author: Adam C. Emerson <aemerson@redhat.com>
8 *
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.
13 *
14 */
15
16 #include <thread>
17 #include <vector>
18
19 #include "include/neorados/RADOS.hpp"
20
21 #include "common/async/context_pool.h"
22 #include "common/ceph_argparse.h"
23
24 #include "global/global_init.h"
25
26 namespace R = neorados;
27
28
29 int main(int argc, char** argv)
30 {
31 using namespace std::literals;
32
33 auto args = argv_to_vec(argc, argv);
34 env_to_vec(args);
35
36 auto cct = global_init(nullptr, args, CEPH_ENTITY_TYPE_CLIENT,
37 CODE_ENVIRONMENT_UTILITY, 0);
38 common_init_finish(cct.get());
39
40 {
41 ceph::async::io_context_pool p(1);
42 auto r = R::RADOS::make_with_cct(cct.get(), p,
43 boost::asio::use_future).get();
44 std::this_thread::sleep_for(30s);
45 }
46 std::this_thread::sleep_for(30s);
47 {
48 ceph::async::io_context_pool p(1);
49 auto r = R::RADOS::make_with_cct(cct.get(), p,
50 boost::asio::use_future).get();
51 std::this_thread::sleep_for(30s);
52 }
53 {
54 ceph::async::io_context_pool p(1);
55 auto r = R::RADOS::make_with_cct(cct.get(), p,
56 boost::asio::use_future).get();
57 std::this_thread::sleep_for(1s);
58 }
59 {
60 ceph::async::io_context_pool p(1);
61 auto r = R::RADOS::make_with_cct(cct.get(), p,
62 boost::asio::use_future).get();
63 std::this_thread::sleep_for(1s);
64 }
65 {
66 ceph::async::io_context_pool p(1);
67 auto r = R::RADOS::make_with_cct(cct.get(), p,
68 boost::asio::use_future).get();
69 std::this_thread::sleep_for(1s);
70 }
71 {
72 ceph::async::io_context_pool p(1);
73 auto r = R::RADOS::make_with_cct(cct.get(), p,
74 boost::asio::use_future).get();
75 std::this_thread::sleep_for(1s);
76 }
77 {
78 ceph::async::io_context_pool p(1);
79 auto r = R::RADOS::make_with_cct(cct.get(), p,
80 boost::asio::use_future).get();
81 std::this_thread::sleep_for(1s);
82 }
83 {
84 ceph::async::io_context_pool p(1);
85 auto r = R::RADOS::make_with_cct(cct.get(), p,
86 boost::asio::use_future).get();
87 std::this_thread::sleep_for(1s);
88 }
89 {
90 ceph::async::io_context_pool p(1);
91 auto r = R::RADOS::make_with_cct(cct.get(), p,
92 boost::asio::use_future).get();
93 std::this_thread::sleep_for(1s);
94 }
95 {
96 ceph::async::io_context_pool p(1);
97 auto r = R::RADOS::make_with_cct(cct.get(), p,
98 boost::asio::use_future).get();
99 std::this_thread::sleep_for(500ms);
100 }
101 {
102 ceph::async::io_context_pool p(1);
103 auto r = R::RADOS::make_with_cct(cct.get(), p,
104 boost::asio::use_future).get();
105 std::this_thread::sleep_for(500ms);
106 }
107 {
108 ceph::async::io_context_pool p(1);
109 auto r = R::RADOS::make_with_cct(cct.get(), p,
110 boost::asio::use_future).get();
111 std::this_thread::sleep_for(50ms);
112 }
113 {
114 ceph::async::io_context_pool p(1);
115 auto r = R::RADOS::make_with_cct(cct.get(), p,
116 boost::asio::use_future).get();
117 std::this_thread::sleep_for(50ms);
118 }
119 {
120 ceph::async::io_context_pool p(1);
121 auto r = R::RADOS::make_with_cct(cct.get(), p,
122 boost::asio::use_future).get();
123 std::this_thread::sleep_for(50ms);
124 }
125 {
126 ceph::async::io_context_pool p(1);
127 auto r = R::RADOS::make_with_cct(cct.get(), p,
128 boost::asio::use_future).get();
129 std::this_thread::sleep_for(5ms);
130 }
131 {
132 ceph::async::io_context_pool p(1);
133 auto r = R::RADOS::make_with_cct(cct.get(), p,
134 boost::asio::use_future).get();
135 std::this_thread::sleep_for(5ms);
136 }
137 {
138 ceph::async::io_context_pool p(1);
139 auto r = R::RADOS::make_with_cct(cct.get(), p,
140 boost::asio::use_future).get();
141 std::this_thread::sleep_for(5ms);
142 }
143 {
144 ceph::async::io_context_pool p(1);
145 auto r = R::RADOS::make_with_cct(cct.get(), p,
146 boost::asio::use_future).get();
147 std::this_thread::sleep_for(5ms);
148 }
149 {
150 ceph::async::io_context_pool p(1);
151 auto r = R::RADOS::make_with_cct(cct.get(), p,
152 boost::asio::use_future).get();
153 std::this_thread::sleep_for(5ms);
154 }
155 {
156 ceph::async::io_context_pool p(1);
157 auto r = R::RADOS::make_with_cct(cct.get(), p,
158 boost::asio::use_future).get();
159 std::this_thread::sleep_for(5us);
160 }
161 {
162 ceph::async::io_context_pool p(1);
163 auto r = R::RADOS::make_with_cct(cct.get(), p,
164 boost::asio::use_future).get();
165 std::this_thread::sleep_for(5us);
166 }
167 {
168 ceph::async::io_context_pool p(1);
169 auto r = R::RADOS::make_with_cct(cct.get(), p,
170 boost::asio::use_future).get();
171 std::this_thread::sleep_for(5us);
172 }
173 return 0;
174 }