nova-net: Migrate 'test_servers' functional tests

Three tests require modification to specifically request an API that our
NeutronFixture provides. The rest just work (TM).

Change-Id: I423b7ab5c98ea9d559caefec0b49271e28a140fa
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This commit is contained in:
Stephen Finucane 2019-09-19 16:50:50 +01:00 committed by Stephen Finucane
parent ea8b38950d
commit aabf8cc2d0
7 changed files with 7 additions and 24 deletions

View File

@ -3,7 +3,7 @@
"name" : "device-tagging-server",
"flavorRef" : "http://openstack.example.com/flavors/1",
"networks" : [{
"uuid" : "ff608d40-75e9-48cb-b745-77bb55b5eaf2",
"uuid" : "3cb9bc59-5699-4588-a4b1-b87f96708bc6",
"tag": "nic1"
}],
"block_device_mapping_v2": [{

View File

@ -3,7 +3,7 @@
"name" : "device-tagging-server",
"flavorRef" : "http://openstack.example.com/flavors/1",
"networks" : [{
"uuid" : "ff608d40-75e9-48cb-b745-77bb55b5eaf2",
"uuid" : "3cb9bc59-5699-4588-a4b1-b87f96708bc6",
"tag": "nic1"
}],
"block_device_mapping_v2": [{
@ -15,4 +15,4 @@
"tag": "disk1"
}]
}
}
}

View File

