cleaned up and commented test_limit.py
This commit is contained in:
@@ -1,19 +1,20 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
"""TEST"""
|
"""
|
||||||
|
Test for limit.py
|
||||||
|
"""
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
import pexpect
|
import pexpect
|
||||||
from mininet.log import setLogLevel
|
|
||||||
|
|
||||||
class testLimit( unittest.TestCase ):
|
class testLimit( unittest.TestCase ):
|
||||||
"Test ping with single switch topology (common code)."
|
|
||||||
|
|
||||||
def testLimit( self ):
|
def testLimit( self ):
|
||||||
|
"Verify that CPU limits are within a 1% tolerance of limit for each scheduler"
|
||||||
|
p = pexpect.spawn( 'python -m mininet.examples.limit' )
|
||||||
opts = [ '\*\*\* Testing network ([\d\.]+) Mbps',
|
opts = [ '\*\*\* Testing network ([\d\.]+) Mbps',
|
||||||
'\*\*\* Results: \[([\d\., ]+)\]',
|
'\*\*\* Results: \[([\d\., ]+)\]',
|
||||||
pexpect.EOF ]
|
pexpect.EOF ]
|
||||||
p = pexpect.spawn( 'python -m mininet.examples.limit' )
|
|
||||||
count = 0
|
count = 0
|
||||||
bw = 0
|
bw = 0
|
||||||
tolerance = 1
|
tolerance = 1
|
||||||
@@ -34,5 +35,4 @@ class testLimit( unittest.TestCase ):
|
|||||||
self.assertTrue( count > 0 )
|
self.assertTrue( count > 0 )
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
setLogLevel( 'warning' )
|
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|||||||
Reference in New Issue
Block a user