Esempio n. 1
0
    def test_delete_dvr_port_binding_if_stale(self):
        network_id = "foo_network_id"
        port_id = "foo_port_id"
        self._setup_neutron_network(network_id, [port_id])
        binding = self._setup_dvr_binding(network_id, port_id, None, "foo_host_id")

        ml2_db.delete_dvr_port_binding_if_stale(self.ctx.session, binding)
        count = self.ctx.session.query(models.DVRPortBinding).filter_by(port_id=binding.port_id).count()
        self.assertFalse(count)
Esempio n. 2
0
    def test_delete_dvr_port_binding_if_stale(self):
        network_id = 'foo_network_id'
        port_id = 'foo_port_id'
        self._setup_neutron_network(network_id, [port_id])
        binding = self._setup_dvr_binding(
            network_id, port_id, None, 'foo_host_id')

        ml2_db.delete_dvr_port_binding_if_stale(self.ctx.session, binding)
        count = (self.ctx.session.query(models.DVRPortBinding).
            filter_by(port_id=binding.port_id).count())
        self.assertFalse(count)