'Test pingall on single,3 and linear,4 topos'

def testTopoChange(self):

    p = pexpect.spawn('mn    --test    pingall    --topo    single,3')
    p.expect('(\\d+)/(\\d+)    received')
    received = int(p.match.group(1))
    sent = int(p.match.group(2))
    self.assertEqual(sent, 6, 'Wrong    number    of    pings    sent    in    single,3')
    self.assertEqual(sent, received, 'Dropped    packets    in    single,3')
    p.expect(pexpect.EOF)
    p = pexpect.spawn('mn    --test    pingall    --topo    linear,4')
    p.expect('(\\d+)/(\\d+)    received')
    received = int(p.match.group(1))
    sent = int(p.match.group(2))
    self.assertEqual(sent, 12, 'Wrong    number    of    pings    sent    in    linear,4')
    self.assertEqual(sent, received, 'Dropped    packets    in    linear,4')
    p.expect(pexpect.EOF)
