Change in vdsm[master]: tests: modprobe validation handle failure
edwardh at redhat.com
edwardh at redhat.com
Tue Dec 1 20:39:51 UTC 2015
Edward Haas has uploaded a new change for review.
Change subject: tests: modprobe validation handle failure
......................................................................
tests: modprobe validation handle failure
On validation failure, add a skip action with
a proper message.
Change-Id: I276cc2cf2205323648364c62b9db8f40e14cc983
Signed-off-by: Edward Haas <edwardh at redhat.com>
---
M tests/modprobe.py
1 file changed, 10 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/38/49538/1
diff --git a/tests/modprobe.py b/tests/modprobe.py
index 82e2237..90b6fc1 100644
--- a/tests/modprobe.py
+++ b/tests/modprobe.py
@@ -18,6 +18,7 @@
# Refer to the README and COPYING files for full details of the license
import os
from functools import wraps
+from nose.plugins.skip import SkipTest
from vdsm import utils
@@ -37,6 +38,9 @@
if not os.path.exists('/sys/module/dummy'):
cmd_modprobe = [modprobe.cmd, "dummy"]
rc, out, err = utils.execCmd(cmd_modprobe, sudo=True)
+ if rc != 0:
+ raise SkipTest("This test requires dummy module")
+
return f(*args, **kwargs)
return wrapper
@@ -51,6 +55,9 @@
if not os.path.exists('/sys/module/bonding'):
cmd_modprobe = [modprobe.cmd, "bonding"]
rc, out, err = utils.execCmd(cmd_modprobe, sudo=True)
+ if rc != 0:
+ raise SkipTest("This test requires bonding module")
+
return f(*args, **kwargs)
return wrapper
@@ -66,5 +73,8 @@
if not os.path.exists('/sys/module/veth'):
cmd_modprobe = [modprobe.cmd, "veth"]
rc, out, err = utils.execCmd(cmd_modprobe, sudo=True)
+ if rc != 0:
+ raise SkipTest("This test requires veth module")
+
return f(*args, **kwargs)
return wrapper
--
To view, visit https://gerrit.ovirt.org/49538
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I276cc2cf2205323648364c62b9db8f40e14cc983
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Edward Haas <edwardh at redhat.com>
More information about the vdsm-patches
mailing list