From: Mike Qiu <[email protected]>

Currently, when run the tests while the clean up didn't done
last time, it will raise an error like:

Test failed: CmdError:
Command <fuser -k /dev/vg_kvm_test_enospc/lv_kvm_test_enospc>
failed, rc=1, Command returned non-zero exit status
[context: performing enospc setup --> performing enospc cleanup]
* Command:
    fuser -k /dev/vg_kvm_test_enospc/lv_kvm_test_enospc
Exit status: 1
Duration: 0.0501132011414

That is the link /dev/vg_kvm_test_enospc/lv_kvm_test_enospc
exist, but no user. thus the command line:
    fuser -k /dev/vg_kvm_test_enospc/lv_kvm_test_enospc
will return 1(fuser will always return none-zero for nobody use).

That's why the error raise. Just ignore the return status
of the fuser.

Signed-off-by: Mike Qiu <[email protected]>
---
 qemu/tests/enospc.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/qemu/tests/enospc.py b/qemu/tests/enospc.py
index dca9f41..9345e1d 100644
--- a/qemu/tests/enospc.py
+++ b/qemu/tests/enospc.py
@@ -69,7 +69,7 @@ class EnospcConfig(object):
     def cleanup(self):
         error.context("performing enospc cleanup")
         if os.path.islink(self.lvtest_device):
-            utils.run("fuser -k %s" % self.lvtest_device)
+            utils.run("fuser -k %s" % self.lvtest_device, ignore_status=True)
             time.sleep(2)
         l_result = utils.run("lvdisplay")
         # Let's remove all volumes inside the volume group created
-- 
1.7.7.6

_______________________________________________
Virt-test-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/virt-test-devel

Reply via email to