summaryrefslogtreecommitdiffstats
path: root/src/test/librbd/test_main.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:54:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:54:28 +0000
commite6918187568dbd01842d8d1d2c808ce16a894239 (patch)
tree64f88b554b444a49f656b6c656111a145cbbaa28 /src/test/librbd/test_main.cc
parentInitial commit. (diff)
downloadceph-e6918187568dbd01842d8d1d2c808ce16a894239.tar.xz
ceph-e6918187568dbd01842d8d1d2c808ce16a894239.zip
Adding upstream version 18.2.2.upstream/18.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/librbd/test_main.cc')
-rw-r--r--src/test/librbd/test_main.cc71
1 files changed, 71 insertions, 0 deletions
diff --git a/src/test/librbd/test_main.cc b/src/test/librbd/test_main.cc
new file mode 100644
index 000000000..2ff9f69de
--- /dev/null
+++ b/src/test/librbd/test_main.cc
@@ -0,0 +1,71 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+
+#include "include/rados/librados.hpp"
+#include "global/global_context.h"
+#include "test/librados/test.h"
+#include "test/librados/test_cxx.h"
+#include "gtest/gtest.h"
+#include <iostream>
+#include <string>
+
+extern void register_test_librbd();
+#ifdef TEST_LIBRBD_INTERNALS
+extern void register_test_deep_copy();
+extern void register_test_groups();
+extern void register_test_image_watcher();
+extern void register_test_internal();
+extern void register_test_journal_entries();
+extern void register_test_journal_replay();
+extern void register_test_migration();
+extern void register_test_mirroring();
+extern void register_test_mirroring_watcher();
+extern void register_test_object_map();
+extern void register_test_operations();
+extern void register_test_trash();
+#endif // TEST_LIBRBD_INTERNALS
+
+int main(int argc, char **argv)
+{
+ setenv("RBD_FORCE_ALLOW_V1","1",1);
+
+ register_test_librbd();
+#ifdef TEST_LIBRBD_INTERNALS
+ register_test_deep_copy();
+ register_test_groups();
+ register_test_image_watcher();
+ register_test_internal();
+ register_test_journal_entries();
+ register_test_journal_replay();
+ register_test_migration();
+ register_test_mirroring();
+ register_test_mirroring_watcher();
+ register_test_object_map();
+ register_test_operations();
+ register_test_trash();
+#endif // TEST_LIBRBD_INTERNALS
+
+ ::testing::InitGoogleTest(&argc, argv);
+
+ librados::Rados rados;
+ std::string result = connect_cluster_pp(rados);
+ if (result != "" ) {
+ std::cerr << result << std::endl;
+ return 1;
+ }
+
+#ifdef TEST_LIBRBD_INTERNALS
+ g_ceph_context = reinterpret_cast<CephContext*>(rados.cct());
+#endif // TEST_LIBRBD_INTERNALS
+
+ int r = rados.conf_set("lockdep", "true");
+ if (r < 0) {
+ std::cerr << "warning: failed to enable lockdep" << std::endl;
+ }
+
+ int seed = getpid();
+ std::cout << "seed " << seed << std::endl;
+ srand(seed);
+
+ return RUN_ALL_TESTS();
+}