Revision 3131c903

View differences:

mininet/test/test_hifi.py
55 55
        """
56 56
        self.assertGreaterEqual( float(measured),
57 57
                                 float(expected) * tolerance_frac )
58
        self.assertLess( float( measured ),
59
                                    float(expected) + (1-tolerance_frac) * float( expected ) )
58
        self.assertLessEqual( float( measured ),
59
                                 float(expected) + (1-tolerance_frac)
60
                                 * float( expected ) )
60 61

  
61 62
    def testCPULimits( self ):
62 63
        "Verify topology creation with CPU limits set for both schedulers."
......
70 71
        mn.start()
71 72
        results = mn.runCpuLimitTest( cpu=CPU_FRACTION )
72 73
        mn.stop()
73
        for cpu in results:
74
        for pct in results:
74 75
            #divide cpu by 100 to convert from percentage to fraction
75
            self.assertWithinTolerance( cpu/100, CPU_FRACTION, CPU_TOLERANCE )
76
            self.assertWithinTolerance( pct/100, CPU_FRACTION, CPU_TOLERANCE )
76 77

  
77 78
    def testLinkBandwidth( self ):
78 79
        "Verify that link bandwidths are accurate within a bound."

Also available in: Unified diff