8 sched cpu received bits/sec
18 from mininet.util import pexpect
21 class testCPU( unittest.TestCase ):
25 @unittest.skipIf( '-quick' in sys.argv, 'long test' )
27 "Verify that CPU utilization is monotonically decreasing for each scheduler"
28 p = pexpect.spawn( 'python -m mininet.examples.cpu', timeout=300 )
29 # matches each line from results( shown above )
30 opts = [ '([a-z]+)\t([\d\.]+)%\t([\d\.e\+]+)',
34 index = p.expect( opts )
36 sched = p.match.group( 1 )
37 cpu = float( p.match.group( 2 ) )
38 bw = float( p.match.group( 3 ) )
39 if sched not in scheds:
40 scheds.append( sched )
42 self.assertTrue( bw < previous_bw,
43 "%e should be less than %e\n" %
49 self.assertTrue( len( scheds ) > 0 )
51 if __name__ == '__main__':