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: v15.2.13~2^2~11^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F39965%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) --- diff --git a/qa/workunits/rbd/rbd_mirror_helpers.sh b/qa/workunits/rbd/rbd_mirror_helpers.sh index 3e26f977cd83..82299715e231 100755 --- a/qa/workunits/rbd/rbd_mirror_helpers.sh +++ b/qa/workunits/rbd/rbd_mirror_helpers.sh @@ -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() diff --git a/src/test/rbd_mirror/random_write.cc b/src/test/rbd_mirror/random_write.cc index 16693d2ae41d..6cb544c4508a 100644 --- a/src/test/rbd_mirror/random_write.cc +++ b/src/test/rbd_mirror/random_write.cc @@ -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();