Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / test / system / st_rados_create_pool.h
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) 2011 New Dream Network
7 *
8 * This is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License version 2.1, as published by the Free Software
11 * Foundation.  See file COPYING.
12 *
13 */
14
15 #ifndef TEST_SYSTEM_ST_RADOS_CREATE_POOL_H
16 #define TEST_SYSTEM_ST_RADOS_CREATE_POOL_H
17
18 #include "systest_runnable.h"
19
20 class CrossProcessSem;
21
22 /*
23  * st_rados_create_pool
24  *
25  * Waits, then posts to setup_sem.
26  * Creates a pool and populates it with some objects.
27  * Then, calls pool_setup_sem->post()
28  */
29 class StRadosCreatePool : public SysTestRunnable
30 {
31 public:
32   static std::string get_random_buf(int sz);
33   StRadosCreatePool(int argc, const char **argv,
34                     CrossProcessSem *setup_sem,
35                     CrossProcessSem *pool_setup_sem,
36                     CrossProcessSem *close_create_pool_sem,
37                     const std::string &pool_name,
38                     int num_objects,
39                     const std::string &suffix);
40   ~StRadosCreatePool() override;
41   int run() override;
42 private:
43   CrossProcessSem *m_setup_sem;
44   CrossProcessSem *m_pool_setup_sem;
45   CrossProcessSem *m_close_create_pool;
46   std::string m_pool_name;
47   int m_num_objects;
48   std::string m_suffix;
49 };
50
51 std::string get_temp_pool_name(const char* prefix);
52
53 #endif