diff --git a/examples/test/test_linearbandwidth.py b/examples/test/test_linearbandwidth.py index 2a01edc1df3fd473f84d6eb05a6c0b5716330250..b6c47fd55f3c36490db312fb38acc9bddab3af61 100755 --- a/examples/test/test_linearbandwidth.py +++ b/examples/test/test_linearbandwidth.py @@ -1,26 +1,21 @@ #!/usr/bin/env python -"""TEST""" +""" +Test for linearbandwidth.py +""" import unittest import pexpect -from mininet.log import setLogLevel -#from mininet.net import Mininet -#from mininet.node import CPULimitedHost -#from mininet.link import TCLink - -#from mininet.examples.simpleperf import SingleSwitchTopo class testLinearBandwidth( unittest.TestCase ): - "Test ping with single switch topology (common code)." - - prompt = 'mininet>' def testLinearBandwidth( self ): - count = 0 - tolerance = 0.5 - opts = [ '\*\*\* Linear network results', '(\d+)\s+([\d\.]+) (.bits)', pexpect.EOF ] + "Verify that bandwidth is monotonically decreasing as # of hops increases" p = pexpect.spawn( 'python -m mininet.examples.linearbandwidth' ) + count = 0 + opts = [ '\*\*\* Linear network results', + '(\d+)\s+([\d\.]+) (.bits)', + pexpect.EOF ] while True: index = p.expect( opts, timeout=600 ) if index == 0: @@ -44,5 +39,4 @@ def testLinearBandwidth( self ): self.assertTrue( count > 0 ) if __name__ == '__main__': - setLogLevel( 'warning' ) unittest.main()