'Test link CLI command using ping'

def testLink(self):

    p = pexpect.spawn('mn')
    p.expect(self.prompt)
    p.sendline('link    s1    h1    down')
    p.expect(self.prompt)
    p.sendline('h1    ping    -c    1    h2')
    p.expect('unreachable')
    p.expect(self.prompt)
    p.sendline('link    s1    h1    up')
    p.expect(self.prompt)
    p.sendline('h1    ping    -c    1    h2')
    p.expect('0%    packet    loss')
    p.expect(self.prompt)
    p.sendline('exit')
    p.wait()
