diff options
author | Sam Doran <sdoran@redhat.com> | 2019-06-26 16:58:19 -0400 |
---|---|---|
committer | Matt Clay <matt@mystile.com> | 2019-06-26 14:54:25 -0700 |
commit | f3ce22b1686c16cbb99212027f1885b83a1cedfe (patch) | |
tree | ad2e65b4200a0e1373a567d0e916126b29af88f6 | |
parent | d981461a7bfc6686cee46519f3089fb693e5160f (diff) | |
download | ansible-f3ce22b1686c16cbb99212027f1885b83a1cedfe.tar.gz |
Make nuage_vspk test more reliable
- don't background the nuage-vsd-sim
- increase the asncy timeout
- use uri to actually query the simulator API to make sure it is ready for connections
(cherry picked from commit 911a2ec6d3aad72eb72f6a9b1401777332402a5d)
-rw-r--r-- | test/integration/targets/nuage_vspk/tasks/main.yml | 16 | ||||
-rw-r--r-- | test/integration/targets/prepare_nuage_tests/tasks/main.yml | 13 |
2 files changed, 21 insertions, 8 deletions
diff --git a/test/integration/targets/nuage_vspk/tasks/main.yml b/test/integration/targets/nuage_vspk/tasks/main.yml index 37851a1403..9958c22dd7 100644 --- a/test/integration/targets/nuage_vspk/tasks/main.yml +++ b/test/integration/targets/nuage_vspk/tasks/main.yml @@ -1,9 +1,19 @@ ---- - - block: - name: run test case include: "{{ test_case_to_run }}" - with_fileglob: "{{ role_path }}/tests/{{ testcase }}.yaml" + with_fileglob: tests/{{ testcase }}.yaml loop_control: loop_var: test_case_to_run + + always: + - name: Get nuage-vsd-sim pid + shell: ps -A | grep '[n]'uage-vsd-sim | cut -d ' ' -f 1 + register: vsim_pid + changed_when: no + ignore_errors: yes + + - name: Stop-nuage-vsd-sim + command: kill {{ vsim_pid.stdout }} + changed_when: no + ignore_errors: yes when: "ansible_python_version is version('2.7', '>=')" diff --git a/test/integration/targets/prepare_nuage_tests/tasks/main.yml b/test/integration/targets/prepare_nuage_tests/tasks/main.yml index f988342e5e..11408971c3 100644 --- a/test/integration/targets/prepare_nuage_tests/tasks/main.yml +++ b/test/integration/targets/prepare_nuage_tests/tasks/main.yml @@ -1,16 +1,19 @@ ---- - block: - name: Install Nuage VSD API Simulator pip: name: nuage-vsd-sim - name: Start Nuage VSD API Simulator - shell: "(cd /; nuage-vsd-sim >/dev/null 2>&1 &)" - async: 10 + shell: "(cd /; nuage-vsd-sim >/dev/null 2>&1)" + async: 1800 poll: 0 - name: Wait for API to be ready - wait_for: - port: 5000 + uri: + url: http://localhost:5000 + register: api + delay: 3 + retries: 10 + until: api.status == 200 when: "ansible_python_version is version('2.7', '>=')" |