Add testapi setup task 01/33401/2
authorYujun Zhang <zhang.yujunz@zte.com.cn>
Mon, 17 Apr 2017 02:37:19 +0000 (10:37 +0800)
committerYujun Zhang <zhang.yujunz@zte.com.cn>
Mon, 17 Apr 2017 14:27:14 +0000 (22:27 +0800)
Change-Id: I7b4d3186afd724ec5a30cf630baee79875e426bb
Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
tests/integration/fixtures/case.json [new file with mode: 0644]
tests/integration/fixtures/pod.json [new file with mode: 0644]
tests/integration/fixtures/project.json [new file with mode: 0644]
tests/integration/group_vars/all
tests/integration/host_vars/localhost [new file with mode: 0644]
tests/integration/setup.yaml

diff --git a/tests/integration/fixtures/case.json b/tests/integration/fixtures/case.json
new file mode 100644 (file)
index 0000000..22abc40
--- /dev/null
@@ -0,0 +1,14 @@
+{
+  "run": "",
+  "name": "compute",
+  "ci_loop": "",
+  "tags": "",
+  "url": "",
+  "domains": "",
+  "dependencies": "",
+  "version": "",
+  "criteria": "",
+  "tier": "",
+  "blocking": "",
+  "description": ""
+}
\ No newline at end of file
diff --git a/tests/integration/fixtures/pod.json b/tests/integration/fixtures/pod.json
new file mode 100644 (file)
index 0000000..8c2863b
--- /dev/null
@@ -0,0 +1,6 @@
+{
+  "details": "",
+  "role": "",
+  "name": "internal",
+  "mode": ""
+}
\ No newline at end of file
diff --git a/tests/integration/fixtures/project.json b/tests/integration/fixtures/project.json
new file mode 100644 (file)
index 0000000..ecd03e8
--- /dev/null
@@ -0,0 +1,4 @@
+{
+  "name": "qtip",
+  "description": "Platform Performance Benchmarking"
+}
\ No newline at end of file
index 7c56f57..16a93f4 100644 (file)
@@ -1,2 +1,3 @@
 qtip_resources: ../../resources
 qtip_reports: ./reports
+qtip_fixtures: ./fixtures
diff --git a/tests/integration/host_vars/localhost b/tests/integration/host_vars/localhost
new file mode 100644 (file)
index 0000000..18d764c
--- /dev/null
@@ -0,0 +1,7 @@
+testapi_url: http://localhost:8000/api/v1
+project_name: qtip
+case_name: compute
+pod_name: internal
+installer: fuel
+version: master
+scenario: demo
index 4af9a12..8d055c2 100644 (file)
   - name: update ssh.cfg file
     template: src={{ qtip_resources }}/template/ssh.cfg.j2 dest=./ssh.cfg
     delegate_to: localhost
+
+# Initialize testapi database
+- hosts: localhost
+  tasks:
+  - name: create project and pod
+    uri:
+      url: "{{ testapi_url }}/{{item}}s"
+      method: POST
+      body: "{{ lookup('file', '{}/{}.json'.format(qtip_fixtures, item)) }}"
+      status_code: [200, 403]
+      body_format: json
+    with_items:
+      - project
+      - pod
+  - name: create cases
+    uri:
+      url: "{{ testapi_url }}/projects/qtip/cases"
+      method: POST
+      body: "{{ lookup('file', '{}/case.json'.format(qtip_fixtures)) }}"
+      status_code: [200, 403]
+      body_format: json
+  tags: [testapi]