From 8d52dc185e50d8bd1f01c2159e1befe60552ed84 Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Sat, 7 Mar 2015 10:47:10 +0100 Subject: [PATCH] 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 --- src/test/ceph-disk.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/test/ceph-disk.sh b/src/test/ceph-disk.sh index d265a573a09..28be510ea4b 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