summaryrefslogtreecommitdiff
path: root/openstackclient/tests/functional/base.py
diff options
context:
space:
mode:
authorDean Troyer <dtroyer@gmail.com>2017-04-26 17:02:12 -0500
committerDean Troyer <dtroyer@gmail.com>2017-04-26 23:52:34 +0000
commit871450abcd89f9bb5ee9f75cdef3b812695eae93 (patch)
tree3a5b436e301e16f6e99037d6ee7da1ef3eb5bfc0 /openstackclient/tests/functional/base.py
parent0a0bcbbda2c7384f6308bb8041119d6c38915e2f (diff)
downloadpython-openstackclient-871450abcd89f9bb5ee9f75cdef3b812695eae93.tar.gz
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
Diffstat (limited to 'openstackclient/tests/functional/base.py')
-rw-r--r--openstackclient/tests/functional/base.py12
1 files changed, 12 insertions, 0 deletions
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('^\+\-[\+\-]+\-\+$')