From: Yan, Zheng Date: Thu, 30 Jun 2016 08:05:57 +0000 (+0800) Subject: qa/workunits/fs: fix expect_failure function in test scripts X-Git-Tag: v10.2.3~114^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3e745ef3172aeef07038c9156d4668ca08078f18;p=ceph.git qa/workunits/fs: fix expect_failure function in test scripts The origin expect_failure function return 0 regardness of command's return value. Signed-off-by: Yan, Zheng (cherry picked from commit 16f7d7c71e65cd68cecde3e5b89d189ab5950548) --- diff --git a/qa/workunits/fs/snaps/snaptest-0.sh b/qa/workunits/fs/snaps/snaptest-0.sh index 459905c4990a4..b57763aeba919 100755 --- a/qa/workunits/fs/snaps/snaptest-0.sh +++ b/qa/workunits/fs/snaps/snaptest-0.sh @@ -1,10 +1,7 @@ #!/bin/sh -x expect_failure() { - if [ `"$@"` -e 0 ]; then - return 1 - fi - return 0 + if "$@"; then return 1; else return 0; fi } set -e diff --git a/qa/workunits/fs/snaps/snaptest-snap-rename.sh b/qa/workunits/fs/snaps/snaptest-snap-rename.sh index 744bdb43b819c..e48b10b3877c6 100755 --- a/qa/workunits/fs/snaps/snaptest-snap-rename.sh +++ b/qa/workunits/fs/snaps/snaptest-snap-rename.sh @@ -1,10 +1,7 @@ #!/bin/sh -x expect_failure() { - if [ `"$@"` -e 0 ]; then - return 1 - fi - return 0 + if "$@"; then return 1; else return 0; fi } set -e