diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
commit | 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch) | |
tree | e5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/test/rbd_mirror/test_main.cc | |
parent | Initial commit. (diff) | |
download | ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.tar.xz ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.zip |
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/rbd_mirror/test_main.cc')
-rw-r--r-- | src/test/rbd_mirror/test_main.cc | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/test/rbd_mirror/test_main.cc b/src/test/rbd_mirror/test_main.cc new file mode 100644 index 00000000..9226b086 --- /dev/null +++ b/src/test/rbd_mirror/test_main.cc @@ -0,0 +1,53 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab + +#include "common/perf_counters.h" +#include "include/rados/librados.hpp" +#include "global/global_context.h" +#include "test/librados/test_cxx.h" +#include "gtest/gtest.h" +#include <iostream> +#include <string> + +PerfCounters *g_perf_counters = nullptr; + +extern void register_test_cluster_watcher(); +extern void register_test_image_policy(); +extern void register_test_image_sync(); +extern void register_test_instance_watcher(); +extern void register_test_instances(); +extern void register_test_leader_watcher(); +extern void register_test_pool_watcher(); +extern void register_test_rbd_mirror(); +extern void register_test_rbd_mirror_image_deleter(); + +int main(int argc, char **argv) +{ + register_test_cluster_watcher(); + register_test_image_policy(); + register_test_image_sync(); + register_test_instance_watcher(); + register_test_instances(); + register_test_leader_watcher(); + register_test_pool_watcher(); + register_test_rbd_mirror(); + register_test_rbd_mirror_image_deleter(); + + ::testing::InitGoogleTest(&argc, argv); + + librados::Rados rados; + std::string result = connect_cluster_pp(rados); + if (result != "" ) { + std::cerr << result << std::endl; + return 1; + } + + g_ceph_context = reinterpret_cast<CephContext*>(rados.cct()); + + int r = rados.conf_set("lockdep", "true"); + if (r < 0) { + std::cerr << "failed to enable lockdep" << std::endl; + return -r; + } + return RUN_ALL_TESTS(); +} |