summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarian Csontos <mcsontos@redhat.com>2019-12-16 11:25:37 +0100
committerMarian Csontos <mcsontos@redhat.com>2019-12-16 12:06:42 +0100
commita2a993d99558a719b0f4450e7b2fc8fc43bb5962 (patch)
treefdabb965d28adf18d279e56a5bf717b33539c806
parent2173bdb82177fc687474b72561742955cb292522 (diff)
downloadlvm2-dev-mcsontos-tests-201912.tar.gz
tests: VDO detection in dbus testsdev-mcsontos-tests-201912
-rwxr-xr-xtest/dbus/lvmdbustest.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/test/dbus/lvmdbustest.py b/test/dbus/lvmdbustest.py
index 522e3ca13..82159685d 100755
--- a/test/dbus/lvmdbustest.py
+++ b/test/dbus/lvmdbustest.py
@@ -193,11 +193,14 @@ def call_lvm(command):
def supports_vdo():
cmd = ['segtypes']
+ modprobe = Popen(["modprobe", "kvdo"], stdout=PIPE, stderr=PIPE, close_fds=True, env=os.environ)
+ modprobe.communicate()
+ if modprobe.returncode != 0:
+ return False
rc, out, err = call_lvm(cmd)
- if rc == 0:
- if "vdo" in out:
- return True
- return False
+ if rc != 0 or "vdo" not in out:
+ return False
+ return True
# noinspection PyUnresolvedReferences