diff options
author | Marian Csontos <mcsontos@redhat.com> | 2019-12-16 11:25:37 +0100 |
---|---|---|
committer | Marian Csontos <mcsontos@redhat.com> | 2019-12-16 12:06:42 +0100 |
commit | a2a993d99558a719b0f4450e7b2fc8fc43bb5962 (patch) | |
tree | fdabb965d28adf18d279e56a5bf717b33539c806 | |
parent | 2173bdb82177fc687474b72561742955cb292522 (diff) | |
download | lvm2-dev-mcsontos-tests-201912.tar.gz |
tests: VDO detection in dbus testsdev-mcsontos-tests-201912
-rwxr-xr-x | test/dbus/lvmdbustest.py | 11 |
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 |