From 871450abcd89f9bb5ee9f75cdef3b812695eae93 Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Wed, 26 Apr 2017 17:02:12 -0500 Subject: Fix quota functional tests for nova-net We need to skip some functional tests when testing against a nova-net cloud so add the bits to detect that. Also JSON-ify the quota functional tests and add the skips for nova-net. Change-Id: Ibfeeb3f967f34c98e80271a8214cf95dc50407f1 --- openstackclient/tests/functional/base.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'openstackclient/tests/functional/base.py') diff --git a/openstackclient/tests/functional/base.py b/openstackclient/tests/functional/base.py index 85743296..2d070645 100644 --- a/openstackclient/tests/functional/base.py +++ b/openstackclient/tests/functional/base.py @@ -42,6 +42,18 @@ def execute(cmd, fail_ok=False, merge_stderr=False): return result +def is_service_enabled(service): + """Ask client cloud if service is available""" + try: + ret = execute('openstack service show -f value -c enabled ' + service) + except exceptions.CommandFailed: + # We get here for multiple reasons, all of them mean that a working + # service is not avilable + return False + + return "True" in ret + + class TestCase(testtools.TestCase): delimiter_line = re.compile('^\+\-[\+\-]+\-\+$') -- cgit v1.2.1