'This tests that if multiple routers add one port as their
interfaces. Only the first router\'s interface would be added
to this port. All the later requests would return exceptions.'

def test_router_add_interface_dup_port(self):

    with self.router() as r1:
        with self.router() as r2:
            with self.network() as n:
                with self.subnet(network=n) as s:
                    with self.port(subnet=s) as p:
                        self._router_interface_action('add', r1['router']['id'], None, p['port']['id'])
                        plugin = 'neutron.db.l3_db.L3_NAT_dbonly_mixin'
                        check_p = mock.patch((plugin + '._check_router_port'), port_id=p['port']['id'], device_id=r2['router']['id'], return_value=p['port'])
                        checkport = check_p.start()
                        checkport.side_effect = check_p.stop()
                        self._router_interface_action('add', r2['router']['id'], None, p['port']['id'], exc.HTTPConflict.code)
                        self._router_interface_action('remove', r1['router']['id'], None, p['port']['id'])
