'Verify that we see packet drops with a high configured loss rate.'

def testLinkLoss(self):

    LOSS_PERCENT = 99
    REPS = 1
    lopts = {'loss': LOSS_PERCENT, 'use_htb': True}
    mn = Mininet(topo=SingleSwitchOptionsTopo(n=N, lopts=lopts), host=CPULimitedHost, link=TCLink, switch=self.switchClass, waitConnected=True)
    dropped_total = 0
    mn.start()
    for _ in range(REPS):
        dropped_total += mn.ping(timeout='1')
    mn.stop()
    loptsStr = ',    '.join((('%s:    %s' % (opt, value)) for (opt, value) in lopts.items()))
    msg = ('\nTesting    packet    loss    with    %d%%    loss    rate\nnumber    of    dropped    pings    during    mininet.ping():    %s\nexpected    number    of    dropped    packets:    1\nTopo    =    SingleSwitchTopo,    %s    hosts\nLink    =    TCLink\nlopts    =    %s\nhost    =    default\nswitch    =    %s\n' % (LOSS_PERCENT, dropped_total, N, loptsStr, self.switchClass))
    self.assertGreater(dropped_total, 0, msg)
