]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits/fs: fix expect_failure function in test scripts
authorYan, Zheng <zyan@redhat.com>
Thu, 30 Jun 2016 08:05:57 +0000 (16:05 +0800)
committerYan, Zheng <zyan@redhat.com>
Wed, 20 Jul 2016 02:38:22 +0000 (10:38 +0800)
The origin expect_failure function return 0 regardness of command's
return value.

Signed-off-by: Yan, Zheng <zyan@redhat.com>
(cherry picked from commit 16f7d7c71e65cd68cecde3e5b89d189ab5950548)

qa/workunits/fs/snaps/snaptest-0.sh
qa/workunits/fs/snaps/snaptest-snap-rename.sh

index 459905c4990a49f5bbfad1fc871a5d267d26ce9f..b57763aeba919558487b80c08be36a4fee0d83cf 100755 (executable)
@@ -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
 
index 744bdb43b819c1663152e7e4a284f1c37d3eea0c..e48b10b3877c68d313c5f8a9e7718765946b1277 100755 (executable)
@@ -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