From: Loic Dachary Date: Sat, 7 Mar 2015 09:47:10 +0000 (+0100) Subject: tests: teardown on ceph-disk error X-Git-Tag: v9.0.0~167^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8d52dc185e50d8bd1f01c2159e1befe60552ed84;p=ceph.git tests: teardown on ceph-disk error The activate_dev error must kill all process with teardown before attempting to umount the devices when an error happens. Otherwise the device fails to be unmounted and the loop devices are never freed. Signed-off-by: Loic Dachary --- diff --git a/src/test/ceph-disk.sh b/src/test/ceph-disk.sh index d265a573a09d..28be510ea4b6 100755 --- a/src/test/ceph-disk.sh +++ b/src/test/ceph-disk.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Copyright (C) 2014 Cloudwatt -# Copyright (C) 2014 Red Hat +# Copyright (C) 2014, 2015 Red Hat # # Author: Loic Dachary # @@ -350,6 +350,7 @@ function test_activate_dev() { activate_dev_body $disk $journal $newdisk status=$? + test $status != 0 && teardown destroy_dev vdf.disk $disk destroy_dev vdg.disk $journal @@ -399,6 +400,7 @@ function test_activate_dmcrypt_dev() { activate_dmcrypt_dev_body $disk $journal $newdisk status=$? + test $status != 0 && teardown destroy_dmcrypt_dev vdf.disk $disk destroy_dmcrypt_dev vdg.disk $journal