From 2cea2d9e74eefe00b4dc7a3f0fa7040a0e0ede81 Mon Sep 17 00:00:00 2001 From: Matt Riedemann Date: Sat, 19 Nov 2016 20:48:46 -0500 Subject: [PATCH] Make test_compute pass with CONF.use_neutron=True by default More of the same, the nova-network API methods are mocked out directly rather than the ComputeManager.network_api variable. We also use the NeutronFixture globally here rather than the global nova-network method stubs in setUp. The NeutronFixture also needs a few additional stub methods. For the compute API tests, the changes are mostly just around knowing that the security group API tests rely on nova-network. Part of blueprint use-neutron-by-default Change-Id: I9b670a2f1f1f67ad46a5ac4a9696eaf94b1058ce --- nova/tests/fixtures.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nova/tests/fixtures.py b/nova/tests/fixtures.py index be42c6628..1c7ed98bb 100644 --- a/nova/tests/fixtures.py +++ b/nova/tests/fixtures.py @@ -969,6 +969,15 @@ class NeutronFixture(fixtures.Fixture): 'nova.network.neutronv2.api.API.' 'create_pci_requests_for_sriov_ports', lambda *args, **kwargs: None) + self.test.stub_out( + 'nova.network.neutronv2.api.API.setup_networks_on_host', + lambda *args, **kwargs: None) + self.test.stub_out( + 'nova.network.neutronv2.api.API.migrate_instance_start', + lambda *args, **kwargs: None) + self.test.stub_out( + 'nova.network.neutronv2.api.API.migrate_instance_finish', + lambda *args, **kwargs: None) self.test.stub_out( 'nova.network.security_group.neutron_driver.SecurityGroupAPI.' 'get_instances_security_groups_bindings',