From: Mykola Golub Date: Sun, 7 Oct 2018 12:09:25 +0000 (+0300) Subject: qa/workunits/rbd: fix cli generic namespace test X-Git-Tag: v14.0.1~105^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F24457%2Fhead;p=ceph.git qa/workunits/rbd: fix cli generic namespace test expect_fail incorrectly unset '-e' option and if a consequent test failed it did not abort the execution. And two typos in the namespace tests were not detected due to this. Signed-off-by: Mykola Golub --- diff --git a/qa/workunits/rbd/cli_generic.sh b/qa/workunits/rbd/cli_generic.sh index 7b1f41cec200..3f2289364808 100755 --- a/qa/workunits/rbd/cli_generic.sh +++ b/qa/workunits/rbd/cli_generic.sh @@ -10,12 +10,8 @@ rbd ls | wc -l | grep -v '^0$' && echo "nonempty rbd pool, aborting! run this s IMGS="testimg1 testimg2 testimg3 testimg4 testimg5 testimg6 testimg-diff1 testimg-diff2 testimg-diff3 foo foo2 bar bar2 test1 test2 test3 test4 clone2" -expect_fail() -{ - set -x - set +e - "$@" - if [ $? == 0 ]; then return 1; else return 0; fi +expect_fail() { + "$@" && return 1 || return 0 } tiered=0 @@ -644,7 +640,7 @@ test_namespace() { rbd snap create rbd/test1/image1@1 rbd clone --rbd-default-clone-format 2 rbd/test1/image1@1 rbd/test2/image1 rbd snap rm rbd/test1/image1@1 - cmp <(rbd export rbd/test1/image1@1 -) <(rbd export rbd/test2/image1 -) + cmp <(rbd export rbd/test1/image1 -) <(rbd export rbd/test2/image1 -) rbd rm rbd/test2/image1 # default ns to test1 ns clone @@ -653,7 +649,7 @@ test_namespace() { rbd snap create rbd/image2@1 rbd clone --rbd-default-clone-format 2 rbd/image2@1 rbd/test2/image2 rbd snap rm rbd/image2@1 - cmp <(rbd export rbd/image2@1 -) <(rbd export rbd/test2/image2 -) + cmp <(rbd export rbd/image2 -) <(rbd export rbd/test2/image2 -) expect_fail rbd rm rbd/image2 rbd rm rbd/test2/image2 rbd rm rbd/image2