From c510e58f9b74279277df4f6e6195847ea678c990 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Mon, 29 Oct 2018 15:36:33 +0000 Subject: [PATCH] issue #352: add test for disconnect message. --- tests/ansible/integration/connection/all.yml | 3 ++- .../connection/disconnect_during_module.yml | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 tests/ansible/integration/connection/disconnect_during_module.yml diff --git a/tests/ansible/integration/connection/all.yml b/tests/ansible/integration/connection/all.yml index 123e11c4..d0ad4c1b 100644 --- a/tests/ansible/integration/connection/all.yml +++ b/tests/ansible/integration/connection/all.yml @@ -1,5 +1,6 @@ --- +- import_playbook: disconnect_during_module.yml - import_playbook: exec_command.yml -- import_playbook: put_small_file.yml - import_playbook: put_large_file.yml +- import_playbook: put_small_file.yml 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..f2943b44 --- /dev/null +++ b/tests/ansible/integration/connection/disconnect_during_module.yml @@ -0,0 +1,19 @@ +# issue 352: test ability to notice disconnection during a module invocation. +--- + +- name: integration/connection/disconnect_during_module.yml + hosts: test-targets localhost + 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 + + - assert: + that: + - out.msg.startswith('Mitogen was disconnected from the remote environment while a call was in-progress.') + + - meta: clear_host_errors