]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: parse args to ceph_test_librbd
authorSage Weil <sage@inktank.com>
Mon, 21 Oct 2013 22:55:32 +0000 (15:55 -0700)
committerSage Weil <sage@inktank.com>
Mon, 21 Oct 2013 22:55:32 +0000 (15:55 -0700)
Signed-off-by: Sage Weil <sage@inktank.com>
src/test/Makefile.am
src/test/librbd/test_librbd.cc

index 84a228f1d4b42c7e2fb00e1eb6be84d0523b4755..572d5d57dc441cac59d6beaeb60b1eaa8d5401ad 100644 (file)
@@ -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
 
index 84bf3477aff4c4d074753a0e6454d0307fcf6e62..8052d25d6e19a5a8e01d3d43ce3e58fa8f8ea422 100644 (file)
 #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();
+}