@ -3,7 +3,7 @@
"name" : "bfv-server-with-volume-type",
"flavorRef" : "http://openstack.example.com/flavors/1",
"networks" : [{
"uuid" : "ff608d40-75e9-48cb-b745-77bb55b5eaf2",
"uuid" : "3cb9bc59-5699-4588-a4b1-b87f96708bc6",
"tag": "nic1"
}],
"block_device_mapping_v2": [{

View File

@ -3,7 +3,7 @@
"name" : "device-tagging-server",
"flavorRef" : "%(host)s/flavors/1",
"networks" : [{
"uuid" : "ff608d40-75e9-48cb-b745-77bb55b5eaf2",
"uuid" : "3cb9bc59-5699-4588-a4b1-b87f96708bc6",
"tag": "nic1"
}],
"block_device_mapping_v2": [{

View File

@ -3,7 +3,7 @@
"name" : "device-tagging-server",
"flavorRef" : "%(host)s/flavors/1",
"networks" : [{
"uuid" : "ff608d40-75e9-48cb-b745-77bb55b5eaf2",
"uuid" : "3cb9bc59-5699-4588-a4b1-b87f96708bc6",
"tag": "nic1"
}],
"block_device_mapping_v2": [{

View File

@ -3,7 +3,7 @@
"name" : "bfv-server-with-volume-type",
"flavorRef" : "%(host)s/flavors/1",
"networks" : [{
"uuid" : "ff608d40-75e9-48cb-b745-77bb55b5eaf2",
"uuid" : "3cb9bc59-5699-4588-a4b1-b87f96708bc6",
"tag": "nic1"
}],
"block_device_mapping_v2": [{

View File

@ -105,7 +105,6 @@ class ServersSampleBase(api_sample_base.ApiSampleTestBaseV21):
class ServersSampleJsonTest(ServersSampleBase):
USE_NEUTRON = False
# This controls whether or not we use the common server API sample
# for server post req/resp.
use_common_server_post = True
@ -115,7 +114,6 @@ class ServersSampleJsonTest(ServersSampleBase):
return self._post_server(
use_common_server_api_samples=self.use_common_server_post)
# TODO(stephenfin): Migrate off of nova-network
def test_servers_get(self):
self.stub_out(
'nova.db.api.block_device_mapping_get_all_by_instance_uuids',
@ -143,7 +141,6 @@ class ServersSampleJsonTest(ServersSampleBase):
subs = {'id': uuid}
self._verify_response('servers-list-resp', subs, response, 200)
# TODO(stephenfin): Migrate off of nova-network
def test_servers_details(self):
self.stub_out(
'nova.db.api.block_device_mapping_get_all_by_instance_uuids',
@ -205,7 +202,6 @@ class ServersSampleJson219Test(ServersSampleJsonTest):
class ServersSampleJson232Test(ServersSampleBase):
USE_NEUTRON = False
microversion = '2.32'
sample_dir = 'servers'
scenarios = [('v2_32', {'api_major_version': 'v2.1'})]
@ -224,7 +220,6 @@ class ServersSampleJson237Test(ServersSampleBase):
class ServersSampleJson242Test(ServersSampleBase):
USE_NEUTRON = False
microversion = '2.42'
sample_dir = 'servers'
scenarios = [('v2_42', {'api_major_version': 'v2.1'})]
@ -264,7 +259,6 @@ class ServersSampleJson252Test(ServersSampleJsonTest):
class ServersSampleJson263Test(ServersSampleBase):
USE_NEUTRON = False
microversion = '2.63'
scenarios = [('v2_63', {'api_major_version': 'v2.1'})]
@ -310,7 +304,6 @@ class ServersSampleJson263Test(ServersSampleBase):
self._verify_response('server-action-rebuild-resp',
exp_resp, resp, 202)
# TODO(stephenfin): Migrate off of nova-network
def test_servers_details(self):
uuid = self._post_server(use_common_server_api_samples=False)
response = self._do_get('servers/detail?limit=1')
@ -318,7 +311,6 @@ class ServersSampleJson263Test(ServersSampleBase):
subs['id'] = uuid
self._verify_response('servers-details-resp', subs, response, 200)
# TODO(stephenfin): Migrate off of nova-network
def test_server_get(self):
uuid = self._post_server(use_common_server_api_samples=False)
response = self._do_get('servers/%s' % uuid)
@ -336,7 +328,6 @@ class ServersSampleJson263Test(ServersSampleBase):
class ServersSampleJson266Test(ServersSampleBase):
USE_NEUTRON = False
microversion = '2.66'
scenarios = [('v2_66', {'api_major_version': 'v2.1'})]
@ -365,7 +356,6 @@ class ServersSampleJson266Test(ServersSampleBase):
self._verify_response(
'servers-list-with-changes-before', subs, response, 200)
# TODO(stephenfin): Migrate off of nova-network
def test_get_servers_detail_with_changes_before(self):
uuid = self._post_server(use_common_server_api_samples=False)
current_time = timeutils.parse_isotime(timeutils.utcnow().isoformat())
@ -379,7 +369,6 @@ class ServersSampleJson266Test(ServersSampleBase):
class ServersSampleJson267Test(ServersSampleBase):
USE_NEUTRON = False
microversion = '2.67'
scenarios = [('v2_67', {'api_major_version': 'v2.1'})]
@ -439,7 +428,6 @@ class ServersSampleJson269Test(ServersSampleBase):
class ServersSampleJson271Test(ServersSampleBase):
USE_NEUTRON = False
microversion = '2.71'
scenarios = [('v2_71', {'api_major_version': 'v2.1'})]
@ -469,7 +457,6 @@ class ServersSampleJson271Test(ServersSampleBase):
use_common_server_api_samples=False,
extra_subs={'sg_uuid': self.sg_uuid})
# TODO(stephenfin): Migrate off of nova-network
def test_servers_get_with_server_group(self):
uuid = self._test_servers_post()
response = self._do_get('servers/%s' % uuid)
@ -534,7 +521,6 @@ class ServersSampleJson271Test(ServersSampleBase):
class ServersSampleJson273Test(ServersSampleBase):
USE_NEUTRON = False
microversion = '2.73'
scenarios = [('v2_73', {'api_major_version': 'v2.1'})]
@ -546,14 +532,12 @@ class ServersSampleJson273Test(ServersSampleBase):
{"locked_reason": reason})
return uuid
# TODO(stephenfin): Migrate off of nova-network
def test_servers_details_with_locked_reason(self):
uuid = self._post_server_and_lock()
response = self._do_get('servers/detail')
subs = {'id': uuid}
self._verify_response('servers-details-resp', subs, response, 200)
# TODO(stephenfin): Migrate off of nova-network
def test_server_get_with_locked_reason(self):
uuid = self._post_server_and_lock()
response = self._do_get('servers/%s' % uuid)
@ -640,7 +624,6 @@ class ServersUpdateSampleJson247Test(ServersUpdateSampleJsonTest):
class ServersSampleJson275Test(ServersUpdateSampleJsonTest):
USE_NEUTRON = False
microversion = '2.75'
scenarios = [('v2_75', {'api_major_version': 'v2.1'})]