'Test connectivity between hosts on a specific VLAN'

def testSpecificVLAN(self):

    vlan = 1001
    p = pexpect.spawn(('python    -m    mininet.examples.vlanhost    %d' % vlan))
    p.expect(self.prompt)
    p.sendline('h1    ping    -c    1    h2')
    p.expect('(\\d+)%    packet    loss')
    percent = (int(p.match.group(1)) if p.match else (-1))
    p.expect(self.prompt)
    p.sendline('h1    ifconfig')
    i = p.expect([('h1-eth0.%d' % vlan), pexpect.TIMEOUT], timeout=2)
    p.expect(self.prompt)
    p.sendline('exit')
    p.wait()
    self.assertEqual(percent, 0)
    self.assertEqual(i, 0)
