def test_add_patch_port(self):
    pname = 'tap99'
    peer = 'bar10'
    ofport = '6'
    utils.execute(['ovs-vsctl', self.TO, 'add-port', self.BR_NAME, pname], root_helper=self.root_helper)
    utils.execute(['ovs-vsctl', self.TO, 'set', 'Interface', pname, 'type=patch'], root_helper=self.root_helper)
    utils.execute(['ovs-vsctl', self.TO, 'set', 'Interface', pname, ('options:peer=' + peer)], root_helper=self.root_helper)
    utils.execute(['ovs-vsctl', self.TO, 'get', 'Interface', pname, 'ofport'], root_helper=self.root_helper).AndReturn(ofport)
    self.mox.ReplayAll()
    self.assertEqual(self.br.add_patch_port(pname, peer), ofport)
    self.mox.VerifyAll()
def test_add_patch_port(self):
    pname = 'tap99'
    peer = 'bar10'
    ofport = '6'
    utils.execute(['ovs-vsctl', self.TO, 'add-port', self.BR_NAME, pname], root_helper=self.root_helper)
    utils.execute(['ovs-vsctl', self.TO, 'set', 'Interface', pname, 'type=patch'], root_helper=self.root_helper)
    utils.execute(['ovs-vsctl', self.TO, 'set', 'Interface', pname, ('options:peer=' + peer)], root_helper=self.root_helper)
    utils.execute(['ovs-vsctl', self.TO, 'get', 'Interface', pname, 'ofport'], root_helper=self.root_helper).AndReturn(ofport)
    self.mox.ReplayAll()
    self.assertEqual(self.br.add_patch_port(pname, peer), ofport)
    self.mox.VerifyAll()