Change in vdsm[ovirt-3.6]: automation: Disable tests requiring tun device

fromani at redhat.com fromani at redhat.com
Mon Oct 26 12:41:02 UTC 2015


Hello Ido Barkan, David Caro, Dan Kenigsberg,

I'd like you to do a code review.  Please visit

    https://gerrit.ovirt.org/47732

to review the following change.

Change subject: automation: Disable tests requiring tun device
......................................................................

automation: Disable tests requiring tun device

In commit a9e9e7bcc7a1 (tests: temporarily exclude few tests to restore
CI) we disabled too many networking tests, including unrelated test
from utilsTests.py that happen to have the same name.

This patch adds @require_tun decorator to disable tests needing the tun
device.

Other tests seems to run fine in the CI, giving them another chance.

Change-Id: I3be2fe5774ec7f964416e02f809f44263e7d5644
Signed-off-by: Nir Soffer <nsoffer at redhat.com>
Reviewed-on: https://gerrit.ovirt.org/46641
Continuous-Integration: Jenkins CI
Reviewed-by: Ido Barkan <ibarkan at redhat.com>
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
Reviewed-by: David Caro <dcaroest at redhat.com>
---
M automation/check-patch.sh
M tests/nettestlib.py
M tests/tcTests.py
3 files changed, 11 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/32/47732/1

diff --git a/automation/check-patch.sh b/automation/check-patch.sh
index bc50463..39a0676 100755
--- a/automation/check-patch.sh
+++ b/automation/check-patch.sh
@@ -7,16 +7,6 @@
 
 export NOSE_SKIP_STRESS_TESTS=1
 
-# this redefines 'ugly' but looks like NOSE_EXCLUDE works at test method level,
-# not at module neither at testcase level, so we have no choice but this.
-export NOSE_EXCLUDE="\
-.*testGetBondingOptions.*|\
-testMirroring.*|\
-testToggleIngress|\
-testException|\
-testQdiscsOfDevice|\
-testReplacePrio\
-"
 
 ./autogen.sh --system --enable-hooks
 make check
diff --git a/tests/nettestlib.py b/tests/nettestlib.py
index e9cea4d..1f85093 100644
--- a/tests/nettestlib.py
+++ b/tests/nettestlib.py
@@ -175,3 +175,12 @@
         check_tc()
         return f(*a, **kw)
     return wrapper
+
+
+def requires_tun(f):
+    @functools.wraps(f)
+    def wrapper(*a, **kw):
+        if not os.path.exists("/dev/net/tun"):
+            raise SkipTest("This test requires tun device")
+        return f(*a, **kw)
+    return wrapper
diff --git a/tests/tcTests.py b/tests/tcTests.py
index bee7439..2e1ff6b 100644
--- a/tests/tcTests.py
+++ b/tests/tcTests.py
@@ -30,7 +30,7 @@
 
 from testlib import VdsmTestCase as TestCaseBase
 from testValidation import ValidateRunningAsRoot
-from nettestlib import Bridge, Tap, requires_tc
+from nettestlib import Bridge, Tap, requires_tc, requires_tun
 
 from vdsm.constants import EXT_TC
 from network import tc
@@ -287,6 +287,7 @@
 
     @ValidateRunningAsRoot
     @requires_tc
+    @requires_tun
     def setUp(self):
         self._tap0 = Tap()
         self._tap1 = Tap()


-- 
To view, visit https://gerrit.ovirt.org/47732
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3be2fe5774ec7f964416e02f809f44263e7d5644
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: David Caro <dcaroest at redhat.com>
Gerrit-Reviewer: Ido Barkan <ibarkan at redhat.com>


More information about the vdsm-patches mailing list