Exemple #1
0
    def test_delete_distributed_port_binding_if_stale(self):
        network_id = uuidutils.generate_uuid()
        port_id = uuidutils.generate_uuid()
        self._setup_neutron_network(network_id, [port_id])
        binding = self._setup_distributed_binding(
            network_id, port_id, None, 'foo_host_id')

        ml2_db.delete_distributed_port_binding_if_stale(self.ctx,
                                                        binding)
        count = (self.ctx.session.query(models.DistributedPortBinding).
            filter_by(port_id=binding.port_id).count())
        self.assertFalse(count)
Exemple #2
0
    def test_delete_distributed_port_binding_if_stale(self):
        network_id = uuidutils.generate_uuid()
        port_id = uuidutils.generate_uuid()
        self._setup_neutron_network(network_id, [port_id])
        binding = self._setup_distributed_binding(network_id, port_id, None,
                                                  'foo_host_id')

        ml2_db.delete_distributed_port_binding_if_stale(self.ctx, binding)
        count = (self.ctx.session.query(
            models.DistributedPortBinding).filter_by(
                port_id=binding.port_id).count())
        self.assertFalse(count)
Exemple #3
0
    def test_delete_distributed_port_binding_if_stale(self):
        network_id = uuidutils.generate_uuid()
        port_id = uuidutils.generate_uuid()
        self._setup_neutron_network(network_id, [port_id])
        binding = self._setup_distributed_binding(
            network_id, port_id, None, 'foo_host_id')

        ml2_db.delete_distributed_port_binding_if_stale(self.ctx, binding)

        obj_exists = port_obj.DistributedPortBinding.objects_exist(
            self.ctx, port_id=binding.port_id)
        self.assertFalse(obj_exists)