]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
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" | |
11fdf7f2 | 7 | #include "test/librados/test_cxx.h" |
7c673cae FG |
8 | #include "gtest/gtest.h" |
9 | #include <iostream> | |
10 | #include <string> | |
11 | ||
12 | extern void register_test_librbd(); | |
13 | #ifdef TEST_LIBRBD_INTERNALS | |
11fdf7f2 TL |
14 | extern void register_test_deep_copy(); |
15 | extern void register_test_groups(); | |
7c673cae FG |
16 | extern void register_test_image_watcher(); |
17 | extern void register_test_internal(); | |
18 | extern void register_test_journal_entries(); | |
19 | extern void register_test_journal_replay(); | |
11fdf7f2 | 20 | extern void register_test_migration(); |
7c673cae FG |
21 | extern void register_test_mirroring(); |
22 | extern void register_test_mirroring_watcher(); | |
11fdf7f2 TL |
23 | extern void register_test_object_map(); |
24 | extern void register_test_operations(); | |
25 | extern void register_test_trash(); | |
7c673cae FG |
26 | #endif // TEST_LIBRBD_INTERNALS |
27 | ||
28 | int main(int argc, char **argv) | |
29 | { | |
11fdf7f2 TL |
30 | setenv("RBD_FORCE_ALLOW_V1","1",1); |
31 | ||
7c673cae FG |
32 | register_test_librbd(); |
33 | #ifdef TEST_LIBRBD_INTERNALS | |
11fdf7f2 TL |
34 | register_test_deep_copy(); |
35 | register_test_groups(); | |
7c673cae FG |
36 | register_test_image_watcher(); |
37 | register_test_internal(); | |
38 | register_test_journal_entries(); | |
39 | register_test_journal_replay(); | |
11fdf7f2 | 40 | register_test_migration(); |
7c673cae FG |
41 | register_test_mirroring(); |
42 | register_test_mirroring_watcher(); | |
11fdf7f2 TL |
43 | register_test_object_map(); |
44 | register_test_operations(); | |
45 | register_test_trash(); | |
7c673cae FG |
46 | #endif // TEST_LIBRBD_INTERNALS |
47 | ||
48 | ::testing::InitGoogleTest(&argc, argv); | |
49 | ||
50 | librados::Rados rados; | |
51 | std::string result = connect_cluster_pp(rados); | |
52 | if (result != "" ) { | |
53 | std::cerr << result << std::endl; | |
54 | return 1; | |
55 | } | |
56 | ||
57 | #ifdef TEST_LIBRBD_INTERNALS | |
58 | g_ceph_context = reinterpret_cast<CephContext*>(rados.cct()); | |
59 | #endif // TEST_LIBRBD_INTERNALS | |
60 | ||
61 | int r = rados.conf_set("lockdep", "true"); | |
62 | if (r < 0) { | |
f67539c2 | 63 | std::cerr << "warning: failed to enable lockdep" << std::endl; |
7c673cae | 64 | } |
11fdf7f2 TL |
65 | |
66 | int seed = getpid(); | |
67 | std::cout << "seed " << seed << std::endl; | |
68 | srand(seed); | |
69 | ||
7c673cae FG |
70 | return RUN_ALL_TESTS(); |
71 | } |