diff options
author | xudan <xudan16@huawei.com> | 2019-05-14 08:28:56 -0400 |
---|---|---|
committer | Dan Xu <xudan16@huawei.com> | 2019-06-12 01:33:40 +0000 |
commit | d1091a5e7c5f6b466d678fca0f47801d3e3f0e1a (patch) | |
tree | d216efaf5504ceda2c4b8edb563cf3ae7686c1c8 /dovetail/api/app/server.py | |
parent | fe1a78666f215a568866c4b5eb28c8feda0ad278 (diff) |
Add RESTful APIs into Dovetail container
JIRA: DOVETAIL-774
Change-Id: Ifb934eaeda52c1d316d80d9bb9c1890ffb71049c
Signed-off-by: xudan <xudan16@huawei.com>
Diffstat (limited to 'dovetail/api/app/server.py')
-rw-r--r-- | dovetail/api/app/server.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/dovetail/api/app/server.py b/dovetail/api/app/server.py new file mode 100644 index 00000000..4428c251 --- /dev/null +++ b/dovetail/api/app/server.py @@ -0,0 +1,24 @@ +import constants + +from dovetail.testcase import Testsuite, Testcase + + +def list_testsuites(): + return Testsuite.load() + + +def list_testcases(): + testcases = Testcase.load() + testcase_list = [] + for key, value in testcases.items(): + testcase = {'testCaseName': key, + 'description': value.objective(), + 'subTestCase': value.sub_testcase()} + if value.validate_type() in constants.NFVI_PROJECT: + testcase['scenario'] = 'nfvi' + elif value.validate_type() in constants.VNF_PROJECT: + testcase['scenario'] = 'vnf' + else: + testcase['scenario'] = 'unknown' + testcase_list.append(testcase) + return testcase_list |