continue to test cfs if rt is not enabled in kernel

This commit is contained in:
cody burkard
2014-09-27 03:20:07 -07:00
parent fa7edec7c8
commit 54bd9e6112
2 changed files with 21 additions and 7 deletions
+15 -5
View File
@@ -2,6 +2,17 @@
"""
Test for cpu.py
results format:
sched cpu client MB/s
cfs 45.00% 13254.669841
cfs 40.00% 11822.441399
cfs 30.00% 5112.963009
cfs 20.00% 3449.090009
cfs 10.00% 2271.741564
"""
import unittest
@@ -16,8 +27,9 @@ class testCPU( unittest.TestCase ):
def testCPU( self ):
"Verify that CPU utilization is monotonically decreasing for each scheduler"
p = pexpect.spawn( 'python -m mininet.examples.cpu' )
# matches each line from results( shown above )
opts = [ '([a-z]+)\t([\d\.]+)%\t([\d\.]+)',
'please enable RT_GROUP_SCHED', pexpect.EOF ]
pexpect.EOF ]
scheds = []
while True:
index = p.expect( opts, timeout=600 )
@@ -27,11 +39,9 @@ class testCPU( unittest.TestCase ):
bw = float( p.match.group( 3 ) )
if sched not in scheds:
scheds.append( sched )
previous_bw = 10 ** 4 # 10 GB/s
self.assertTrue( bw < previous_bw )
else:
self.assertTrue( bw < previous_bw )
previous_bw = bw
elif index == 1:
self.skipTest( 'please enable RT_GROUP_SCHED' )
else:
break