]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tests: teardown on ceph-disk error
authorLoic Dachary <ldachary@redhat.com>
Sat, 7 Mar 2015 09:47:10 +0000 (10:47 +0100)
committerLoic Dachary <ldachary@redhat.com>
Tue, 10 Mar 2015 16:50:29 +0000 (17:50 +0100)
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 <ldachary@redhat.com>
src/test/ceph-disk.sh

index d265a573a09dde61ea4f4c762faa434356022b77..28be510ea4b6da1612f6a7c1cdae887bfd98efc3 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 #
 # Copyright (C) 2014 Cloudwatt <libre.licensing@cloudwatt.com>
-# Copyright (C) 2014 Red Hat <contact@redhat.com>
+# Copyright (C) 2014, 2015 Red Hat <contact@redhat.com>
 #
 # Author: Loic Dachary <loic@dachary.org>
 #
@@ -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