]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: erasure-code tests passing
authorAli Maredia <amaredia@redhat.com>
Wed, 13 Jan 2016 19:40:22 +0000 (14:40 -0500)
committerAli Maredia <amaredia@redhat.com>
Fri, 15 Apr 2016 00:48:21 +0000 (20:48 -0400)
Replaced relative paths in test-erausure-eio.sh
test-erasure-code.sh, and replaced .libs in
erasure_code unittests with CEPH_VAR environment
variables set in cmake.

Signed-off-by: Ali Maredia <amaredia@redhat.com>
20 files changed:
src/test/CMakeLists.txt
src/test/erasure-code/CMakeLists.txt
src/test/erasure-code/TestErasureCode.cc
src/test/erasure-code/TestErasureCodeExample.cc
src/test/erasure-code/TestErasureCodeIsa.cc
src/test/erasure-code/TestErasureCodeJerasure.cc
src/test/erasure-code/TestErasureCodeLrc.cc
src/test/erasure-code/TestErasureCodePlugin.cc
src/test/erasure-code/TestErasureCodePluginIsa.cc
src/test/erasure-code/TestErasureCodePluginJerasure.cc
src/test/erasure-code/TestErasureCodePluginLrc.cc
src/test/erasure-code/TestErasureCodePluginShec.cc
src/test/erasure-code/TestErasureCodeShec.cc
src/test/erasure-code/TestErasureCodeShec_all.cc
src/test/erasure-code/TestErasureCodeShec_arguments.cc
src/test/erasure-code/TestErasureCodeShec_thread.cc
src/test/erasure-code/ceph_erasure_code.cc
src/test/erasure-code/ceph_erasure_code_non_regression.cc
src/test/erasure-code/test-erasure-code.sh
src/test/erasure-code/test-erasure-eio.sh

index 0c259530abd5a6c491a74b017aabb001fd923765..8908c0fb7fd3058d2e84f48a898c72dccd902570 100644 (file)
@@ -3,6 +3,7 @@ include(AddCephTest)
 set(UNITTEST_LIBS gmock_main gmock gtest ${PTHREAD_LIBS} ${CMAKE_DL_LIBS})
 set(UNITTEST_CXX_FLAGS "-I${CMAKE_SOURCE_DIR}/src/gmock/include -I${CMAKE_BINARY_DIR}/src/gmock/include -I${CMAKE_SOURCE_DIR}/src/gmock/gtest/include -I${CMAKE_BINARY_DIR}/src/gmock/gtest/include -fno-strict-aliasing")
 
+add_subdirectory(bench)
 add_subdirectory(cls_hello)
 add_subdirectory(cls_lock)
 add_subdirectory(cls_log)
@@ -13,16 +14,29 @@ add_subdirectory(cls_replica_log)
 add_subdirectory(cls_rgw)
 add_subdirectory(cls_statelog)
 add_subdirectory(cls_version)
+add_subdirectory(common)
 add_subdirectory(compressor)
+add_subdirectory(crush)
+add_subdirectory(encoding)
+add_subdirectory(erasure-code)
 add_subdirectory(filestore)
+add_subdirectory(fs)
 add_subdirectory(journal)
 add_subdirectory(libcephfs)
+add_subdirectory(librados)
 add_subdirectory(librados_test_stub)
+add_subdirectory(libradosstriper)
 add_subdirectory(librbd)
 add_subdirectory(messenger)
+add_subdirectory(mds)
+add_subdirectory(mon)
 add_subdirectory(msgr)
 add_subdirectory(ObjectMap)
+add_subdirectory(objectstore)
+add_subdirectory(os)
+add_subdirectory(osd)
 add_subdirectory(osdc)
+add_subdirectory(pybind)
 add_subdirectory(rgw)
 add_subdirectory(system)
 
@@ -96,7 +110,6 @@ target_link_libraries(test_trans os global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS})
 
 ## Benchmarks
 
