From 52ae99e54fc67614e71bf1920848bb7b16bcd153 Mon Sep 17 00:00:00 2001 From: JingLu5 Date: Thu, 22 Dec 2016 12:07:55 +0800 Subject: Create API to run test suite JIRA: YARDSTICK-475 This API will be used to run test suite files in the test/opnfv/test_suites directory Change-Id: I208edf9abed62fd6436de988ac85bfe99c4d01bd Signed-off-by: JingLu5 --- api/swagger/docs/release_action.yaml | 50 +++++++++++++++++++++++++++++++++ api/swagger/docs/testcases.yaml | 50 --------------------------------- api/swagger/docs/testsuites_action.yaml | 50 +++++++++++++++++++++++++++++++++ api/swagger/models.py | 31 ++++++++++++++++++++ 4 files changed, 131 insertions(+), 50 deletions(-) create mode 100644 api/swagger/docs/release_action.yaml delete mode 100644 api/swagger/docs/testcases.yaml create mode 100644 api/swagger/docs/testsuites_action.yaml (limited to 'api/swagger') diff --git a/api/swagger/docs/release_action.yaml b/api/swagger/docs/release_action.yaml new file mode 100644 index 000000000..7bfe5e647 --- /dev/null +++ b/api/swagger/docs/release_action.yaml @@ -0,0 +1,50 @@ +TestCases Actions + +This API may offer many actions, including runTestCase + +action: runTestCase +This api offer the interface to run a test case in yardstick +we will return a task_id for querying +you can use the returned task_id to get the result data +--- +tags: + - Release Action +parameters: + - in: body + name: body + description: this is the input json dict + schema: + id: TestCaseActionModel + required: + - action + - args + properties: + action: + type: string + description: this is action for testcases + default: runTestCase + args: + schema: + id: TestCaseActionArgsModel + required: + - testcase + properties: + testcase: + type: string + description: this is the test case name + default: tc002 + opts: + schema: + id: TestCaseActionArgsOptsModel +responses: + 200: + description: A result json dict + schema: + id: result + properties: + status: + type: string + default: success + result: + type: string + description: task_id of this task diff --git a/api/swagger/docs/testcases.yaml b/api/swagger/docs/testcases.yaml deleted file mode 100644 index 7bfe5e647..000000000 --- a/api/swagger/docs/testcases.yaml +++ /dev/null @@ -1,50 +0,0 @@ -TestCases Actions - -This API may offer many actions, including runTestCase - -action: runTestCase -This api offer the interface to run a test case in yardstick -we will return a task_id for querying -you can use the returned task_id to get the result data ---- -tags: - - Release Action -parameters: - - in: body - name: body - description: this is the input json dict - schema: - id: TestCaseActionModel - required: - - action - - args - properties: - action: - type: string - description: this is action for testcases - default: runTestCase - args: - schema: - id: TestCaseActionArgsModel - required: - - testcase - properties: - testcase: - type: string - description: this is the test case name - default: tc002 - opts: - schema: - id: TestCaseActionArgsOptsModel -responses: - 200: - description: A result json dict - schema: - id: result - properties: - status: - type: string - default: success - result: - type: string - description: task_id of this task diff --git a/api/swagger/docs/testsuites_action.yaml b/api/swagger/docs/testsuites_action.yaml new file mode 100644 index 000000000..ebf01e4ec --- /dev/null +++ b/api/swagger/docs/testsuites_action.yaml @@ -0,0 +1,50 @@ +TestSuites Actions + +This API may offer many actions, including runTestSuite + +action: runTestSuite +This api offer the interface to run a test suite in yardstick +we will return a task_id for querying +you can use the returned task_id to get the result data +--- +tags: + - Testsuite Action +parameters: + - in: body + name: body + description: this is the input json dict + schema: + id: TestSuiteActionModel + required: + - action + - args + properties: + action: + type: string + description: this is action for testsuite + default: runTestSuite + args: + schema: + id: TestSuiteActionArgsModel + required: + - testsuite + properties: + testsuite: + type: string + description: this is the test suite name + default: smoke + opts: + schema: + id: TestSuiteActionArgsOptsModel +responses: + 200: + description: A result json dict + schema: + id: result + properties: + status: + type: string + default: success + result: + type: string + description: task_id of this task diff --git a/api/swagger/models.py b/api/swagger/models.py index 7c65fbbf5..9a0157e0e 100644 --- a/api/swagger/models.py +++ b/api/swagger/models.py @@ -42,6 +42,37 @@ class TestCaseActionModel: } +# for testsuite/action runTestSuite action +@swagger.model +class TestSuiteActionArgsOptsTaskArgModel: + resource_fields = { + } + + +@swagger.model +class TestSuiteActionArgsOptsModel: + resource_fields = { + 'task-args': TestSuiteActionArgsOptsTaskArgModel, + 'keep-deploy': fields.String, + 'suite': fields.String + } + +@swagger.model +class TestSuiteActionArgsModel: + resource_fields = { + 'testsuite': fields.String, + 'opts': TestSuiteActionArgsOptsModel + } + + +@swagger.model +class TestSuiteActionModel: + resource_fields = { + 'action': fields.String, + 'args': TestSuiteActionArgsModel + } + + # for results @swagger.model class ResultModel: -- cgit 1.2.3-korg