def test_get_or_create_ofport_changed(self):
    port_dict = {'device': 'port-id', 'security_groups': [123, 456]}
    of_port = create_ofport(port_dict)
    self.firewall.sg_port_map.ports[of_port.id] = of_port
    fake_ovs_port = FakeOVSPort('port', 2, '00:00:00:00:00:00')
    self.mock_bridge.br.get_vif_port_by_id.return_value = fake_ovs_port
    port = self.firewall.get_or_create_ofport(port_dict)
    self.assertEqual(port.ofport, 2)
def test_get_or_create_ofport_changed(self):
    port_dict = {'device': 'port-id', 'security_groups': [123, 456]}
    of_port = create_ofport(port_dict)
    self.firewall.sg_port_map.ports[of_port.id] = of_port
    fake_ovs_port = FakeOVSPort('port', 2, '00:00:00:00:00:00')
    self.mock_bridge.br.get_vif_port_by_id.return_value = fake_ovs_port
    port = self.firewall.get_or_create_ofport(port_dict)
    self.assertEqual(port.ofport, 2)