diff options
author | Sage Weil <sage@inktank.com> | 2013-10-21 15:55:32 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-10-21 15:55:32 -0700 |
commit | 1f6b8b27b0e8e8374b463f995536aaeed776201f (patch) | |
tree | 13af84c86ab4162fba2107c9f882ad2d888e20a6 | |
parent | ad4553a4fddfa01129d84da1f9e166a93260bd3e (diff) | |
download | ceph-1f6b8b27b0e8e8374b463f995536aaeed776201f.tar.gz |
librbd: parse args to ceph_test_librbd
Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r-- | src/test/Makefile.am | 2 | ||||
-rw-r--r-- | src/test/librbd/test_librbd.cc | 17 |
2 files changed, 18 insertions, 1 deletions
diff --git a/src/test/Makefile.am b/src/test/Makefile.am index 84a228f1d4b..572d5d57dc4 100644 --- a/src/test/Makefile.am +++ b/src/test/Makefile.am @@ -615,7 +615,7 @@ endif # WITH_RADOSGW ceph_test_librbd_SOURCES = \ test/librbd/test_librbd.cc \ test/librados/test.cc -ceph_test_librbd_LDADD = $(LIBRBD) $(LIBRADOS) $(UNITTEST_LDADD) +ceph_test_librbd_LDADD = $(LIBRBD) $(LIBRADOS) $(UNITTEST_LDADD) $(CEPH_GLOBAL) ceph_test_librbd_CXXFLAGS = $(UNITTEST_CXXFLAGS) bin_DEBUGPROGRAMS += ceph_test_librbd diff --git a/src/test/librbd/test_librbd.cc b/src/test/librbd/test_librbd.cc index 84bf3477aff..8052d25d6e1 100644 --- a/src/test/librbd/test_librbd.cc +++ b/src/test/librbd/test_librbd.cc @@ -18,6 +18,10 @@ #include "include/rbd/librbd.h" #include "include/rbd/librbd.hpp" +#include "global/global_context.h" +#include "global/global_init.h" +#include "common/ceph_argparse.h" + #include "gtest/gtest.h" #include <errno.h> @@ -1772,3 +1776,16 @@ TEST(LibRBD, DiffIterateStress) ioctx.close(); ASSERT_EQ(0, destroy_one_pool_pp(pool_name, rados)); } + +int main(int argc, char **argv) +{ + ::testing::InitGoogleTest(&argc, argv); + + vector<const char*> args; + argv_to_vec(argc, (const char **)argv, args); + + global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0); + common_init_finish(g_ceph_context); + + return RUN_ALL_TESTS(); +} |