'Kill controllers and verify that switch, s1, fails over properly'

def testFailover(self):

    count = 1
    p = pexpect.spawn('python    -m    mininet.examples.controlnet')
    p.expect(self.prompt)
    lp = pexpect.spawn('tail    -f    /tmp/s1-ofp.log')
    lp.expect('tcp:\\d+\\.\\d+\\.\\d+\\.(\\d+):\\d+:    connected')
    ip = int(lp.match.group(1))
    self.assertEqual(count, ip)
    count += 1
    for c in ['c0', 'c1']:
        p.sendline(('%s    ifconfig    %s-eth0    down' % (c, c)))
        p.expect(self.prompt)
        lp.expect('tcp:\\d+\\.\\d+\\.\\d+\\.(\\d+):\\d+:    connected')
        ip = int(lp.match.group(1))
        self.assertEqual(count, ip)
        count += 1
    p.sendline('exit')
    p.wait()
