Updated common create server sample request because of microversion 2.57

Change Ia89eeb6725459c35369e8f790f68ad9180bd3aba added new
microversion 2.57. This microversion removed field 'personality'
from create server request. By default Nova functional api tests use
samples from '/servers' directory to create a server. But now such
requests got 400 Bad Request because of additional 'personality' field.

We must handle this case if we are testing microversions >= 2.57.

This patch will add sample for microversion 2.57+

Change-Id: I8c4e8ffc00ab53f07e7364767f4480abebd2e357
This commit is contained in:
Kevin_Zheng 2017-12-14 14:50:56 +08:00
parent e599b13e49
commit d110ec5961
3 changed files with 44 additions and 1 deletions

View File

@ -0,0 +1,21 @@
{
"server" : {
"accessIPv4": "1.2.3.4",
"accessIPv6": "80fe::",
"name" : "new-server-test",
"imageRef" : "70a599e0-31e7-49b7-b260-868f441e862b",
"flavorRef" : "http://openstack.example.com/flavors/1",
"availability_zone": "nova",
"OS-DCF:diskConfig": "AUTO",
"metadata" : {
"My Server Name" : "Apache1"
},
"security_groups": [
{
"name": "default"
}
],
"user_data": "IyEvYmluL2Jhc2gKL2Jpbi9zdQplY2hvICJJIGFtIGluIHlvdSEiCg==",
"networks": "auto"
}
}

View File

@ -0,0 +1,21 @@
{
"server" : {
"accessIPv4": "%(access_ip_v4)s",
"accessIPv6": "%(access_ip_v6)s",
"name" : "%(name)s",
"imageRef" : "%(image_id)s",
"flavorRef" : "http://openstack.example.com/flavors/1",
"availability_zone": "nova",
"OS-DCF:diskConfig": "AUTO",
"metadata" : {
"My Server Name" : "Apache1"
},
"security_groups": [
{
"name": "default"
}
],
"user_data" : "%(user_data)s",
"networks": "auto"
}
}

View File

@ -33,7 +33,8 @@ class ServersSampleBase(api_sample_base.ApiSampleTestBaseV21):
common_req_names = [
(None, '2.36', 'server-create-req'),
('2.37', None, 'server-create-req-v237')
('2.37', '2.56', 'server-create-req-v237'),
('2.57', None, 'server-create-req-v257')
]
def _get_request_name(self, use_common):