Merge server list multi status tests between v2 and v2.1
Currently v2 and v2.1 have separate functional tests and their corresponding sample files. As v2 and v2.1 are supposed to be identical, there is overhead to maintain two set of functional tests and sample files. We can have one set of tests which can run for both v2 and v2.1. This commit merges server list multi status functional tests. There was no test for this in v2.1 so merging these test in test_servers. In V2.1 os-access-ip is separate plugin where in v2 it was mixed in server plugin itself. So os-access-ip extension is enabled to run merged functional tests for both v2 and v2.1. Partially implements blueprint test-collapse-v2-and-v21 Change-Id: Ie3bc0f2dab96e642ac9b29a377bab7684a263819
This commit is contained in:
committed by
Ghanshyam Mann
parent
38f9906d4b
commit
2699c83df1
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"servers": [
|
||||
{
|
||||
"id": "616fb98f-46ca-475e-917e-2563e5a8cd19",
|
||||
"links": [
|
||||
{
|
||||
"href": "http://openstack.example.com/v2/openstack/servers/616fb98f-46ca-475e-917e-2563e5a8cd19",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "http://openstack.example.com/openstack/servers/616fb98f-46ca-475e-917e-2563e5a8cd19",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
],
|
||||
"name": "new-server-test"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"servers": [
|
||||
{
|
||||
"id": "%(id)s",
|
||||
"links": [
|
||||
{
|
||||
"href": "%(host)s/v2/openstack/servers/%(id)s",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "%(host)s/openstack/servers/%(id)s",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
],
|
||||
"name": "new-server-test"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -167,19 +167,6 @@ class ServersSampleBase(ApiSampleTestBaseV2):
|
||||
self.__class__._use_common_server_api_samples = orig_value
|
||||
|
||||
|
||||
class ServersSampleMultiStatusJsonTest(ServersSampleBase):
|
||||
extension_name = '.'.join(('nova.api.openstack.compute.legacy_v2.contrib',
|
||||
'server_list_multi_status',
|
||||
'Server_list_multi_status'))
|
||||
|
||||
def test_servers_list(self):
|
||||
uuid = self._post_server()
|
||||
response = self._do_get('servers?status=active&status=error')
|
||||
subs = self._get_regexes()
|
||||
subs['id'] = uuid
|
||||
self._verify_response('servers-list-resp', subs, response, 200)
|
||||
|
||||
|
||||
class FlavorsSampleJsonTest(ApiSampleTestBaseV2):
|
||||
sample_dir = 'flavors'
|
||||
|
||||
|
||||
@@ -258,3 +258,24 @@ class ServerStartStopJsonTest(ServersSampleBase):
|
||||
def test_server_stop(self):
|
||||
uuid = self._post_server()
|
||||
self._test_server_action(uuid, 'os-stop', 'server-action-stop')
|
||||
|
||||
|
||||
class ServersSampleMultiStatusJsonTest(ServersSampleBase):
|
||||
sample_dir = 'servers'
|
||||
extra_extensions_to_load = ["os-access-ips"]
|
||||
_api_version = 'v2'
|
||||
|
||||
def _get_flags(self):
|
||||
f = super(ServersSampleMultiStatusJsonTest, self)._get_flags()
|
||||
f['osapi_compute_extension'] = CONF.osapi_compute_extension[:]
|
||||
f['osapi_compute_extension'].append(
|
||||
'nova.api.openstack.compute.legacy_v2.contrib.'
|
||||
'server_list_multi_status.Server_list_multi_status')
|
||||
return f
|
||||
|
||||
def test_servers_list(self):
|
||||
uuid = self._post_server()
|
||||
response = self._do_get('servers?status=active&status=error')
|
||||
subs = self._get_regexes()
|
||||
subs['id'] = uuid
|
||||
self._verify_response('servers-list-resp', subs, response, 200)
|
||||
|
||||
Reference in New Issue
Block a user