From 3131c90344766c30d2516ebab5792785296a7104 Mon Sep 17 00:00:00 2001 From: Cody Burkard Date: Tue, 8 Jul 2014 16:53:45 -0700 Subject: [PATCH] rolled back to iperf format option, and changed 'cpu' variable to 'pct' --- mininet/test/test_hifi.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mininet/test/test_hifi.py b/mininet/test/test_hifi.py index 3f89b87..8f8a1ce 100755 --- a/mininet/test/test_hifi.py +++ b/mininet/test/test_hifi.py @@ -55,8 +55,9 @@ class testOptionsTopoCommon( object ): """ self.assertGreaterEqual( float(measured), float(expected) * tolerance_frac ) - self.assertLess( float( measured ), - float(expected) + (1-tolerance_frac) * float( expected ) ) + self.assertLessEqual( float( measured ), + float(expected) + (1-tolerance_frac) + * float( expected ) ) def testCPULimits( self ): "Verify topology creation with CPU limits set for both schedulers." @@ -70,9 +71,9 @@ class testOptionsTopoCommon( object ): mn.start() results = mn.runCpuLimitTest( cpu=CPU_FRACTION ) mn.stop() - for cpu in results: + for pct in results: #divide cpu by 100 to convert from percentage to fraction - self.assertWithinTolerance( cpu/100, CPU_FRACTION, CPU_TOLERANCE ) + self.assertWithinTolerance( pct/100, CPU_FRACTION, CPU_TOLERANCE ) def testLinkBandwidth( self ): "Verify that link bandwidths are accurate within a bound."