]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/librbd: allow parallel runs of run-rbd-unit-tests 36726/head
authorWillem Jan Withagen <wjw@digiware.nl>
Mon, 2 Sep 2019 14:28:23 +0000 (16:28 +0200)
committerJason Dillaman <dillaman@redhat.com>
Wed, 19 Aug 2020 20:59:54 +0000 (16:59 -0400)
Running all tests sequential makes it the longest test of
`make check`, with each partial test taking around 500 sec.
Running 6 tests thus takes almost an hour.

Cut this down if ctest runs tests in parallel

Default behaviour of src/test/run-rbd-unit-tests.sh is kept:
  Without parameters the tests are run in sequence

To run unitttest_librbd with RBD_FEATURES, use `N` as parameter

Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
(cherry picked from commit e2f292983852f486c1eb56f0f83f8f29d47b96dd)

src/test/CMakeLists.txt
src/test/run-rbd-unit-tests.sh

index 93d75e1a7e325aec64b24b21fd3c1e6e858339af..30afc7739fdd2a833353f187d9286f653f109da6 100644 (file)
@@ -531,7 +531,14 @@ if(WITH_FIO OR WITH_SYSTEM_FIO)
 endif()
 
 if(WITH_RBD)
-  add_ceph_test(run-rbd-unit-tests.sh ${CMAKE_CURRENT_SOURCE_DIR}/run-rbd-unit-tests.sh)
+  # Run rbd-unit-tests separate so they an run in parallel
+  # For values see: src/include/rbd/features.h
+  add_ceph_test(run-rbd-unit-tests-N.sh   ${CMAKE_CURRENT_SOURCE_DIR}/run-rbd-unit-tests.sh N)
+  add_ceph_test(run-rbd-unit-tests-0.sh   ${CMAKE_CURRENT_SOURCE_DIR}/run-rbd-unit-tests.sh 0)
+  add_ceph_test(run-rbd-unit-tests-1.sh   ${CMAKE_CURRENT_SOURCE_DIR}/run-rbd-unit-tests.sh 1)
+  add_ceph_test(run-rbd-unit-tests-61.sh  ${CMAKE_CURRENT_SOURCE_DIR}/run-rbd-unit-tests.sh 61)
+  add_ceph_test(run-rbd-unit-tests-109.sh ${CMAKE_CURRENT_SOURCE_DIR}/run-rbd-unit-tests.sh 109)
+  add_ceph_test(run-rbd-unit-tests-127.sh ${CMAKE_CURRENT_SOURCE_DIR}/run-rbd-unit-tests.sh 127)
   if(FREEBSD)
     add_ceph_test(rbd-ggate.sh ${CMAKE_CURRENT_SOURCE_DIR}/rbd-ggate.sh)
   endif(FREEBSD)
index 7c856d609841ba474a8494c019c98b2824f6c28b..8c5a29ee6334596715b785f01ec6b6bf935f8bba 100755 (executable)
@@ -6,10 +6,18 @@ set -ex
 source $(dirname $0)/detect-build-env-vars.sh
 PATH="$CEPH_BIN:$PATH"
 
-unset RBD_FEATURES
-unittest_librbd
+if [ $# = 0 ]; then
+  # mimic the old behaviour
+  TESTS='0 1 61 109 127'
+  unset RBD_FEATURES; unittest_librbd
+elif [ $# = 1 -a "${1}" = N ] ; then
+  # new style no feature request
+  unset RBD_FEATURES; unittest_librbd
+else 
+  TESTS="$*"
+fi
 
-for i in 0 1 61 109 127
+for i in ${TESTS}
 do
     RBD_FEATURES=$i unittest_librbd
 done