diff --git a/tests/ansible/integration/connection/_disconnect_during_module.yml b/tests/ansible/integration/connection/_disconnect_during_module.yml new file mode 100644 index 00000000..6bd8cd50 --- /dev/null +++ b/tests/ansible/integration/connection/_disconnect_during_module.yml @@ -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 diff --git a/tests/ansible/integration/connection/disconnect_during_module.yml b/tests/ansible/integration/connection/disconnect_during_module.yml index f2943b44..2b9c2c55 100644 --- a/tests/ansible/integration/connection/disconnect_during_module.yml +++ b/tests/ansible/integration/connection/disconnect_during_module.yml @@ -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"