Change in vdsm[master]: tests: Abuse permutations for running the tests multipe times

nsoffer at redhat.com nsoffer at redhat.com
Tue Aug 4 17:31:51 UTC 2015


Nir Soffer has uploaded a new change for review.

Change subject: tests: Abuse permutations for running the tests multipe times
......................................................................

tests: Abuse permutations for running the tests multipe times

This change run the randomly-failing tests multiple times for verifying
the previous patch.

Change-Id: I2405850c9f985f1bd8cf1b2bd5f2190619e7db65
Signed-off-by: Nir Soffer <nsoffer at redhat.com>
---
M tests/tcTests.py
1 file changed, 17 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/71/44371/1

diff --git a/tests/tcTests.py b/tests/tcTests.py
index e84d96c..8eb3118 100644
--- a/tests/tcTests.py
+++ b/tests/tcTests.py
@@ -29,6 +29,7 @@
 from subprocess import Popen, PIPE
 
 from testlib import VdsmTestCase as TestCaseBase
+from testlib import expandPermutations, permutations
 from testValidation import ValidateRunningAsRoot
 from nettestlib import Bridge, Tap, requires_brctl, requires_tc
 
@@ -36,6 +37,11 @@
 from network import tc
 
 
+def repeat():
+    return permutations([["%02d" % i] for i in range(20)])
+
+
+ at expandPermutations
 class TestQdisc(TestCaseBase):
 
     @ValidateRunningAsRoot
@@ -56,22 +62,26 @@
         tc._qdisc_replace_ingress(self._bridge.devName)
         self.assertIn("qdisc ingress", self._showQdisc())
 
-    def testToggleIngress(self):
+    @repeat()
+    def testToggleIngress(self, run):
         self._addIngress()
         tc._qdisc_del(self._bridge.devName, 'ingress')
         self.assertNotIn("qdisc ingress", self._showQdisc())
 
-    def testQdiscsOfDevice(self):
+    @repeat()
+    def testQdiscsOfDevice(self, run):
         self._addIngress()
         self.assertEquals(("ffff:", ),
                           tuple(tc._qdiscs_of_device(self._bridge.devName)))
 
-    def testReplacePrio(self):
+    @repeat()
+    def testReplacePrio(self, run):
         self._addIngress()
         tc.qdisc.replace(self._bridge.devName, 'prio', parent=None)
         self.assertIn("root", self._showQdisc())
 
-    def testException(self):
+    @repeat()
+    def testException(self, run):
         self.assertRaises(tc.TrafficControlException, tc._qdisc_del,
                           "__nosuchiface__", 'ingress')
 
@@ -240,6 +250,7 @@
             self.assertEqual(parsed, correct)
 
 
+ at expandPermutations
 class TestPortMirror(TestCaseBase):
 
     """
@@ -347,7 +358,8 @@
         self.assertFalse(self._sendPing(), "Bridge received mirrored ping "
                          "requests, but mirroring is unset.")
 
-    def testMirroringWithDistraction(self):
+    @repeat()
+    def testMirroringWithDistraction(self, run):
         "setting another mirror action should not obstract the first one"
         tc.setPortMirroring(self._bridge0.devName, self._bridge2.devName)
         self.testMirroring()


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2405850c9f985f1bd8cf1b2bd5f2190619e7db65
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer at redhat.com>


More information about the vdsm-patches mailing list