aboutsummaryrefslogtreecommitdiffstats
path: root/functest/cli/commands/cli_os.py
diff options
context:
space:
mode:
authorLinda Wang <wangwulin@huawei.com>2017-06-29 07:12:29 +0000
committerLinda Wang <wangwulin@huawei.com>2017-08-17 09:24:49 +0000
commitecaecd74a20e4845fb748077b759a5697ba86f1c (patch)
treea26e7f5b5b456a78c29ab135f4862a9ca4b2ae25 /functest/cli/commands/cli_os.py
parent94d1bddfdd97379e50e4c12f26116441e836d0f6 (diff)
API proposal for functest
1. Propose a basic framework for API 2. And these functions have been realized: 1) Show environment 2) Prepare Environment 3) Show credentials 4) List all testcases 5) Show a testcase 6) List all tiers 7) Show a tier 8) List all testcases within given tier JIRA: FUNCTEST-843 Change-Id: Ib961446708077b56465eda0052f6d38806b62594 Signed-off-by: Linda Wang <wangwulin@huawei.com>
Diffstat (limited to 'functest/cli/commands/cli_os.py')
-rw-r--r--functest/cli/commands/cli_os.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/functest/cli/commands/cli_os.py b/functest/cli/commands/cli_os.py
index f4ec1661..e97ab080 100644
--- a/functest/cli/commands/cli_os.py
+++ b/functest/cli/commands/cli_os.py
@@ -18,7 +18,7 @@ import functest.utils.openstack_clean as os_clean
import functest.utils.openstack_snapshot as os_snapshot
-class CliOpenStack(object):
+class OpenStack(object):
def __init__(self):
self.os_auth_url = CONST.__getattribute__('OS_AUTH_URL')
@@ -43,9 +43,11 @@ class CliOpenStack(object):
@staticmethod
def show_credentials():
+ dic_credentials = {}
for key, value in os.environ.items():
if key.startswith('OS_'):
- click.echo("{}={}".format(key, value))
+ dic_credentials.update({key: value})
+ return dic_credentials
def check(self):
self.ping_endpoint()
@@ -88,3 +90,16 @@ class CliOpenStack(object):
"'functest openstack snapshot-create'")
return
os_clean.main()
+
+
+class CliOpenStack(OpenStack):
+
+ def __init__(self):
+ super(CliOpenStack, self).__init__()
+
+ @staticmethod
+ def show_credentials():
+ dic_credentials = OpenStack.show_credentials()
+ for key, value in dic_credentials.items():
+ if key.startswith('OS_'):
+ click.echo("{}={}".format(key, value))