From 1d555e724b5380c905c412b6b0eb593950d19ccc Mon Sep 17 00:00:00 2001 From: Brian O'Connor <bocon13@gmail.com> Date: Tue, 10 Sep 2013 15:38:32 -0700 Subject: [PATCH] cleaned up and commented test_linearbandwidth.py --- examples/test/test_linearbandwidth.py | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/examples/test/test_linearbandwidth.py b/examples/test/test_linearbandwidth.py index 2a01edc1..b6c47fd5 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() -- GitLab