Browse code

[stable-2.6] Fix nuage_vspk integration test:

- Wait for API to be ready.
- Enumerate test cases on controller.
(cherry picked from commit 29de0619e860cd1dad111b3572aed42c90929cbf)

Co-authored-by: Matt Clay <matt@mystile.com>

Matt Clay authored on 2019/03/26 08:01:36
Showing 3 changed files
... ...
@@ -1,6 +1,5 @@
1 1
 ---
2 2
 testcase: "*"
3
-test_items: []
4 3
 nuage_auth:
5 4
   api_username: csproot
6 5
   api_password: csproot
... ...
@@ -1,19 +1,9 @@
1 1
 ---
2 2
 
3 3
 - block:
4
-    - name: collect all test cases
5
-      find:
6
-        paths: "{{ role_path }}/tests"
7
-        patterns: "{{ testcase }}.yaml"
8
-      delegate_to: localhost
9
-      register: test_cases
10
-
11
-    - name: set test_items
12
-      set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
13
-
14 4
     - name: run test case
15 5
       include: "{{ test_case_to_run }}"
16
-      with_items: "{{ test_items }}"
6
+      with_fileglob: "{{ role_path }}/tests/{{ testcase }}.yaml"
17 7
       loop_control:
18 8
         loop_var: test_case_to_run
19 9
   when: "ansible_python_version is version('2.7', '>=')"
... ...
@@ -8,4 +8,9 @@
8 8
       shell: "(cd /; nuage-vsd-sim >/dev/null 2>&1 &)"
9 9
       async: 10
10 10
       poll: 0
11
+
12
+    - name: Wait for API to be ready
13
+      wait_for:
14
+        port: 5000
15
+
11 16
   when: "ansible_python_version is version('2.7', '>=')"