-add_subdirectory(bench)
 
 # ceph_omapbench
 set(omapbench_srcs
@@ -384,24 +397,6 @@ add_dependencies(check run-tox-ceph-disk)
 add_test(NAME run-tox-ceph-detect-init COMMAND bash ${CMAKE_SOURCE_DIR}/src/ceph-detect-init/run-tox.sh WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src)
 add_dependencies(check run-tox-ceph-disk)
 
-add_subdirectory(common)
-add_subdirectory(crush)
-add_subdirectory(encoding)
-
-# erasure-code directory
-add_ceph_test(test-erasure-code.sh ${CMAKE_SOURCE_DIR}/src/test/erasure-code/test-erasure-code.sh)
-add_ceph_test(test-erasure-eio.sh ${CMAKE_SOURCE_DIR}/src/test/erasure-code/test-erasure-eio.sh)
-
-add_subdirectory(fs)
-add_subdirectory(libradosstriper)
-add_subdirectory(librados)
-add_subdirectory(mds)
-add_subdirectory(mon)
-add_subdirectory(objectstore)
-add_subdirectory(os)
-add_subdirectory(osd)
-add_subdirectory(pybind)
-
 # unittest_admin_socket
 add_executable(unittest_admin_socket EXCLUDE_FROM_ALL
   admin_socket.cc
@@ -676,7 +671,5 @@ target_link_libraries(unittest_subprocess global)
 add_executable(unittest_pageset EXCLUDE_FROM_ALL test_pageset.cc)
 add_ceph_unittest(unittest_pageset ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_pageset)
 
-add_subdirectory(erasure-code EXCLUDE_FROM_ALL)
-
 #make check ends here
 
index 9590079e4ee1b539bde99c25c7bb0cf13aaa8da8..77ec6516c07927d85433b60a55eb39383f5012ff 100644 (file)
@@ -1,4 +1,6 @@
-# make check tests for erasure-code directory
+
+add_ceph_test(test-erasure-code.sh ${CMAKE_CURRENT_SOURCE_DIR}/test-erasure-code.sh)
+add_ceph_test(test-erasure-eio.sh ${CMAKE_CURRENT_SOURCE_DIR}/test-erasure-eio.sh)
 
 add_executable(ceph_erasure_code_benchmark 
   ${CMAKE_SOURCE_DIR}/src/erasure-code/ErasureCode.cc
@@ -42,6 +44,14 @@ add_executable(unittest_erasure_code_plugin EXCLUDE_FROM_ALL
   ${CMAKE_SOURCE_DIR}/src/erasure-code/ErasureCode.cc
   TestErasureCodePlugin.cc
   )
+add_ceph_unittest(unittest_erasure_code_plugin ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_erasure_code_plugin)
+target_link_libraries(unittest_erasure_code_plugin
+  global
+  osd
+  dl
+  ec_example
+  common
+  )
 add_dependencies(unittest_erasure_code_plugin
   ec_example
   ec_missing_entry_point
@@ -49,34 +59,18 @@ add_dependencies(unittest_erasure_code_plugin
   ec_hangs
   ec_fail_to_initialize
   ec_fail_to_register)
-add_test(NAME unittest_erasure_code_plugin COMMAND unittest_erasure_code_plugin WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src)
-add_dependencies(check unittest_erasure_code_plugin)
-target_link_libraries(unittest_erasure_code_plugin
-  global
-  osd
-  dl
-  ec_example
-  common
-  ${CMAKE_DL_LIBS}
-  ${UNITTEST_LIBS})
-set_target_properties(unittest_erasure_code_plugin PROPERTIES COMPILE_FLAGS
-  "${EC_LIBS_PATH_FLAG} ${UNITTEST_CXX_FLAGS}")
 
 # unittest_erasure_code
 add_executable(unittest_erasure_code EXCLUDE_FROM_ALL
   ${CMAKE_SOURCE_DIR}/src/erasure-code/ErasureCode.cc
   TestErasureCode.cc
   )
-add_test(unittest_erasure_code unittest_erasure_code)
-add_dependencies(check unittest_erasure_code)
+add_ceph_unittest(unittest_erasure_code ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_erasure_code)
 target_link_libraries(unittest_erasure_code
   global
   osd
   common
-  ${CMAKE_DL_LIBS}
-  ${UNITTEST_LIBS})
-set_target_properties(unittest_erasure_code PROPERTIES COMPILE_FLAGS
-  ${UNITTEST_CXX_FLAGS})
+  )
 
 add_library(ec_test_jerasure_neon SHARED TestJerasurePluginNEON.cc)
 add_dependencies(ec_test_jerasure_neon ${CMAKE_SOURCE_DIR}/src/ceph_ver.h)
@@ -94,10 +88,16 @@ add_library(ec_test_jerasure_generic SHARED TestJerasurePluginGeneric.cc)
 add_dependencies(ec_test_jerasure_generic ${CMAKE_SOURCE_DIR}/src/ceph_ver.h)
 target_link_libraries(ec_test_jerasure_generic pthread ${EXTRA_LIBS})
 
-# unittest_erasure_code_jerasure_plugin
+# unittest_erasure_code_plugin_jerasure
 add_executable(unittest_erasure_code_plugin_jerasure EXCLUDE_FROM_ALL
   TestErasureCodePluginJerasure.cc
   )
+add_ceph_unittest(unittest_erasure_code_plugin_jerasure ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_erasure_code_plugin_jerasure)
+target_link_libraries(unittest_erasure_code_plugin_jerasure
+  global
+  osd
+  ec_jerasure_generic
+  common)
 add_dependencies(unittest_erasure_code_plugin_jerasure
   ec_jerasure
   ec_jerasure_sse3
@@ -106,17 +106,6 @@ add_dependencies(unittest_erasure_code_plugin_jerasure
   ec_test_jerasure_sse4
   ec_test_jerasure_sse3
   ec_test_jerasure_generic)
-add_test(NAME unittest_erasure_code_plugin_jerasure COMMAND unittest_erasure_code_plugin_jerasure WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src)
-add_dependencies(check unittest_erasure_code_plugin_jerasure)
-target_link_libraries(unittest_erasure_code_plugin_jerasure
-  global
-  osd
-  ec_jerasure_generic
-  common
-  ${CMAKE_DL_LIBS}
-  ${UNITTEST_LIBS})
-set_target_properties(unittest_erasure_code_plugin_jerasure PROPERTIES COMPILE_FLAGS
-  "${EC_LIBS_PATH_FLAG} ${UNITTEST_CXX_FLAGS}")
 
 if(HAVE_BETTER_YASM_ELF64)
 
@@ -124,28 +113,22 @@ if(HAVE_BETTER_YASM_ELF64)
 add_executable(unittest_erasure_code_isa EXCLUDE_FROM_ALL
   ${CMAKE_SOURCE_DIR}/src/erasure-code/ErasureCode.cc
   TestErasureCodeIsa.cc
-)
-add_test(unittest_erasure_code_isa unittest_erasure_code_isa)
-add_dependencies(check unittest_erasure_code_isa)
+  )
+add_ceph_unittest(unittest_erasure_code_isa ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_erasure_code_isa)
 target_link_libraries(unittest_erasure_code_isa
   global
   osd
   common
   ec_isa
   erasure_code
-  dl
-  ${CMAKE_DL_LIBS}
-  ${UNITTEST_LIBS})
-set_target_properties(unittest_erasure_code_isa PROPERTIES COMPILE_FLAGS
-${UNITTEST_CXX_FLAGS})
+  )
 
 #unittest_erasure_code_plugin_isa
 add_executable(unittest_erasure_code_plugin_isa EXCLUDE_FROM_ALL
   ${CMAKE_SOURCE_DIR}/src/erasure-code/ErasureCode.cc
   TestErasureCodePluginIsa.cc
-)
-add_test(NAME unittest_erasure_code_plugin_isa COMMAND unittest_erasure_code_plugin_isa WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src)
-add_dependencies(check unittest_erasure_code_plugin_isa)
+  )
+add_ceph_unittest(unittest_erasure_code_plugin_isa ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_erasure_code_plugin_isa)
 target_link_libraries(unittest_erasure_code_plugin_isa
   global
   osd
@@ -154,10 +137,7 @@ target_link_libraries(unittest_erasure_code_plugin_isa
   crush
   dl
   erasure_code
-  ${CMAKE_DL_LIBS}
-  ${UNITTEST_LIBS})
-set_target_properties(unittest_erasure_code_plugin_isa PROPERTIES COMPILE_FLAGS
-  "${EC_LIBS_PATH_FLAG} ${UNITTEST_CXX_FLAGS}")
+  )
 endif(HAVE_BETTER_YASM_ELF64)
 
 # unittest_erasure_code_lrc
@@ -165,26 +145,20 @@ add_executable(unittest_erasure_code_lrc EXCLUDE_FROM_ALL
   TestErasureCodeLrc.cc
   ${lrc_srcs}
   )
-add_dependencies(unittest_erasure_code_lrc ec_jerasure)
-add_test(NAME unittest_erasure_code_lrc COMMAND unittest_erasure_code_lrc WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src)
-add_dependencies(check unittest_erasure_code_lrc)
+add_ceph_unittest(unittest_erasure_code_lrc ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_erasure_code_lrc)
 target_link_libraries(unittest_erasure_code_lrc
   global
   osd
   dl
   ec_lrc
   common
-  ${CMAKE_DL_LIBS}
-  ${UNITTEST_LIBS})
-set_target_properties(unittest_erasure_code_lrc PROPERTIES COMPILE_FLAGS
-  "${EC_LIBS_PATH_FLAG} ${UNITTEST_CXX_FLAGS}")
+  )
 
 # unittest_erasure_code_plugin_lrc
 add_executable(unittest_erasure_code_plugin_lrc EXCLUDE_FROM_ALL
   TestErasureCodePluginLrc.cc
   )
