From cf96636cfa03425c8b8fd48254b895812715ea6b Mon Sep 17 00:00:00 2001 From: zhufl Date: Thu, 4 Jun 2020 17:14:18 +0800 Subject: [PATCH] Fix test_list_flavors for compute microversion 2.55 Description field is added to the response of list_flavors in compute microversion 2.55, so we should add description to flavor_min_detail when microversion is greater than 2.54. Change-Id: I0f18994344f6a16f7e0942928093beda31dc9e0a --- tempest/api/compute/flavors/test_flavors.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tempest/api/compute/flavors/test_flavors.py b/tempest/api/compute/flavors/test_flavors.py index 20294e9a44..e5047fe980 100644 --- a/tempest/api/compute/flavors/test_flavors.py +++ b/tempest/api/compute/flavors/test_flavors.py @@ -27,6 +27,9 @@ class FlavorsV2TestJSON(base.BaseV2ComputeTest): flavor = self.flavors_client.show_flavor(self.flavor_ref)['flavor'] flavor_min_detail = {'id': flavor['id'], 'links': flavor['links'], 'name': flavor['name']} + # description field is added to the response of list_flavors in 2.55 + if not self.is_requested_microversion_compatible('2.54'): + flavor_min_detail.update({'description': flavor['description']}) self.assertIn(flavor_min_detail, flavors) @decorators.idempotent_id('6e85fde4-b3cd-4137-ab72-ed5f418e8c24')