diff --git a/nova/tests/functional/api_sample_tests/api_sample_base.py b/nova/tests/functional/api_sample_tests/api_sample_base.py index c419472c0b30..30d8643f60d8 100644 --- a/nova/tests/functional/api_sample_tests/api_sample_base.py +++ b/nova/tests/functional/api_sample_tests/api_sample_base.py @@ -122,6 +122,8 @@ class ApiSampleTestBaseV21(testscenarios.WithScenarios, super(ApiSampleTestBaseV21, self)._setup_services() + # TODO(stephenfin): Remove once we remove the few remaining + # nova-network-only APIs if not self.USE_NEUTRON: # self.network is only setup if USE_NEUTRON=False self.useFixture(test.SampleNetworks(host=self.network.host)) diff --git a/nova/tests/functional/api_sample_tests/test_networks.py b/nova/tests/functional/api_sample_tests/test_networks.py index 9c6b41f05f43..1a47009686e1 100644 --- a/nova/tests/functional/api_sample_tests/test_networks.py +++ b/nova/tests/functional/api_sample_tests/test_networks.py @@ -39,8 +39,9 @@ def _fixtures_passthrough(method_name): return call +# TODO(stephenfin): Remove the parts of this test that are nova-network only class NetworksJsonTests(api_sample_base.ApiSampleTestBaseV21): - USE_NEUTRON = False + USE_NEUTRON = False # partially nova-net only ADMIN_API = True sample_dir = "os-networks" @@ -59,21 +60,25 @@ class NetworksJsonTests(api_sample_base.ApiSampleTestBaseV21): self.stub_out("nova.network.api.API.add_network_to_project", _fixtures_passthrough('add_network_to_project')) + # TODO(stephenfin): Rework this to work with neutron def test_network_list(self): response = self._do_get('os-networks') self._verify_response('networks-list-resp', {}, response, 200) + # TODO(stephenfin): Rework this to work with neutron def test_network_show(self): uuid = test_networks.FAKE_NETWORKS[0]['uuid'] response = self._do_get('os-networks/%s' % uuid) self._verify_response('network-show-resp', {}, response, 200) + # TODO(stephenfin): Rework this to work with neutron @mock.patch('nova.network.api.API.get', side_effect=exception.Unauthorized) def test_network_show_token_expired(self, mock_get): uuid = test_networks.FAKE_NETWORKS[0]['uuid'] response = self._do_get('os-networks/%s' % uuid) self.assertEqual(401, response.status_code) + # TODO(stephenfin): Remove this API since it's nova-network only @mock.patch('nova.network.api.API.create', side_effect=exception.Forbidden) def test_network_create_forbidden(self, mock_create): @@ -81,17 +86,20 @@ class NetworksJsonTests(api_sample_base.ApiSampleTestBaseV21): 'network-create-req', {}) self.assertEqual(403, response.status_code) + # TODO(stephenfin): Remove this API since it's nova-network only def test_network_create(self): response = self._do_post("os-networks", 'network-create-req', {}) self._verify_response('network-create-resp', {}, response, 200) + # TODO(stephenfin): Remove this API since it's nova-network only def test_network_add(self): response = self._do_post("os-networks/add", 'network-add-req', {}) self.assertEqual(202, response.status_code) self.assertEqual("", response.text) + # TODO(stephenfin): Remove this API since it's nova-network only def test_network_delete(self): response = self._do_delete('os-networks/always_delete') self.assertEqual(202, response.status_code) diff --git a/nova/tests/functional/api_sample_tests/test_networks_associate.py b/nova/tests/functional/api_sample_tests/test_networks_associate.py index 49458f037baa..ddc7263f2742 100644 --- a/nova/tests/functional/api_sample_tests/test_networks_associate.py +++ b/nova/tests/functional/api_sample_tests/test_networks_associate.py @@ -16,8 +16,9 @@ from nova.tests.functional.api_sample_tests import api_sample_base +# TODO(stephenfin): Remove this API since it's nova-network only class NetworksAssociateJsonTests(api_sample_base.ApiSampleTestBaseV21): - USE_NEUTRON = False + USE_NEUTRON = False # nova-net only ADMIN_API = True sample_dir = "os-networks-associate" diff --git a/nova/tests/functional/api_sample_tests/test_security_group_default_rules.py b/nova/tests/functional/api_sample_tests/test_security_group_default_rules.py index c31c81020983..4344da75596a 100644 --- a/nova/tests/functional/api_sample_tests/test_security_group_default_rules.py +++ b/nova/tests/functional/api_sample_tests/test_security_group_default_rules.py @@ -15,9 +15,10 @@ from nova.tests.functional.api_sample_tests import api_sample_base +# TODO(stephenfin): Remove this API since it's nova-network only class SecurityGroupDefaultRulesSampleJsonTest( api_sample_base.ApiSampleTestBaseV21): - USE_NEUTRON = False + USE_NEUTRON = False # nova-net only ADMIN_API = True sample_dir = 'os-security-group-default-rules' diff --git a/nova/tests/functional/api_sample_tests/test_tenant_networks.py b/nova/tests/functional/api_sample_tests/test_tenant_networks.py index e6a3d6514667..5549f1dac6e5 100644 --- a/nova/tests/functional/api_sample_tests/test_tenant_networks.py +++ b/nova/tests/functional/api_sample_tests/test_tenant_networks.py @@ -23,8 +23,9 @@ from nova.tests.functional.api_sample_tests import api_sample_base CONF = nova.conf.CONF +# TODO(stephenfin): Remove the parts of this test that are nova-network only class TenantNetworksJsonTests(api_sample_base.ApiSampleTestBaseV21): - USE_NEUTRON = False + USE_NEUTRON = False # partially nova-net only ADMIN_API = True sample_dir = "os-tenant-networks" @@ -43,14 +44,17 @@ class TenantNetworksJsonTests(api_sample_base.ApiSampleTestBaseV21): self.stub_out("nova.quota.QuotaEngine.commit", fake) self.stub_out("nova.quota.QuotaEngine.rollback", fake) + # TODO(stephenfin): Rework this to work with neutron def test_list_networks(self): response = self._do_get('os-tenant-networks') self._verify_response('networks-list-res', {}, response, 200) + # TODO(stephenfin): Remove this API since it's nova-network only def test_create_network(self): response = self._do_post('os-tenant-networks', "networks-post-req", {}) self._verify_response('networks-post-res', {}, response, 200) + # TODO(stephenfin): Remove this API since it's nova-network only def test_delete_network(self): response = self._do_post('os-tenant-networks', "networks-post-req", {}) net = jsonutils.loads(response.content) diff --git a/nova/tests/functional/integrated_helpers.py b/nova/tests/functional/integrated_helpers.py index c3ab1c3321e1..765ac62771f2 100644 --- a/nova/tests/functional/integrated_helpers.py +++ b/nova/tests/functional/integrated_helpers.py @@ -223,6 +223,8 @@ class _IntegratedTestBase(test.TestCase): # Override this in subclasses which use the legacy nova-network service. # New tests should rely on Neutron and old ones migrated to use this since # nova-network is deprecated. + # TODO(stephenfin): Remove once we remove the few remaining + # nova-network-only APIs USE_NEUTRON = True # This indicates whether to include the project ID in the URL for API # requests through OSAPIFixture. Overridden by subclasses. @@ -231,7 +233,6 @@ class _IntegratedTestBase(test.TestCase): def setUp(self): super(_IntegratedTestBase, self).setUp() - # TODO(mriedem): Fix the functional tests to work with Neutron. self.flags(use_neutron=self.USE_NEUTRON) # NOTE(mikal): this is used to stub away privsep helpers diff --git a/nova/tests/functional/wsgi/test_interfaces.py b/nova/tests/functional/wsgi/test_interfaces.py index bb8fc4a9f97e..18e56935d766 100644 --- a/nova/tests/functional/wsgi/test_interfaces.py +++ b/nova/tests/functional/wsgi/test_interfaces.py @@ -37,6 +37,7 @@ def create_request_body(): } +# TODO(stephenfin): Remove this test since it's nova-network only class InterfaceFullstack(integrated_helpers._IntegratedTestBase): """Tests for port interfaces command. @@ -56,7 +57,7 @@ class InterfaceFullstack(integrated_helpers._IntegratedTestBase): """ api_major_version = 'v2.1' - USE_NEUTRON = False + USE_NEUTRON = False # nova-net only _image_ref_parameter = 'imageRef' _flavor_ref_parameter = 'flavorRef'