tests: run disconnect_during_module.yml in subprocess

Avoid entire run failing with unreachable
issue510
David Wilson 6 years ago
parent 35092c5d35
commit 0c3e48468b

@ -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

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

Loading…
Cancel
Save