From 29e5bee34ea38028bae5afb3577f679afd7a793e Mon Sep 17 00:00:00 2001 From: Cody Burkard Date: Tue, 10 Jun 2014 22:15:49 -0700 Subject: [PATCH] fixed issue with AssertTrue and skip first test if using old OVS version --- examples/test/test_numberedports.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/test/test_numberedports.py b/examples/test/test_numberedports.py index f92e482..b565d3e 100755 --- a/examples/test/test_numberedports.py +++ b/examples/test/test_numberedports.py @@ -7,10 +7,11 @@ Test for numberedports.py import unittest import pexpect from collections import defaultdict - +from mininet.node import OVSSwitch class testNumberedports( unittest.TestCase ): + @unittest.skipIf( OVSSwitch.setup() or OVSSwitch.isOldOVS(), "old version of OVS" ) def testConsistency( self ): """verify consistency between mininet and ovs ports""" p = pexpect.spawn( 'python -m mininet.examples.numberedports' ) @@ -28,7 +29,7 @@ class testNumberedports( unittest.TestCase ): elif index == 2: self.assertNotEqual( 0, count ) break - self.assertTrue( correct_ports ) + self.assertTrue( correct_ports ) def testNumbering( self ): """verify that all of the port numbers are printed correctly and consistent with their interface""" @@ -44,8 +45,8 @@ class testNumberedports( unittest.TestCase ): ofport = p.match.group( 2 ) self.assertEqual( intfport, ofport ) elif index == 1: - self.assertNotEqual( 0, count_intfs ) break + self.assertNotEqual( 0, count_intfs ) if __name__ == '__main__': unittest.main()