'Verify that bandwidth is monotonically decreasing as # of hops increases'

@unittest.skipIf(('-quick' in sys.argv), 'long    test')
def testLinearBandwidth(self):

    p = pexpect.spawn('python    -m    mininet.examples.linearbandwidth')
    count = 0
    opts = ['\\*\\*\\*    Linear    network    results', '(\\d+)\\s+([\\d\\.]+)    (.bits)', pexpect.EOF]
    while True:
        index = p.expect(opts, timeout=600)
        if (index == 0):
            count += 1
        elif (index == 1):
            n = int(p.match.group(1))
            bw = float(p.match.group(2))
            unit = p.match.group(3)
            if (unit[0] == 'K'):
                bw *= (10 ** 3)
            elif (unit[0] == 'M'):
                bw *= (10 ** 6)
            elif (unit[0] == 'G'):
                bw *= (10 ** 9)
            if (n != 1):
                info = ('bw:    %.2e    bits/s    across    %d    switches,    previous:    %.2e    bits/s    across    %d    switches' % (bw, n, previous_bw, previous_n))
                self.assertTrue((bw < previous_bw), info)
            (previous_bw, previous_n) = (bw, n)
        else:
            break
    self.assertTrue((count > 0))
