Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / test / system / st_rados_list_objects.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_LIST_OBJECTS_H
16 #define TEST_SYSTEM_ST_RADOS_LIST_OBJECTS_H
17
18 #include "systest_runnable.h"
19
20 class CrossProcessSem;
21
22 /*
23  * st_rados_list_objects
24  *
25  * 1. calls pool_setup_sem->wait()
26  * 2. calls pool_setup_sem->post()
27  * 3. list some objects
28  * 4. modify_sem->wait()
29  * 5. list some objects
30  */
31 class StRadosListObjects : public SysTestRunnable
32 {
33 public:
34   static std::string get_random_buf(int sz);
35   StRadosListObjects(int argc, const char **argv,
36                      const std::string &pool_name,
37                      bool accept_list_errors,
38                      int midway_cnt,
39                      CrossProcessSem *pool_setup_sem,
40                      CrossProcessSem *midway_sem_wait,
41                      CrossProcessSem *midway_sem_post);
42   ~StRadosListObjects() override;
43   int run() override;
44 private:
45   std::string m_pool_name;
46   bool m_accept_list_errors;
47   int m_midway_cnt;
48   CrossProcessSem *m_pool_setup_sem;
49   CrossProcessSem *m_midway_sem_wait;
50   CrossProcessSem *m_midway_sem_post;
51 };
52
53 #endif