-add_test(NAME unittest_erasure_code_plugin_lrc COMMAND unittest_erasure_code_plugin_lrc WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src)
-add_dependencies(check unittest_erasure_code_plugin_lrc)
+add_ceph_unittest(unittest_erasure_code_plugin_lrc ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_erasure_code_plugin_lrc)
 add_dependencies(unittest_erasure_code_plugin_lrc 
   ec_lrc
   ec_jerasure
@@ -197,11 +171,7 @@ target_link_libraries(unittest_erasure_code_plugin_lrc
   dl
   ec_lrc
   ec_jerasure_generic
-  common
-  ${CMAKE_DL_LIBS}
-  ${UNITTEST_LIBS})
-set_target_properties(unittest_erasure_code_plugin_lrc PROPERTIES COMPILE_FLAGS
-  "${EC_LIBS_PATH_FLAG} ${UNITTEST_CXX_FLAGS}")
+  common)
 
 add_library(ec_test_shec_neon SHARED TestShecPluginNEON.cc)
 add_dependencies(ec_test_shec_neon ${CMAKE_SOURCE_DIR}/src/ceph_ver.h)
@@ -223,8 +193,13 @@ target_link_libraries(ec_test_shec_generic pthread ${EXTRA_LIBS})
 add_executable(unittest_erasure_code_plugin_shec EXCLUDE_FROM_ALL
   TestErasureCodePluginShec.cc
   )
-add_test(NAME unittest_erasure_code_plugin_shec COMMAND unittest_erasure_code_plugin_shec WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src)
-add_dependencies(check unittest_erasure_code_plugin_shec)
+add_ceph_unittest(unittest_erasure_code_plugin_shec ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_erasure_code_plugin_shec)
+target_link_libraries(unittest_erasure_code_plugin_shec
+  global
+  osd
+  dl
+  common
+  ec_shec_generic)
 add_dependencies(unittest_erasure_code_plugin_shec 
   ec_shec
   ec_shec_sse3
@@ -234,35 +209,22 @@ add_dependencies(unittest_erasure_code_plugin_shec
   ec_test_shec_sse3
   ec_test_shec_sse4
   ec_test_shec_generic)
-target_link_libraries(unittest_erasure_code_plugin_shec
-  global
-  osd
-  dl
-  common
-  ec_shec_generic
-  ${CMAKE_DL_LIBS}
-  ${UNITTEST_LIBS})
-set_target_properties(unittest_erasure_code_plugin_shec PROPERTIES COMPILE_FLAGS
-  "${EC_LIBS_PATH_FLAG} ${UNITTEST_CXX_FLAGS}")
-
 
 # unittest_erasure_code_example
 add_executable(unittest_erasure_code_example EXCLUDE_FROM_ALL
   ${CMAKE_SOURCE_DIR}/src/erasure-code/ErasureCode.cc
   TestErasureCodeExample.cc
 )
-add_test(unittest_erasure_code_example unittest_erasure_code_example)
-add_dependencies(check unittest_erasure_code_example)
+add_ceph_unittest(unittest_erasure_code_example ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_erasure_code_example)
 target_link_libraries(unittest_erasure_code_example
   global
   osd
   dl
   common
   erasure_code
-  ${CMAKE_DL_LIBS}
-  ${UNITTEST_LIBS})
-set_target_properties(unittest_erasure_code_example PROPERTIES COMPILE_FLAGS
-  ${UNITTEST_CXX_FLAGS})
+  ${UNITTEST_LIBS}
+  )
+set_target_properties(unittest_erasure_code_example PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS})
 
 include_directories(${CMAKE_SOURCE_DIR}/src/erasure-code/jerasure/jerasure/include)
 include_directories(${CMAKE_SOURCE_DIR}/src/erasure-code//jerasure/gf-complete/include)
@@ -271,85 +233,66 @@ include_directories(${CMAKE_SOURCE_DIR}/src/erasure-code//jerasure/gf-complete/i
 add_executable(unittest_erasure_code_jerasure EXCLUDE_FROM_ALL
   TestErasureCodeJerasure.cc
   )
-add_test(unittest_erasure_code_jerasure unittest_erasure_code_jerasure)
-add_dependencies(check unittest_erasure_code_jerasure)
+add_ceph_unittest(unittest_erasure_code_jerasure ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_erasure_code_jerasure)
 target_link_libraries(unittest_erasure_code_jerasure
   global
   osd
   common
   ec_jerasure_generic
-  ${CMAKE_DL_LIBS}
-  ${UNITTEST_LIBS})
-set_target_properties(unittest_erasure_code_jerasure PROPERTIES COMPILE_FLAGS
-  ${UNITTEST_CXX_FLAGS})
+  )
 
 include_directories(${CMAKE_SOURCE_DIR}/src/erasure-code/jerasure)
 include_directories(${CMAKE_SOURCE_DIR}/src/erasure-code/shec)
 
 # unittest_erasure_code_shec
-add_executable(unittest_erasure_code_shec
+add_executable(unittest_erasure_code_shec EXCLUDE_FROM_ALL
   TestErasureCodeShec.cc
   )
-add_test(unittest_erasure_code_shec unittest_erasure_code_shec)
-add_dependencies(check unittest_erasure_code_shec)
+add_ceph_unittest(unittest_erasure_code_shec ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_erasure_code_shec)
 target_link_libraries(unittest_erasure_code_shec
   global
   osd
   dl
   common
   ec_shec_generic
-  ${CMAKE_DL_LIBS}
-  ${UNITTEST_LIBS})
-set_target_properties(unittest_erasure_code_shec PROPERTIES COMPILE_FLAGS
-  ${UNITTEST_CXX_FLAGS})
+  )
 
 # unittest_erasure_code_shec_all
 add_executable(unittest_erasure_code_shec_all EXCLUDE_FROM_ALL
   TestErasureCodeShec_all.cc
   )
-add_test(unittest_erasure_code_shec_all unittest_erasure_code_shec_all)
-add_dependencies(check unittest_erasure_code_shec_all)
+add_ceph_unittest(unittest_erasure_code_shec_all ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_erasure_code_shec_all)
 target_link_libraries(unittest_erasure_code_shec_all
   global
   osd
   dl
   common
   ec_shec_generic
-  ${CMAKE_DL_LIBS}
-  ${UNITTEST_LIBS})
-set_target_properties(unittest_erasure_code_shec_all PROPERTIES COMPILE_FLAGS
-  ${UNITTEST_CXX_FLAGS})
+  )
 
 # unittest_erasure_code_shec_thread
 add_executable(unittest_erasure_code_shec_thread EXCLUDE_FROM_ALL
   TestErasureCodeShec_thread.cc
   )
