]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/rbd-mirror: fix broken ceph_test_rbd_mirror_random_write 39965/head
authorJason Dillaman <dillaman@redhat.com>
Wed, 3 Feb 2021 04:34:18 +0000 (23:34 -0500)
committerJason Dillaman <dillaman@redhat.com>
Tue, 9 Mar 2021 21:45:01 +0000 (16:45 -0500)
It appears that commit 6eb8f30a238 broke the test utility and
its failure was masked by the test case that expected a failure
due to a timeout force-killing the app.

Fixes: https://tracker.ceph.com/issues/49117
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 8643b046fb4d5b05b4c75b83f16cd8ccc6a8b0a0)

qa/workunits/rbd/rbd_mirror_helpers.sh
src/test/rbd_mirror/random_write.cc

index 3e26f977cd83ab4c78c1b53efab8f05066a939ed..82299715e231e1e5d2110e5825eda8c4eafd4c80 100755 (executable)
@@ -1175,10 +1175,18 @@ stress_write_image()
     local image=$3
     local duration=$(awk 'BEGIN {srand(); print int(10 * rand()) + 5}')
 
+    set +e
     timeout ${duration}s ceph_test_rbd_mirror_random_write \
         --cluster ${cluster} ${pool} ${image} \
         --debug-rbd=20 --debug-journaler=20 \
-        2> ${TEMPDIR}/rbd-mirror-random-write.log || true
+        2> ${TEMPDIR}/rbd-mirror-random-write.log
+    error_code=$?
+    set -e
+
+    if [ $error_code -eq 124 ]; then
+        return 0
+    fi
+    return 1
 }
 
 show_diff()
index 16693d2ae41d91cf7db85e0be447b9deca8d14fb..6cb544c4508af9217e69dde88df39c039ecdb40e 100644 (file)
@@ -161,8 +161,8 @@ int main(int argc, const char **argv)
   }
 
   auto cct = global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT,
-                        CODE_ENVIRONMENT_UTILITY,
-                        CINIT_FLAG_NO_DEFAULT_CONFIG_FILE);
+                         CODE_ENVIRONMENT_UTILITY,
+                         CINIT_FLAG_NO_MON_CONFIG);
 
   if (args.size() < 2) {
     usage();