]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/test/erasure-code/TestErasureCodePlugin.cc
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / test / erasure-code / TestErasureCodePlugin.cc
index 521169066ebb11ca979db43604646b5840711a62..08404b6e503e8ed077d2fdd3b3a739c4961ce94f 100644 (file)
@@ -21,7 +21,7 @@
 #include "common/Thread.h"
 #include "erasure-code/ErasureCodePlugin.h"
 #include "global/global_context.h"
-#include "common/config.h"
+#include "common/config_proxy.h"
 #include "gtest/gtest.h"
 
 
@@ -42,7 +42,7 @@ protected:
       ErasureCodeInterfaceRef erasure_code;
       pthread_cleanup_push(cleanup, NULL);
       instance.factory("hangs",
-                      g_conf->get_val<std::string>("erasure_code_dir"),
+                      g_conf().get_val<std::string>("erasure_code_dir"),
                       profile, &erasure_code, &cerr);
       pthread_cleanup_pop(0);
       return NULL;
@@ -82,37 +82,36 @@ TEST_F(ErasureCodePluginRegistryTest, factory_mutex) {
 TEST_F(ErasureCodePluginRegistryTest, all)
 {
   ErasureCodeProfile profile;
-  const char* env = getenv("CEPH_LIB");
-  string directory(env ? env : ".libs");
+  string directory = g_conf().get_val<std::string>("erasure_code_dir");
   ErasureCodeInterfaceRef erasure_code;
   ErasureCodePluginRegistry &instance = ErasureCodePluginRegistry::instance();
   EXPECT_FALSE(erasure_code);
   EXPECT_EQ(-EIO, instance.factory("invalid",
-                                  g_conf->get_val<std::string>("erasure_code_dir"),
+                                  g_conf().get_val<std::string>("erasure_code_dir"),
                                   profile, &erasure_code, &cerr));
   EXPECT_FALSE(erasure_code);
   EXPECT_EQ(-EXDEV, instance.factory("missing_version",
-                                    g_conf->get_val<std::string>("erasure_code_dir"),
+                                    g_conf().get_val<std::string>("erasure_code_dir"),
                                     profile,
                                     &erasure_code, &cerr));
   EXPECT_FALSE(erasure_code);
   EXPECT_EQ(-ENOENT, instance.factory("missing_entry_point",
-                                     g_conf->get_val<std::string>("erasure_code_dir"),
+                                     g_conf().get_val<std::string>("erasure_code_dir"),
                                      profile,
                                      &erasure_code, &cerr));
   EXPECT_FALSE(erasure_code);
   EXPECT_EQ(-ESRCH, instance.factory("fail_to_initialize",
-                                    g_conf->get_val<std::string>("erasure_code_dir"),
+                                    g_conf().get_val<std::string>("erasure_code_dir"),
                                     profile,
                                     &erasure_code, &cerr));
   EXPECT_FALSE(erasure_code);
   EXPECT_EQ(-EBADF, instance.factory("fail_to_register",
-                                    g_conf->get_val<std::string>("erasure_code_dir"),
+                                    g_conf().get_val<std::string>("erasure_code_dir"),
                                     profile,
                                     &erasure_code, &cerr));
   EXPECT_FALSE(erasure_code);
   EXPECT_EQ(0, instance.factory("example",
-                               g_conf->get_val<std::string>("erasure_code_dir"),
+                               g_conf().get_val<std::string>("erasure_code_dir"),
                                profile, &erasure_code, &cerr));
   EXPECT_TRUE(erasure_code.get());
   ErasureCodePlugin *plugin = 0;
@@ -127,10 +126,10 @@ TEST_F(ErasureCodePluginRegistryTest, all)
 
 /*
  * Local Variables:
- * compile-command: "cd ../.. ; make -j4 && 
+ * compile-command: "cd ../../../build ; make -j4 &&
  *   make unittest_erasure_code_plugin && 
  *   valgrind --tool=memcheck \
- *      ./unittest_erasure_code_plugin \
+ *      ./bin/unittest_erasure_code_plugin \
  *      --gtest_filter=*.* --log-to-stderr=true --debug-osd=20"
  * End:
  */