Files
tempest/tempest/api/compute/admin/test_flavors_microversions.py
ghanshyam 52c5d28190 Add 2.55 schema & update flavor API in flavors_client
Compute microversion 2.55 adds 'description' in
flavor APIs response and new API to update the same.

This commit fill the schema gap for that and also
add new updte flavor API in flavors_client lib.

Change-Id: I91c049c3aa9dab5a272369edd18f2c5890d1e5b0
2018-04-24 06:53:10 +00:00

44 lines
1.9 KiB
Python

# Copyright 2018 NEC 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.
from tempest.api.compute import base
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
class FlavorsV255TestJSON(base.BaseV2ComputeAdminTest):
min_microversion = '2.55'
max_microversion = 'latest'
# NOTE(gmann): This class tests the flavors APIs
# response schema for the 2.55 microversion.
@decorators.idempotent_id('61976b25-488d-41dc-9dcb-cb9693a7b075')
def test_crud_flavor(self):
flavor_id = data_utils.rand_int_id(start=1000)
# Checking create API response schema
new_flavor_id = self.create_flavor(ram=512,
vcpus=1,
disk=10,
id=flavor_id)['id']
# Checking show API response schema
self.flavors_client.show_flavor(new_flavor_id)['flavor']
# Checking update API response schema
self.admin_flavors_client.update_flavor(new_flavor_id,
description='new')['flavor']
# Checking list details API response schema
self.flavors_client.list_flavors(detail=True)['flavors']
# Checking list API response schema
self.flavors_client.list_flavors()['flavors']