]> git.proxmox.com Git - ceph.git/blob - ceph/src/test/librbd/test_main.cc
update sources to v12.1.3
[ceph.git] / ceph / src / test / librbd / test_main.cc
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3
4 #include "include/rados/librados.hpp"
5 #include "global/global_context.h"
6 #include "test/librados/test.h"
7 #include "gtest/gtest.h"
8 #include <iostream>
9 #include <string>
10
11 extern void register_test_librbd();
12 #ifdef TEST_LIBRBD_INTERNALS
13 extern void register_test_image_watcher();
14 extern void register_test_internal();
15 extern void register_test_journal_entries();
16 extern void register_test_journal_replay();
17 extern void register_test_object_map();
18 extern void register_test_operations();
19 extern void register_test_mirroring();
20 extern void register_test_mirroring_watcher();
21 #endif // TEST_LIBRBD_INTERNALS
22
23 int main(int argc, char **argv)
24 {
25 register_test_librbd();
26 #ifdef TEST_LIBRBD_INTERNALS
27 register_test_image_watcher();
28 register_test_internal();
29 register_test_journal_entries();
30 register_test_journal_replay();
31 register_test_object_map();
32 register_test_operations();
33 register_test_mirroring();
34 register_test_mirroring_watcher();
35 #endif // TEST_LIBRBD_INTERNALS
36
37 ::testing::InitGoogleTest(&argc, argv);
38
39 librados::Rados rados;
40 std::string result = connect_cluster_pp(rados);
41 if (result != "" ) {
42 std::cerr << result << std::endl;
43 return 1;
44 }
45
46 #ifdef TEST_LIBRBD_INTERNALS
47 g_ceph_context = reinterpret_cast<CephContext*>(rados.cct());
48 #endif // TEST_LIBRBD_INTERNALS
49
50 int r = rados.conf_set("lockdep", "true");
51 if (r < 0) {
52 std::cerr << "failed to enable lockdep" << std::endl;
53 return -r;
54 }
55 return RUN_ALL_TESTS();
56 }