Merge "Add server schema for microversion 2.8"

This commit is contained in:
Zuul 2018-08-22 05:46:49 +00:00 committed by Gerrit Code Review
commit f7fe7ff723
5 changed files with 56 additions and 14 deletions

View File

@ -306,6 +306,10 @@ Microversion tests implemented in Tempest
.. _2.6: https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#id5
* `2.8`_
.. _2.8: https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#id7
* `2.9`_
.. _2.9: https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#id8

View File

@ -0,0 +1,37 @@
# Copyright 2018 AT&T Corporation. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import copy
from tempest.lib.api_schema.response.compute.v2_6 import servers
# 2.8: Add 'mks' protocol and 'webmks' type for remote consoles.
get_remote_consoles = copy.deepcopy(servers.get_remote_consoles)
get_remote_consoles['response_body']['properties']['remote_console'][
'properties']['protocol']['enum'].append('mks')
get_remote_consoles['response_body']['properties']['remote_console'][
'properties']['type']['enum'].append('webmks')
# NOTE: Below are the unchanged schema in this microversion. We need
# to keep this schema in this file to have the generic way to select the
# right schema based on self.schema_versions_info mapping in service client.
# ****** Schemas unchanged since microversion 2.6 ******
list_servers = copy.deepcopy(servers.list_servers)
get_server = copy.deepcopy(servers.get_server)
list_servers_detail = copy.deepcopy(servers.list_servers_detail)
update_server = copy.deepcopy(servers.update_server)
rebuild_server = copy.deepcopy(servers.rebuild_server)
rebuild_server_with_admin_pass = copy.deepcopy(
servers.rebuild_server_with_admin_pass)
show_server_diagnostics = copy.deepcopy(servers.show_server_diagnostics)

View File

@ -14,16 +14,7 @@
import copy
from tempest.lib.api_schema.response.compute.v2_1 import servers as servers_21
from tempest.lib.api_schema.response.compute.v2_6 import servers
# NOTE: Below are the unchanged schema in this microversion. We need
# to keep this schema in this file to have the generic way to select the
# right schema based on self.schema_versions_info mapping in service client.
# ****** Schemas unchanged since microversion 2.6 ******
list_servers = copy.deepcopy(servers.list_servers)
show_server_diagnostics = copy.deepcopy(servers.show_server_diagnostics)
get_remote_consoles = copy.deepcopy(servers.get_remote_consoles)
from tempest.lib.api_schema.response.compute.v2_8 import servers
get_server = copy.deepcopy(servers.get_server)
get_server['response_body']['properties']['server'][
@ -37,21 +28,29 @@ list_servers_detail['response_body']['properties']['servers']['items'][
list_servers_detail['response_body']['properties']['servers']['items'][
'required'].append('locked')
update_server = copy.deepcopy(servers_21.update_server)
update_server = copy.deepcopy(servers.update_server)
update_server['response_body']['properties']['server'][
'properties'].update({'locked': {'type': 'boolean'}})
update_server['response_body']['properties']['server'][
'required'].append('locked')
rebuild_server = copy.deepcopy(servers_21.rebuild_server)
rebuild_server = copy.deepcopy(servers.rebuild_server)
rebuild_server['response_body']['properties']['server'][
'properties'].update({'locked': {'type': 'boolean'}})
rebuild_server['response_body']['properties']['server'][
'required'].append('locked')
rebuild_server_with_admin_pass = copy.deepcopy(
servers_21.rebuild_server_with_admin_pass)
servers.rebuild_server_with_admin_pass)
rebuild_server_with_admin_pass['response_body']['properties']['server'][
'properties'].update({'locked': {'type': 'boolean'}})
rebuild_server_with_admin_pass['response_body']['properties']['server'][
'required'].append('locked')
# NOTE: Below are the unchanged schema in this microversion. We need
# to keep this schema in this file to have the generic way to select the
# right schema based on self.schema_versions_info mapping in service client.
# ****** Schemas unchanged since microversion 2.8 ******
list_servers = copy.deepcopy(servers.list_servers)
show_server_diagnostics = copy.deepcopy(servers.show_server_diagnostics)
get_remote_consoles = copy.deepcopy(servers.get_remote_consoles)

View File

@ -33,6 +33,7 @@ from tempest.lib.api_schema.response.compute.v2_54 import servers as schemav254
from tempest.lib.api_schema.response.compute.v2_57 import servers as schemav257
from tempest.lib.api_schema.response.compute.v2_6 import servers as schemav26
from tempest.lib.api_schema.response.compute.v2_63 import servers as schemav263
from tempest.lib.api_schema.response.compute.v2_8 import servers as schemav28
from tempest.lib.api_schema.response.compute.v2_9 import servers as schemav29
from tempest.lib.common import rest_client
from tempest.lib.services.compute import base_compute_client
@ -44,7 +45,8 @@ class ServersClient(base_compute_client.BaseComputeClient):
schema_versions_info = [
{'min': None, 'max': '2.2', 'schema': schema},
{'min': '2.3', 'max': '2.5', 'schema': schemav23},
{'min': '2.6', 'max': '2.8', 'schema': schemav26},
{'min': '2.6', 'max': '2.7', 'schema': schemav26},
{'min': '2.8', 'max': '2.8', 'schema': schemav28},
{'min': '2.9', 'max': '2.15', 'schema': schemav29},
{'min': '2.16', 'max': '2.18', 'schema': schemav216},
{'min': '2.19', 'max': '2.25', 'schema': schemav219},