Skip to content

Commit c251cb8

Browse files
committed
tests: Fix API extension check
The check for extensions was not using a machine readable format for output. This meant an API check could match on a substring, e.g. a check for 'qos' would match on 'qos-specs'. Address this issue by switching our command invocation to use JSON output and migrating the check function from the general base class to the networking base class. Change-Id: Idc6dc54503031ddf3e148f50ed53ad8898f7a7e3 Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
1 parent 7dbe6e6 commit c251cb8

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

  • openstackclient/tests/functional

openstackclient/tests/functional/base.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,13 @@ def is_service_enabled(cls, service, version=None):
119119
return bool(ret)
120120

121121
@classmethod
122-
def is_extension_enabled(cls, alias):
122+
def is_extension_enabled(cls, alias, *, service='network'):
123123
"""Ask client cloud if extension is enabled"""
124-
return alias in cls.openstack('extension list -f value -c Alias')
124+
extensions = cls.openstack(
125+
f'extension list --{service}',
126+
parse_output=True,
127+
)
128+
return alias in [x['Alias'] for x in extensions]
125129

126130
@classmethod
127131
def get_openstack_configuration_value(cls, configuration):

0 commit comments

Comments
 (0)