tests: run disconnect_during_module.yml in subprocess

Avoid entire run failing with unreachable
This commit is contained in:
David Wilson 2018-11-05 13:33:33 +00:00
parent 35092c5d35
commit 0c3e48468b
2 changed files with 25 additions and 7 deletions

View File

@ -0,0 +1,13 @@
# issue 352: test ability to notice disconnection during a module invocation.
---
- name: integration/connection/_disconnect_during_module.yml
hosts: test-targets
gather_facts: no
any_errors_fatal: false
tasks:
- run_once: true # don't run against localhost
shell: |
kill -9 $PPID
register: out
ignore_errors: true

View File

@ -2,18 +2,23 @@
---
- name: integration/connection/disconnect_during_module.yml
hosts: test-targets localhost
hosts: test-targets
gather_facts: no
any_errors_fatal: false
tasks:
- run_once: true # don't run against localhost
shell: |
kill -9 $PPID
- connection: local
command: |
ansible-playbook
-i "{{inventory_file}}"
integration/connection/_disconnect_during_module.yml
args:
chdir: ../..
register: out
ignore_errors: true
- debug: var=out
- assert:
that:
- out.msg.startswith('Mitogen was disconnected from the remote environment while a call was in-progress.')
- meta: clear_host_errors
- out.rc == 4
- "'Mitogen was disconnected from the remote environment while a call was in-progress.' in out.stdout"