mirror of https://github.com/ansible/ansible.git
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 911a2ec6d3
)
pull/58551/head
parent
1a2bafa510
commit
28816088e4
@ -1,9 +1,19 @@
|
|||||||
---
|
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- name: run test case
|
- name: run test case
|
||||||
include: "{{ test_case_to_run }}"
|
include: "{{ test_case_to_run }}"
|
||||||
with_fileglob: "{{ role_path }}/tests/{{ testcase }}.yaml"
|
with_fileglob: tests/{{ testcase }}.yaml
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: test_case_to_run
|
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', '>=')"
|
when: "ansible_python_version is version('2.7', '>=')"
|
||||||
|
@ -1,16 +1,19 @@
|
|||||||
---
|
|
||||||
- block:
|
- block:
|
||||||
- name: Install Nuage VSD API Simulator
|
- name: Install Nuage VSD API Simulator
|
||||||
pip:
|
pip:
|
||||||
name: nuage-vsd-sim
|
name: nuage-vsd-sim
|
||||||
|
|
||||||
- name: Start Nuage VSD API Simulator
|
- name: Start Nuage VSD API Simulator
|
||||||
shell: "(cd /; nuage-vsd-sim >/dev/null 2>&1 &)"
|
shell: "(cd /; nuage-vsd-sim >/dev/null 2>&1)"
|
||||||
async: 10
|
async: 1800
|
||||||
poll: 0
|
poll: 0
|
||||||
|
|
||||||
- name: Wait for API to be ready
|
- name: Wait for API to be ready
|
||||||
wait_for:
|
uri:
|
||||||
port: 5000
|
url: http://localhost:5000
|
||||||
|
register: api
|
||||||
|
delay: 3
|
||||||
|
retries: 10
|
||||||
|
until: api.status == 200
|
||||||
|
|
||||||
when: "ansible_python_version is version('2.7', '>=')"
|
when: "ansible_python_version is version('2.7', '>=')"
|
||||||
|
Loading…
Reference in New Issue