diff options
author | Matt Clay <matt@mystile.com> | 2017-07-05 19:00:13 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-05 19:00:13 -0700 |
commit | 895e6c5d063d02e1e55a860c9a083122aabdd4ac (patch) | |
tree | e23c27ab79e3886efb45fafb78a4dc6605f97e6b /test/integration/targets/wait_for | |
parent | 2a041d10d26d5746132061da4b874f33cb73ffb0 (diff) | |
download | ansible-895e6c5d063d02e1e55a860c9a083122aabdd4ac.tar.gz |
Fix wait_for with newer versions of psutil. (#26455)
* Add support for newer psutil versions.
* Fix psutil install in wait_for integration test.
* Fix test requirements for wait_for elapsed.
Diffstat (limited to 'test/integration/targets/wait_for')
-rw-r--r-- | test/integration/targets/wait_for/tasks/main.yml | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/test/integration/targets/wait_for/tasks/main.yml b/test/integration/targets/wait_for/tasks/main.yml index e30651fae3..03157ed74e 100644 --- a/test/integration/targets/wait_for/tasks/main.yml +++ b/test/integration/targets/wait_for/tasks/main.yml @@ -30,8 +30,8 @@ that: - waitfor|success - "waitfor.path == '/tmp/wait_for_file'" - - waitfor.elapsed <= 10 - - waitfor.elapsed > 0 + - waitfor.elapsed >= 5 + - waitfor.elapsed <= 15 - name: setup create a file after 10s shell: sleep 10 && touch /tmp/wait_for_file @@ -48,8 +48,8 @@ that: - waitfor|success - "waitfor.path == '/tmp/wait_for_file'" - - waitfor.elapsed <= 10 - - waitfor.elapsed > 0 + - waitfor.elapsed >= 5 + - waitfor.elapsed <= 15 - name: setup write keyword to file after 10s shell: rm -f /tmp/wait_for_keyword && sleep 10 && echo completed > /tmp/wait_for_keyword @@ -67,8 +67,8 @@ that: - waitfor|success - "waitfor.search_regex == 'completed'" - - waitfor.elapsed <= 10 - - waitfor.elapsed > 0 + - waitfor.elapsed >= 5 + - waitfor.elapsed <= 15 - name: test wait for port timeout wait_for: @@ -114,22 +114,20 @@ - not waitfor|changed - "waitfor.port == {{ http_port }}" -# TODO: fix drain test for freebsd and macOS, ubuntu-py3 -- name: setup install psutil - package: - name: python-psutil - when: ansible_system == "Linux" and not (ansible_distribution == "Ubuntu" and ansible_distribution_version == "16.04") +- name: install psutil using pip (non-Linux only) + pip: + name: psutil + when: ansible_system != 'Linux' - name: test wait for port drained wait_for: port: "{{ http_port }}" state: drained register: waitfor - when: ansible_system == "Linux" and not (ansible_distribution == "Ubuntu" and ansible_distribution_version == "16.04") + - name: verify test wait for port assert: that: - waitfor|success - not waitfor|changed - "waitfor.port == {{ http_port }}" - when: ansible_system == "Linux" and not (ansible_distribution == "Ubuntu" and ansible_distribution_version == "16.04") |