Adding 'security_groups' attributes in server schema
If Nova 'os-security-groups' extension is enabled then, server post,
get & detail response will contain 'security_groups' attributes.
So that attributes should be defined in server's schema and it should
not be required as this is present only when sg extension is enabled.
This patch adds the 'security_groups' attributes in necessary schema.
Change-Id: Ibb58a2173171d237156d383ced9c3b58993058bb
diff --git a/tempest/api_schema/response/compute/v2/servers.py b/tempest/api_schema/response/compute/v2/servers.py
index 09abaed..0132350 100644
--- a/tempest/api_schema/response/compute/v2/servers.py
+++ b/tempest/api_schema/response/compute/v2/servers.py
@@ -30,10 +30,10 @@
'links': parameter_types.links,
'OS-DCF:diskConfig': {'type': 'string'}
},
- # NOTE: OS-DCF:diskConfig is API extension, and some
- # environments return a response without the attribute.
- # So it is not 'required'.
- 'required': ['id', 'security_groups', 'links']
+ # NOTE: OS-DCF:diskConfig & security_groups are API extension,
+ # and some environments return a response without these
+ # attributes.So they are not 'required'.
+ 'required': ['id', 'links']
}
},
'required': ['server']
@@ -64,6 +64,7 @@
get_server['response_body']['properties']['server']['properties'].update({
'key_name': {'type': ['string', 'null']},
'hostId': {'type': 'string'},
+ 'security_groups': {'type': 'array'},
# NOTE: Non-admin users also can see "OS-SRV-USG" and "OS-EXT-AZ"
# attributes.
@@ -288,10 +289,11 @@
'properties'].update({
'hostId': {'type': 'string'},
'OS-DCF:diskConfig': {'type': 'string'},
+ 'security_groups': {'type': 'array'},
'accessIPv4': parameter_types.access_ip_v4,
'accessIPv6': parameter_types.access_ip_v6
})
-# NOTE(GMann): OS-DCF:diskConfig and accessIPv4/v6 are API
+# NOTE(GMann): OS-DCF:diskConfig, security_groups and accessIPv4/v6 are API
# extensions, and some environments return a response
# without these attributes. So they are not 'required'.
list_servers_detail['response_body']['properties']['servers']['items'][