From: Loic Dachary Date: Wed, 1 Apr 2015 12:38:29 +0000 (+0200) Subject: tests: do not use -e in ceph-disk.sh X-Git-Tag: v9.0.0~44^2^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=eaf89661d9cb51551697ef14118dd27212a874f5;p=ceph.git tests: do not use -e in ceph-disk.sh The tests explicitly return on error when relevant. Add two error cases: * detect when the allocation of a loop device fails. * in the outer loop, return immediately if one of the test fails Signed-off-by: Loic Dachary --- diff --git a/src/test/ceph-disk.sh b/src/test/ceph-disk.sh index 1a99a755a13..8524098a9da 100755 --- a/src/test/ceph-disk.sh +++ b/src/test/ceph-disk.sh @@ -15,8 +15,6 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library Public License for more details. # -set -e - source test/test_btrfs_common.sh PS4='${FUNCNAME[0]}: $LINENO: ' @@ -450,17 +448,21 @@ function test_activate_dev() { loop_sanity_check || return 1 - local disk=$(create_dev vdf.disk) - local journal=$(create_dev vdg.disk) - local newdisk=$(create_dev vdh.disk) + local dir=$(pwd)/$DIR + local disk + disk=$(create_dev $dir/vdf.disk) || return 1 + local journal + journal=$(create_dev $dir/vdg.disk) || return 1 + local newdisk + newdisk=$(create_dev $dir/vdh.disk) || return 1 activate_dev_body $disk $journal $newdisk status=$? test $status != 0 && teardown - destroy_dev vdf.disk $disk - destroy_dev vdg.disk $journal - destroy_dev vdh.disk $newdisk + destroy_dev $dir/vdf.disk $disk + destroy_dev $dir/vdg.disk $journal + destroy_dev $dir/vdh.disk $newdisk return $status } @@ -583,8 +585,10 @@ function run() { local actions=${@:-$default_actions} for action in $actions ; do setup - $action || return 1 + $action + status=$? teardown + test $status != 0 || return $status done }