-add_test(unittest_erasure_code_shec_thread unittest_erasure_code_shec_thread)
-add_dependencies(check unittest_erasure_code_shec_thread)
+add_ceph_unittest(unittest_erasure_code_shec_thread ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_erasure_code_shec_thread)
 target_link_libraries(unittest_erasure_code_shec_thread
   global
   osd
   dl
   common
   ec_shec_generic
-  ${CMAKE_DL_LIBS}
-  ${UNITTEST_LIBS})
-set_target_properties(unittest_erasure_code_shec_thread PROPERTIES COMPILE_FLAGS
-  ${UNITTEST_CXX_FLAGS})
+  )
+
 
 # unittest_erasure_code_shec_arguments
 add_executable(unittest_erasure_code_shec_arguments EXCLUDE_FROM_ALL
   TestErasureCodeShec_arguments.cc
   )
-add_test(unittest_erasure_code_shec_arguments unittest_erasure_code_shec_arguments)
-add_dependencies(check unittest_erasure_code_shec_arguments)
+add_ceph_unittest(unittest_erasure_code_shec_arguments ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_erasure_code_shec_arguments)
 target_link_libraries(unittest_erasure_code_shec_arguments
   global
   osd
   dl
   common
   ec_shec_generic
-  ${CMAKE_DL_LIBS}
-  ${UNITTEST_LIBS})
-set_target_properties(unittest_erasure_code_shec_arguments PROPERTIES COMPILE_FLAGS
-  ${UNITTEST_CXX_FLAGS})
+  )
index 27023e11d78e6e3834a80bb0b2148612988b7fa9..38b16d2a1af1b284b88e7fd80d81a507c8269889 100644 (file)
@@ -15,6 +15,7 @@
  */
 
 #include <errno.h>
+#include <stdlib.h>
 
 #include "global/global_init.h"
 #include "erasure-code/ErasureCode.h"
@@ -160,7 +161,8 @@ int main(int argc, char **argv)
   global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
   common_init_finish(g_ceph_context);
 
-  g_conf->set_val("erasure_code_dir", ".libs", false, false);
+  string directory = getenv("CEPH_LIB");
+  g_conf->set_val("erasure_code_dir", directory, false, false);
 
   ::testing::InitGoogleTest(&argc, argv);
   return RUN_ALL_TESTS();
index 64ef5986cae1124dfc356a6a6bf957c2f88ae470..b2657cad5dbeb3f81f4af951dd26ab00f4a9e140 100644 (file)
@@ -13,6 +13,7 @@
  *  version 2.1 of the License, or (at your option) any later version.
  * 
  */
+#include <stdlib.h>
 
 #include "include/stringify.h"
 #include "global/global_init.h"
