Skip to content
Snippets Groups Projects
Commit 1d555e72 authored by Brian O'Connor's avatar Brian O'Connor
Browse files

cleaned up and commented test_linearbandwidth.py

parent e6fe480a
No related branches found
No related tags found
No related merge requests found
#!/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()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment