From: Jason Dillaman Date: Wed, 3 Feb 2021 04:34:18 +0000 (-0500) Subject: test/rbd-mirror: fix broken ceph_test_rbd_mirror_random_write X-Git-Tag: v14.2.17~21^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F39650%2Fhead;p=ceph.git test/rbd-mirror: fix broken ceph_test_rbd_mirror_random_write 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 (cherry picked from commit 8643b046fb4d5b05b4c75b83f16cd8ccc6a8b0a0) Conflicts: qa/workunits/rbd/rbd_mirror_helpers.sh - no show_diff function in nautilus --- diff --git a/qa/workunits/rbd/rbd_mirror_helpers.sh b/qa/workunits/rbd/rbd_mirror_helpers.sh index 20b7440e5ec29..563e256cdd1b5 100755 --- a/qa/workunits/rbd/rbd_mirror_helpers.sh +++ b/qa/workunits/rbd/rbd_mirror_helpers.sh @@ -1002,10 +1002,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 + --cluster ${cluster} ${pool} ${image} \ + --debug-rbd=20 --debug-journaler=20 \ + 2> ${TEMPDIR}/rbd-mirror-random-write.log + error_code=$? + set -e + + if [ $error_code -eq 124 ]; then + return 0 + fi + return 1 } compare_images() diff --git a/src/test/rbd_mirror/random_write.cc b/src/test/rbd_mirror/random_write.cc index 34145206da6b3..8a5423f0063fc 100644 --- a/src/test/rbd_mirror/random_write.cc +++ b/src/test/rbd_mirror/random_write.cc @@ -164,8 +164,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();