@@ -240,7 +241,8 @@ int main(int argc, char **argv) {
   global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
   common_init_finish(g_ceph_context);
 
-  g_conf->set_val("erasure_code_dir", ".libs", false, false);
+  char *CEPH_LIB = getenv("CEPH_LIB");
+  g_conf->set_val("erasure_code_dir", CEPH_LIB, false, false);
 
   ::testing::InitGoogleTest(&argc, argv);
   return RUN_ALL_TESTS();
index 29318e0dbf9d236bf7bbe5b9601eb161b8260e25..83524908a58a8415f6308d1cca99f25fdafdb929 100644 (file)
@@ -16,6 +16,7 @@
  */
 
 #include <errno.h>
+#include <stdlib.h>
 
 #include "crush/CrushWrapper.h"
 #include "include/stringify.h"
@@ -962,7 +963,8 @@ int main(int argc, char **argv)
   global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
   common_init_finish(g_ceph_context);
 
-  g_conf->set_val("erasure_code_dir", ".libs", false, false);
+  string directory = getenv("CEPH_LIB");
+  g_conf->set_val("erasure_code_dir", directory, false, false);
 
   ::testing::InitGoogleTest(&argc, argv);
   return RUN_ALL_TESTS();
index c028e32b43c93925590ba3ab95028cc737daeb7f..33ae20d8e83511e261f7ba5ce76b01a2078f7212 100644 (file)
@@ -16,6 +16,7 @@
  */
 
 #include <errno.h>
+#include <stdlib.h>
 
 #include "crush/CrushWrapper.h"
 #include "include/stringify.h"
@@ -364,7 +365,8 @@ int main(int argc, char **argv)
   global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
   common_init_finish(g_ceph_context);
 
-  g_conf->set_val("erasure_code_dir", ".libs", false, false);
+  string directory = getenv("CEPH_LIB");
+  g_conf->set_val("erasure_code_dir", directory, false, false);
 
   ::testing::InitGoogleTest(&argc, argv);
   return RUN_ALL_TESTS();
index 772351c01dcb1ab45630475b5a3bbf5d9cbe67af..955ec7f7688376eb7a3cc08f4f741e032bd9d33c 100644 (file)
@@ -16,6 +16,7 @@
  */
 
 #include <errno.h>
+#include <stdlib.h>
 
 #include "crush/CrushWrapper.h"
 #include "common/config.h"
@@ -401,9 +402,10 @@ TEST(ErasureCodeLrc, layers_init)
     ErasureCodeLrc lrc(g_conf->erasure_code_dir);
     ErasureCodeProfile profile;
 
-    const char *description_string =
-      "[ "
-      "  [ \"_cDDD_cDD_\", \"directory=.libs\" ],"
+    string directory = getenv("CEPH_LIB");
+    string description_string = 
+      "[ " 
+      "  [ \"_cDDD_cDD_\", \"directory=" + directory + "\" ]," 
       "]";
     profile["layers"] = description_string;
     json_spirit::mArray description;
@@ -913,7 +915,8 @@ int main(int argc, char **argv)
   global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
   common_init_finish(g_ceph_context);
 
-  g_conf->set_val("erasure_code_dir", ".libs", false, false);
+  string directory = getenv("CEPH_LIB");
+  g_conf->set_val("erasure_code_dir", directory, false, false);
 
   ::testing::InitGoogleTest(&argc, argv);
   return RUN_ALL_TESTS();
index 5b0518e4e3096b221e3b0f391ee40d7fc876f141..0e1cd57b1d893709261ab064f694b257841ebb6d 100644 (file)
@@ -17,6 +17,7 @@
 
 #include <errno.h>
 #include <signal.h>
+#include <stdlib.h>
 #include "common/Thread.h"
 #include "global/global_init.h"
 #include "erasure-code/ErasureCodePlugin.h"
@@ -82,7 +83,7 @@ TEST_F(ErasureCodePluginRegistryTest, factory_mutex) {
 TEST_F(ErasureCodePluginRegistryTest, all)
 {
   ErasureCodeProfile profile;
-  string directory(".libs");
+  string directory = getenv("CEPH_LIB");
   ErasureCodeInterfaceRef erasure_code;
   ErasureCodePluginRegistry &instance = ErasureCodePluginRegistry::instance();
   EXPECT_FALSE(erasure_code);
@@ -131,7 +132,8 @@ int main(int argc, char **argv) {
   global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
   common_init_finish(g_ceph_context);
 
-  g_conf->set_val("erasure_code_dir", ".libs", false, false);
+  string directory = getenv("CEPH_LIB");
+  g_conf->set_val("erasure_code_dir", directory, false, false);
 
   ::testing::InitGoogleTest(&argc, argv);
   return RUN_ALL_TESTS();
index f1b0884c1463d7e949958f7a40f7f69274eb869a..6af000318561d994f0c730aa7b3de676fef48af4 100644 (file)
@@ -13,6 +13,7 @@
  */
 
 #include <errno.h>
+#include <stdlib.h>
 #include "arch/probe.h"
 #include "arch/intel.h"
 #include "global/global_init.h"
@@ -59,7 +60,8 @@ int main(int argc, char **argv)
   global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
   common_init_finish(g_ceph_context);
 
-  g_conf->set_val("erasure_code_dir", ".libs", false, false);
+  string directory = getenv("CEPH_LIB");
+  g_conf->set_val("erasure_code_dir", directory, false, false);
 
   ::testing::InitGoogleTest(&argc, argv);
   return RUN_ALL_TESTS();
index 1616ce667d8cad2e5e2015f51435568d2f7a9e27..1a857913fbe7cd6d62cfc8e963017fd5f51b4eef 100644 (file)
@@ -16,6 +16,7 @@
  */
 
 #include <errno.h>
+#include <stdlib.h>
 #include "arch/probe.h"
 #include "arch/intel.h"
 #include "arch/arm.h"
@@ -256,7 +257,8 @@ int main(int argc, char **argv)
   global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
   common_init_finish(g_ceph_context);
 
-  g_conf->set_val("erasure_code_dir", ".libs", false, false);
+  string directory = getenv("CEPH_LIB");
+  g_conf->set_val("erasure_code_dir", directory, false, false);
 
   ::testing::InitGoogleTest(&argc, argv);
   return RUN_ALL_TESTS();
index 03abafcbf1c9ca4f3ace81b86007bd7fc6dcd3d4..21fbd803bb4569e91657e3e0cab5ce0e91f44c99 100644 (file)
@@ -16,6 +16,7 @@
  */
 
 #include <errno.h>
+#include <stdlib.h>
 #include "arch/probe.h"
 #include "arch/intel.h"
 #include "global/global_init.h"
@@ -47,7 +48,8 @@ int main(int argc, char **argv)
   global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
   common_init_finish(g_ceph_context);
 
-  g_conf->set_val("erasure_code_dir", ".libs", false, false);
+  string directory = getenv("CEPH_LIB");
+  g_conf->set_val("erasure_code_dir", directory, false, false);
 
   ::testing::InitGoogleTest(&argc, argv);
   return RUN_ALL_TESTS();
index 270815052b3879dd302cc33e4463d5fa9a89567d..cd3adbddc636d90a172bfdf73c3f1648e6d6152d 100644 (file)
@@ -17,6 +17,7 @@
  */
 
 #include <errno.h>
+#include <stdlib.h>
 #include "arch/probe.h"
 #include "arch/intel.h"
 #include "arch/arm.h"
@@ -252,7 +253,8 @@ int main(int argc, char **argv)
   global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
   common_init_finish(g_ceph_context);
 
-  g_conf->set_val("erasure_code_dir", ".libs", false, false);
+  string directory = getenv("CEPH_LIB");
+  g_conf->set_val("erasure_code_dir", directory, false, false);
 
   ::testing::InitGoogleTest(&argc, argv);
   return RUN_ALL_TESTS();
index 1f87505aad464b0632042d7f826db2ef56370b0d..7cdde7096c1a6ad0c485c4463493cea512f6d36f 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <errno.h>
 #include <pthread.h>
+#include <stdlib.h>
 
 #include "crush/CrushWrapper.h"
 #include "osd/osd_types.h"
@@ -2674,7 +2675,8 @@ int main(int argc, char **argv)
   global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
   common_init_finish(g_ceph_context);
 
-  g_conf->set_val("erasure_code_dir", ".libs", false, false);
+  string directory = getenv("CEPH_LIB");
+  g_conf->set_val("erasure_code_dir", directory, false, false);
 
   ::testing::InitGoogleTest(&argc, argv);
   return RUN_ALL_TESTS();
index 6e9a743e4564d37652d1d674b550dc7de1c599fc..2e19351d662b47f9d8be3c3a401516a370bd4d7b 100644 (file)
@@ -19,6 +19,7 @@
 // SUMMARY: TestErasureCodeShec combination of k,m,c by 301 patterns
 
 #include <errno.h>
+#include <stdlib.h>
 
 #include "crush/CrushWrapper.h"
 #include "osd/osd_types.h"
@@ -296,7 +297,8 @@ int main(int argc, char **argv)
   global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
   common_init_finish(g_ceph_context);
 
-  g_conf->set_val("erasure_code_dir", ".libs", false, false);
+  string directory = getenv("CEPH_LIB");
+  g_conf->set_val("erasure_code_dir", directory, false, false);
 
   ::testing::InitGoogleTest(&argc, argv);
 
index 5d2f494dc14b41340e393d85fc9fbee1a435d5e6..b9b5653ad8987a78d1230925e76dd1ad96881e83 100644 (file)
@@ -19,6 +19,7 @@
 // SUMMARY: shec's gtest for each argument of minimum_to_decode()/decode()
 
 #include <errno.h>
+#include <stdlib.h>
 
 #include "crush/CrushWrapper.h"
 #include "osd/osd_types.h"
@@ -395,7 +396,8 @@ int main(int argc, char **argv)
   global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
   common_init_finish(g_ceph_context);
 
-  g_conf->set_val("erasure_code_dir", ".libs", false, false);
+  char *CEPH_LIB = getenv("CEPH_LIB");
+  g_conf->set_val("erasure_code_dir", CEPH_LIB, false, false);
 
   ::testing::InitGoogleTest(&argc, argv);
 
index 529ec1b901c63bb6d2daed905402fd8081878e96..34b7bb735160691edcb466e21a65573c2724ab19 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <errno.h>
 #include <pthread.h>
+#include <stdlib.h>
 
 #include "crush/CrushWrapper.h"
 #include "osd/osd_types.h"
@@ -93,7 +94,8 @@ int main(int argc, char **argv)
   global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
   common_init_finish(g_ceph_context);
 
-  g_conf->set_val("erasure_code_dir", ".libs", false, false);
+  char *CEPH_LIB = getenv("CEPH_LIB");
+  g_conf->set_val("erasure_code_dir", CEPH_LIB, false, false);
 
   ::testing::InitGoogleTest(&argc, argv);
   return RUN_ALL_TESTS();
index a48836657d22f90cf87f67d5cb536d98d158cedf..f5e96126ecaeab2867f8bc5caf3da0a909dc04db 100644 (file)
@@ -88,7 +88,8 @@ int ErasureCodeCommand::setup(int argc, char** argv) {
     CINIT_FLAG_NO_DEFAULT_CONFIG_FILE);
   common_init_finish(g_ceph_context);
   g_ceph_context->_conf->apply_changes(NULL);
-  g_conf->set_val("erasure_code_dir", ".libs", false, false);
+  string directory = getenv("CEPH_LIB");
+  g_conf->set_val("erasure_code_dir", directory, false, false);
 
   if (vm.count("help")) {
     cout << desc << std::endl;
index bc65123d58ba4bd9913c746ab7568668ba910e20..9241336061abbdd199aa2c3f567fe728c34b847b 100644 (file)
@@ -99,7 +99,8 @@ int ErasureCodeNonRegression::setup(int argc, char** argv) {
     CINIT_FLAG_NO_DEFAULT_CONFIG_FILE);
   common_init_finish(g_ceph_context);
   g_ceph_context->_conf->apply_changes(NULL);
-  g_conf->set_val("erasure_code_dir", ".libs", false, false);
+  string directory = getenv("CEPH_LIB");
+  g_conf->set_val("erasure_code_dir", directory, false, false);
 
   if (vm.count("help")) {
     cout << desc << std::endl;
index a8661f3e7f5a023dfefea0ac940fdacffa1ceb64..49f501f1b1ff865189450662d3cc0e2cae55ce2b 100755 (executable)
@@ -16,7 +16,7 @@
 # GNU Library Public License for more details.
 #
 
-source ../qa/workunits/ceph-helpers.sh
+source $CEPH_ROOT/qa/workunits/ceph-helpers.sh
 
 function run() {
     local dir=$1
@@ -30,14 +30,14 @@ function run() {
     setup $dir || return 1
     run_mon $dir a || return 1
     # check that erasure code plugins are preloaded
-    CEPH_ARGS='' ./ceph --admin-daemon $dir/ceph-mon.a.asok log flush || return 1
+    CEPH_ARGS='' ceph --admin-daemon $dir/ceph-mon.a.asok log flush || return 1
     grep 'load: jerasure.*lrc' $dir/mon.a.log || return 1
     for id in $(seq 0 10) ; do
         run_osd $dir $id || return 1
     done
     wait_for_clean || return 1
     # check that erasure code plugins are preloaded
-    CEPH_ARGS='' ./ceph --admin-daemon $dir/ceph-osd.0.asok log flush || return 1
+    CEPH_ARGS='' ceph --admin-daemon $dir/ceph-osd.0.asok log flush || return 1
     grep 'load: jerasure.*lrc' $dir/osd.0.log || return 1
     create_erasure_coded_pool ecpool || return 1
 
@@ -53,9 +53,9 @@ function run() {
 function create_erasure_coded_pool() {
     local poolname=$1
 
-    ./ceph osd erasure-code-profile set myprofile \
+    ceph osd erasure-code-profile set myprofile \
         ruleset-failure-domain=osd || return 1
-    ./ceph osd pool create $poolname 12 12 erasure myprofile \
+    ceph osd pool create $poolname 12 12 erasure myprofile \
         || return 1
     wait_for_clean || return 1
 }
@@ -63,7 +63,7 @@ function create_erasure_coded_pool() {
 function delete_pool() {
     local poolname=$1
 
-    ./ceph osd pool delete $poolname $poolname --yes-i-really-really-mean-it
+    ceph osd pool delete $poolname $poolname --yes-i-really-really-mean-it
 }
 
 function rados_put_get() {
@@ -79,8 +79,8 @@ function rados_put_get() {
     #
     # get and put an object, compare they are equal
     #
-    ./rados --pool $poolname put $objname $dir/ORIGINAL || return 1
-    ./rados --pool $poolname get $objname $dir/COPY || return 1
+    rados --pool $poolname put $objname $dir/ORIGINAL || return 1
+    rados --pool $poolname get $objname $dir/COPY || return 1
     diff $dir/ORIGINAL $dir/COPY || return 1
     rm $dir/COPY
 
@@ -91,11 +91,11 @@ function rados_put_get() {
     #
     local -a initial_osds=($(get_osds $poolname $objname))
     local last=$((${#initial_osds[@]} - 1))
-    ./ceph osd out ${initial_osds[$last]} || return 1
+    ceph osd out ${initial_osds[$last]} || return 1
     ! get_osds $poolname $objname | grep '\<'${initial_osds[$last]}'\>' || return 1
-    ./rados --pool $poolname get $objname $dir/COPY || return 1
+    rados --pool $poolname get $objname $dir/COPY || return 1
     diff $dir/ORIGINAL $dir/COPY || return 1
-    ./ceph osd in ${initial_osds[$last]} || return 1
+    ceph osd in ${initial_osds[$last]} || return 1
 
     rm $dir/ORIGINAL
 }
@@ -113,8 +113,8 @@ function rados_osds_out_in() {
     #
     # get and put an object, compare they are equal
     #
-    ./rados --pool $poolname put $objname $dir/ORIGINAL || return 1
-    ./rados --pool $poolname get $objname $dir/COPY || return 1
+    rados --pool $poolname put $objname $dir/ORIGINAL || return 1
+    rados --pool $poolname get $objname $dir/COPY || return 1
     diff $dir/ORIGINAL $dir/COPY || return 1
     rm $dir/COPY
 
@@ -128,7 +128,7 @@ function rados_osds_out_in() {
     local osds_list=$(get_osds $poolname $objname)
     local -a osds=($osds_list)
     for osd in 0 1 ; do
-        ./ceph osd out ${osds[$osd]} || return 1
+      ceph osd out ${osds[$osd]} || return 1
     done
     wait_for_clean || return 1
     #
@@ -137,7 +137,7 @@ function rados_osds_out_in() {
     for osd in 0 1 ; do
         ! get_osds $poolname $objname | grep '\<'${osds[$osd]}'\>' || return 1
     done
-    ./rados --pool $poolname get $objname $dir/COPY || return 1
+    rados --pool $poolname get $objname $dir/COPY || return 1
     diff $dir/ORIGINAL $dir/COPY || return 1
     #
     # bring the osds back in, , wait for the cluster
@@ -145,7 +145,7 @@ function rados_osds_out_in() {
     # implies the PG go back to using the same osds as before
     #
     for osd in 0 1 ; do
-        ./ceph osd in ${osds[$osd]} || return 1
+      ceph osd in ${osds[$osd]} || return 1
     done
     wait_for_clean || return 1
     test "$osds_list" = "$(get_osds $poolname $objname)" || return 1
@@ -157,18 +157,18 @@ function TEST_rados_put_get_lrc_advanced() {
     local poolname=pool-lrc-a
     local profile=profile-lrc-a
 
-    ./ceph osd erasure-code-profile set $profile \
+    ceph osd erasure-code-profile set $profile \
         plugin=lrc \
         mapping=DD_ \
         ruleset-steps='[ [ "chooseleaf", "osd", 0 ] ]' \
         layers='[ [ "DDc", "" ] ]'  || return 1
-    ./ceph osd pool create $poolname 12 12 erasure $profile \
+    ceph osd pool create $poolname 12 12 erasure $profile \
         || return 1
 
     rados_put_get $dir $poolname || return 1
 
     delete_pool $poolname
-    ./ceph osd erasure-code-profile rm $profile
+    ceph osd erasure-code-profile rm $profile
 }
 
 function TEST_rados_put_get_lrc_kml() {
@@ -176,17 +176,17 @@ function TEST_rados_put_get_lrc_kml() {
     local poolname=pool-lrc
     local profile=profile-lrc
 
-    ./ceph osd erasure-code-profile set $profile \
+    ceph osd erasure-code-profile set $profile \
         plugin=lrc \
         k=4 m=2 l=3 \
         ruleset-failure-domain=osd || return 1
-    ./ceph osd pool create $poolname 12 12 erasure $profile \
+    ceph osd pool create $poolname 12 12 erasure $profile \
         || return 1
 
     rados_put_get $dir $poolname || return 1
 
     delete_pool $poolname
-    ./ceph osd erasure-code-profile rm $profile
+    ceph osd erasure-code-profile rm $profile
 }
 
 function TEST_rados_put_get_isa() {
@@ -197,10 +197,10 @@ function TEST_rados_put_get_isa() {
     local dir=$1
     local poolname=pool-isa
 
-    ./ceph osd erasure-code-profile set profile-isa \
+    ceph osd erasure-code-profile set profile-isa \
         plugin=isa \
         ruleset-failure-domain=osd || return 1
-    ./ceph osd pool create $poolname 1 1 erasure profile-isa \
+    ceph osd pool create $poolname 1 1 erasure profile-isa \
         || return 1
 
     rados_put_get $dir $poolname || return 1
@@ -216,18 +216,18 @@ function TEST_rados_put_get_jerasure() {
     local poolname=pool-jerasure
     local profile=profile-jerasure
 
-    ./ceph osd erasure-code-profile set $profile \
+    ceph osd erasure-code-profile set $profile \
         plugin=jerasure \
         k=4 m=2 \
         ruleset-failure-domain=osd || return 1
-    ./ceph osd pool create $poolname 12 12 erasure $profile \
+    ceph osd pool create $poolname 12 12 erasure $profile \
         || return 1
 
     rados_put_get $dir $poolname || return 1
     rados_osds_out_in $dir $poolname || return 1
 
     delete_pool $poolname
-    ./ceph osd erasure-code-profile rm $profile
+    ceph osd erasure-code-profile rm $profile
 }
 
 function TEST_rados_put_get_shec() {
@@ -236,17 +236,17 @@ function TEST_rados_put_get_shec() {
     local poolname=pool-shec
     local profile=profile-shec
 
-    ./ceph osd erasure-code-profile set $profile \
+    ceph osd erasure-code-profile set $profile \
         plugin=shec \
         k=2 m=1 c=1 \
         ruleset-failure-domain=osd || return 1
-    ./ceph osd pool create $poolname 12 12 erasure $profile \
+    ceph osd pool create $poolname 12 12 erasure $profile \
         || return 1
 
     rados_put_get $dir $poolname || return 1
 
     delete_pool $poolname
-    ./ceph osd erasure-code-profile rm $profile
+    ceph osd erasure-code-profile rm $profile
 }
 
 function TEST_alignment_constraints() {
@@ -257,17 +257,17 @@ function TEST_alignment_constraints() {
     # imposed by the stripe width
     # See http://tracker.ceph.com/issues/8622
     #
-    local stripe_width=$(./ceph-conf --show-config-value osd_pool_erasure_code_stripe_width)
+    local stripe_width=$(ceph-conf --show-config-value osd_pool_erasure_code_stripe_width)
     local block_size=$((stripe_width - 1))
     dd if=/dev/zero of=$dir/ORIGINAL bs=$block_size count=2
-    ./rados --block-size=$block_size \
+    rados --block-size=$block_size \
         --pool ecpool put UNALIGNED $dir/ORIGINAL || return 1
     rm $dir/ORIGINAL
 }
 
 function chunk_size() {
-    local stripe_width=$(./ceph-conf --show-config-value osd_pool_erasure_code_stripe_width)
-    eval local $(./ceph osd erasure-code-profile get default | grep k=)
+    local stripe_width=$(ceph-conf --show-config-value osd_pool_erasure_code_stripe_width)
+    eval local $(ceph osd erasure-code-profile get default | grep k=)
     echo $(($stripe_width / $k))
 }
 
@@ -287,11 +287,11 @@ function verify_chunk_mapping() {
     local payload=$(printf '%*s' $(chunk_size) FIRST$poolname ; printf '%*s' $(chunk_size) SECOND$poolname)
     echo -n "$payload" > $dir/ORIGINAL
 
-    ./rados --pool $poolname put SOMETHING$poolname $dir/ORIGINAL || return 1
-    ./rados --pool $poolname get SOMETHING$poolname $dir/COPY || return 1
+    rados --pool $poolname put SOMETHING$poolname $dir/ORIGINAL || return 1
+    rados --pool $poolname get SOMETHING$poolname $dir/COPY || return 1
     local -a osds=($(get_osds $poolname SOMETHING$poolname))
     for (( i = 0; i < ${#osds[@]}; i++ )) ; do
-        ./ceph daemon osd.${osds[$i]} flush_journal
+        ceph daemon osd.${osds[$i]} flush_journal
     done
     diff $dir/ORIGINAL $dir/COPY || return 1
     rm $dir/COPY
@@ -311,13 +311,13 @@ function TEST_chunk_mapping() {
     #
     verify_chunk_mapping $dir ecpool 0 1 || return 1
 
-    ./ceph osd erasure-code-profile set remap-profile \
+    ceph osd erasure-code-profile set remap-profile \
         plugin=lrc \
         layers='[ [ "_DD", "" ] ]' \
         mapping='_DD' \
         ruleset-steps='[ [ "choose", "osd", 0 ] ]' || return 1
-    ./ceph osd erasure-code-profile get remap-profile
-    ./ceph osd pool create remap-pool 12 12 erasure remap-profile \
+    ceph osd erasure-code-profile get remap-profile
+    ceph osd pool create remap-pool 12 12 erasure remap-profile \
         || return 1
 
     #
@@ -328,7 +328,7 @@ function TEST_chunk_mapping() {
     verify_chunk_mapping $dir remap-pool 1 2 || return 1
 
     delete_pool remap-pool
-    ./ceph osd erasure-code-profile rm remap-profile
+    ceph osd erasure-code-profile rm remap-profile
 }
 
 main test-erasure-code "$@"
index 32a6e171d6099a5900400eb8a46d55bfd37cb794..7db60cd1f42d5ecf100c2e68ea2ca23c9f05ed56 100755 (executable)
@@ -16,7 +16,7 @@
 # GNU Library Public License for more details.
 #
 
-source ../qa/workunits/ceph-helpers.sh
+source $CEPH_ROOT/qa/workunits/ceph-helpers.sh
 
 function run() {
     local dir=$1
@@ -32,7 +32,7 @@ function run() {
         setup $dir || return 1
         run_mon $dir a || return 1
         # check that erasure code plugins are preloaded
-        CEPH_ARGS='' ./ceph --admin-daemon $dir/ceph-mon.a.asok log flush || return 1
+        CEPH_ARGS='' ceph --admin-daemon $dir/ceph-mon.a.asok log flush || return 1
         grep 'load: jerasure.*lrc' $dir/mon.a.log || return 1
         $func $dir || return 1
         teardown $dir || return 1
@@ -53,18 +53,18 @@ function setup_osds() {
     wait_for_clean || return 1
 
     # check that erasure code plugins are preloaded
-    CEPH_ARGS='' ./ceph --admin-daemon $dir/ceph-osd.0.asok log flush || return 1
+    CEPH_ARGS='' ceph --admin-daemon $dir/ceph-osd.0.asok log flush || return 1
     grep 'load: jerasure.*lrc' $dir/osd.0.log || return 1
 }
 
 function create_erasure_coded_pool() {
     local poolname=$1
 
-    ./ceph osd erasure-code-profile set myprofile \
+    ceph osd erasure-code-profile set myprofile \
         plugin=jerasure \
         k=2 m=1 \
         ruleset-failure-domain=osd || return 1
-    ./ceph osd pool create $poolname 1 1 erasure myprofile \
+    ceph osd pool create $poolname 1 1 erasure myprofile \
         || return 1
     wait_for_clean || return 1
 }
@@ -72,8 +72,8 @@ function create_erasure_coded_pool() {
 function delete_pool() {
     local poolname=$1
 
-    ./ceph osd pool delete $poolname $poolname --yes-i-really-really-mean-it
-    ./ceph osd erasure-code-profile rm myprofile
+    ceph osd pool delete $poolname $poolname --yes-i-really-really-mean-it
+    ceph osd erasure-code-profile rm myprofile
 }
 
 function rados_put() {
@@ -87,7 +87,7 @@ function rados_put() {
     #
     # get and put an object, compare they are equal
     #
-    ./rados --pool $poolname put $objname $dir/ORIGINAL || return 1
+    rados --pool $poolname put $objname $dir/ORIGINAL || return 1
 }
 
 function rados_get() {
@@ -101,13 +101,13 @@ function rados_get() {
     #
     if [ $expect = "1" ];
     then
-        ! ./rados --pool $poolname get $objname $dir/COPY
+        ! rados --pool $poolname get $objname $dir/COPY
         return
     fi
     #
     # get an object, compare with $dir/ORIGINAL
     #
-    ./rados --pool $poolname get $objname $dir/COPY || return 1
+    rados --pool $poolname get $objname $dir/COPY || return 1
     diff $dir/ORIGINAL $dir/COPY || return 1
     rm $dir/COPY
 }
@@ -134,10 +134,10 @@ function rados_put_get() {
         #
         local -a initial_osds=($(get_osds $poolname $objname))
         local last=$((${#initial_osds[@]} - 1))
-        ./ceph osd out ${initial_osds[$last]} || return 1
+        ceph osd out ${initial_osds[$last]} || return 1
         ! get_osds $poolname $objname | grep '\<'${initial_osds[$last]}'\>' || return 1
         rados_get $dir $poolname $objname $expect || return 1
-        ./ceph osd in ${initial_osds[$last]} || return 1
+        ceph osd in ${initial_osds[$last]} || return 1
     fi
 
     rm $dir/ORIGINAL
@@ -155,7 +155,7 @@ function inject_eio() {
     local -a initial_osds=($(get_osds $poolname $objname))
     local osd_id=${initial_osds[$shard_id]}
     set_config osd $osd_id filestore_debug_inject_read_err true || return 1
-    CEPH_ARGS='' ./ceph --admin-daemon $dir/ceph-osd.$osd_id.asok \
+    CEPH_ARGS='' ceph --admin-daemon $dir/ceph-osd.$osd_id.asok \
              injectdataerr $poolname $objname $shard_id || return 1
 }