tests: Improve Ansible fail_msg formatting

By switching to block style (`|`) with clip (no `-` or `+`) the failure
messages don't require quoting and gain a single trailing newline. This causes
Ansible to print them as block style, when using the yaml stdout callback
plugin. As a result the values have one less layer of quoting and quote
escaping, making them much easier to read.
pull/1136/head
Alex Willmer 3 months ago
parent 17d3f39e44
commit 6accc87da1

@ -23,6 +23,7 @@ Unreleased
* :gh:issue:`1106` :mod:`ansible_mitogen`: Support for `ansible_ssh_password` * :gh:issue:`1106` :mod:`ansible_mitogen`: Support for `ansible_ssh_password`
connection variable, and templated SSH connection password. connection variable, and templated SSH connection password.
* :gh:issue:`1136` tests: Improve Ansible fail_msg formatting.
v0.3.11 (2024-10-30) v0.3.11 (2024-10-30)

@ -77,7 +77,8 @@
that: that:
- item.stat.checksum == item.item.expected_checksum - item.stat.checksum == item.item.expected_checksum
quiet: true # Avoid spamming stdout with 400 kB of item.item.content quiet: true # Avoid spamming stdout with 400 kB of item.item.content
fail_msg: item={{ item }} fail_msg: |
item={{ item }}
with_items: "{{ stat.results }}" with_items: "{{ stat.results }}"
loop_control: loop_control:
label: "{{ item.stat.path }}" label: "{{ item.stat.path }}"

@ -16,7 +16,8 @@
- assert: - assert:
that: that:
- out.stat.mode in ("0644", "0664") - out.stat.mode in ("0644", "0664")
fail_msg: out={{out}} fail_msg: |
out={{ out }}
- name: "Copy files from content: arg" - name: "Copy files from content: arg"
copy: copy:
@ -29,7 +30,8 @@
- assert: - assert:
that: that:
- out.stat.mode == "0400" - out.stat.mode == "0400"
fail_msg: out={{out}} fail_msg: |
out={{ out }}
- name: Cleanup local weird mode file - name: Cleanup local weird mode file
file: file:
@ -55,7 +57,8 @@
- assert: - assert:
that: that:
- out.stat.mode in ("0644", "0664") - out.stat.mode in ("0644", "0664")
fail_msg: out={{out}} fail_msg: |
out={{ out }}
- name: Copy file with weird mode, preserving mode - name: Copy file with weird mode, preserving mode
copy: copy:
@ -69,7 +72,8 @@
- assert: - assert:
that: that:
- out.stat.mode == "1462" - out.stat.mode == "1462"
fail_msg: out={{out}} fail_msg: |
out={{ out }}
- name: Copy file with weird mode, explicit mode - name: Copy file with weird mode, explicit mode
copy: copy:
@ -84,7 +88,8 @@
- assert: - assert:
that: that:
- out.stat.mode == "1461" - out.stat.mode == "1461"
fail_msg: out={{out}} fail_msg: |
out={{ out }}
- name: Cleanup - name: Cleanup
file: file:

@ -15,7 +15,8 @@
- 'raw.rc == 0' - 'raw.rc == 0'
- 'raw.stdout_lines[-1]|to_text == "2"' - 'raw.stdout_lines[-1]|to_text == "2"'
- 'raw.stdout[-1]|to_text == "2"' - 'raw.stdout[-1]|to_text == "2"'
fail_msg: raw={{raw}} fail_msg: |
raw={{ raw }}
- name: Run raw module with sudo - name: Run raw module with sudo
become: true become: true
@ -39,6 +40,7 @@
["root\r\n"], ["root\r\n"],
["root"], ["root"],
) )
fail_msg: raw={{raw}} fail_msg: |
raw={{ raw }}
tags: tags:
- low_level_execute_command - low_level_execute_command

@ -42,13 +42,17 @@
assert: assert:
that: that:
- good_temp_path == good_temp_path2 - good_temp_path == good_temp_path2
fail_msg: good_temp_path={{good_temp_path}} good_temp_path2={{good_temp_path2}} fail_msg: |
good_temp_path={{ good_temp_path }}
good_temp_path2={{ good_temp_path2 }}
- name: "Verify different subdir for both tasks" - name: "Verify different subdir for both tasks"
assert: assert:
that: that:
- tmp_path.path != tmp_path2.path - tmp_path.path != tmp_path2.path
fail_msg: tmp_path={{tmp_path}} tmp_path2={{tmp_path2}} fail_msg: |
tmp_path={{ tmp_path }}
tmp_path2={{ tmp_path2 }}
# #
# Verify subdirectory removal. # Verify subdirectory removal.
@ -69,7 +73,9 @@
that: that:
- not stat1.stat.exists - not stat1.stat.exists
- not stat2.stat.exists - not stat2.stat.exists
fail_msg: stat1={{stat1}} stat2={{stat2}} fail_msg: |
stat1={{ stat1 }}
stat2={{ stat2 }}
# #
# Verify good directory persistence. # Verify good directory persistence.
@ -84,7 +90,8 @@
assert: assert:
that: that:
- stat.stat.exists - stat.stat.exists
fail_msg: stat={{stat}} fail_msg: |
stat={{ stat }}
# #
# Write some junk into the temp path. # Write some junk into the temp path.
@ -107,7 +114,8 @@
- assert: - assert:
that: that:
- not out.stat.exists - not out.stat.exists
fail_msg: out={{out}} fail_msg: |
out={{ out }}
# #
# root # root
@ -126,7 +134,9 @@
that: that:
- tmp_path2.path != tmp_path_root.path - tmp_path2.path != tmp_path_root.path
- tmp_path2.path|dirname != tmp_path_root.path|dirname - tmp_path2.path|dirname != tmp_path_root.path|dirname
fail_msg: tmp_path_root={{tmp_path_root}} tmp_path2={{tmp_path2}} fail_msg: |
tmp_path_root={{ tmp_path_root }}
tmp_path2={{ tmp_path2 }}
# #
# readonly homedir # readonly homedir
@ -157,7 +167,8 @@
that: that:
- out.module_path.startswith(good_temp_path2) - out.module_path.startswith(good_temp_path2)
- out.module_tmpdir.startswith(good_temp_path2) - out.module_tmpdir.startswith(good_temp_path2)
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- make_tmp_path - make_tmp_path
- mitogen_only - mitogen_only

@ -26,7 +26,8 @@
register: out register: out
- assert: - assert:
that: out.result == user_facts.ansible_facts.ansible_user_dir ~ '/foo' that: out.result == user_facts.ansible_facts.ansible_user_dir ~ '/foo'
fail_msg: out={{out}} fail_msg: |
out={{ out }}
- name: "Expand ~/foo with become active. ~ is become_user's home." - name: "Expand ~/foo with become active. ~ is become_user's home."
action_passthrough: action_passthrough:
@ -49,7 +50,8 @@
register: out register: out
- assert: - assert:
that: out.result == user_facts.ansible_facts.ansible_user_dir ~ '/foo' that: out.result == user_facts.ansible_facts.ansible_user_dir ~ '/foo'
fail_msg: out={{out}} fail_msg: |
out={{ out }}
- name: "Expanding $HOME/foo has no effect." - name: "Expanding $HOME/foo has no effect."
action_passthrough: action_passthrough:
@ -60,7 +62,8 @@
register: out register: out
- assert: - assert:
that: out.result == '$HOME/foo' that: out.result == '$HOME/foo'
fail_msg: out={{out}} fail_msg: |
out={{ out }}
# ------------------------ # ------------------------
@ -73,7 +76,8 @@
register: out register: out
- assert: - assert:
that: out.result == user_facts.ansible_facts.ansible_user_dir ~ '/foo' that: out.result == user_facts.ansible_facts.ansible_user_dir ~ '/foo'
fail_msg: out={{out}} fail_msg: |
out={{ out }}
- name: "sudoable; Expand ~/foo with become active. ~ is become_user's home." - name: "sudoable; Expand ~/foo with become active. ~ is become_user's home."
action_passthrough: action_passthrough:
@ -97,7 +101,8 @@
register: out register: out
- assert: - assert:
that: out.result == user_facts.ansible_facts.ansible_user_dir ~ '/foo' that: out.result == user_facts.ansible_facts.ansible_user_dir ~ '/foo'
fail_msg: out={{out}} fail_msg: |
out={{ out }}
- name: "sudoable; Expanding $HOME/foo has no effect." - name: "sudoable; Expanding $HOME/foo has no effect."
action_passthrough: action_passthrough:
@ -108,6 +113,7 @@
register: out register: out
- assert: - assert:
that: out.result == '$HOME/foo' that: out.result == '$HOME/foo'
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- remote_expand_user - remote_expand_user

@ -12,7 +12,8 @@
register: out register: out
- assert: - assert:
that: out.result == False that: out.result == False
fail_msg: out={{out}} fail_msg: |
out={{ out }}
- name: Ensure does-exist does - name: Ensure does-exist does
copy: copy:
@ -24,7 +25,8 @@
register: out register: out
- assert: - assert:
that: out.result == True that: out.result == True
fail_msg: out={{out}} fail_msg: |
out={{ out }}
- name: Cleanup - name: Cleanup
file: file:

@ -23,7 +23,8 @@
- assert: - assert:
that: that:
- not out2.stat.exists - not out2.stat.exists
fail_msg: out={{out}} fail_msg: |
out={{ out }}
- stat: - stat:
path: "{{out.src|dirname}}" path: "{{out.src|dirname}}"
@ -32,7 +33,8 @@
- assert: - assert:
that: that:
- not out2.stat.exists - not out2.stat.exists
fail_msg: out={{out}} fail_msg: |
out={{ out }}
- file: - file:
path: /tmp/remove_tmp_path_test path: /tmp/remove_tmp_path_test

@ -66,7 +66,8 @@
- assert: - assert:
that: outout == "item!" that: outout == "item!"
fail_msg: outout={{outout}} fail_msg: |
outout={{ outout }}
when: False when: False
# TODO: https://github.com/dw/mitogen/issues/692 # TODO: https://github.com/dw/mitogen/issues/692

@ -22,7 +22,8 @@
- assert: - assert:
that: | that: |
out.content|b64decode == '{"I am JSON": true}' out.content|b64decode == '{"I am JSON": true}'
fail_msg: out={{out}} fail_msg: |
out={{ out }}
- name: Create text transfer data - name: Create text transfer data
action_passthrough: action_passthrough:
@ -37,7 +38,8 @@
- assert: - assert:
that: that:
out.content|b64decode == 'I am text.' out.content|b64decode == 'I am text.'
fail_msg: out={{out}} fail_msg: |
out={{ out }}
- name: Cleanup transfer data - name: Cleanup transfer data
file: file:

@ -33,6 +33,7 @@
- out.results[1].stdout == 'hi-from-job-2' - out.results[1].stdout == 'hi-from-job-2'
- out.results[1].rc == 0 - out.results[1].rc == 0
- out.results[1].delta > '0:00:05' - out.results[1].delta > '0:00:05'
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- multiple_items_loop - multiple_items_loop

@ -27,7 +27,8 @@
(job.started == 1) and (job.started == 1) and
(job.changed == True) and (job.changed == True) and
(job.finished == 0) (job.finished == 0)
fail_msg: job={{job}} fail_msg: |
job={{ job }}
- name: busy-poll up to 100000 times - name: busy-poll up to 100000 times
async_status: async_status:
@ -52,7 +53,8 @@
- async_out.failed == False - async_out.failed == False
- async_out.msg == "Hello, world." - async_out.msg == "Hello, world."
- 'async_out.stderr == "binary_producing_json: oh noes\n"' - 'async_out.stderr == "binary_producing_json: oh noes\n"'
fail_msg: async_out={{async_out}} fail_msg: |
async_out={{ async_out }}
vars: vars:
async_out: "{{result.content|b64decode|from_json}}" async_out: "{{result.content|b64decode|from_json}}"
tags: tags:

@ -38,7 +38,8 @@
- async_out.msg.startswith("Traceback") - async_out.msg.startswith("Traceback")
- '"ValueError: No start of json char found\n" in async_out.msg' - '"ValueError: No start of json char found\n" in async_out.msg'
- 'async_out.stderr == "binary_producing_junk: oh noes\n"' - 'async_out.stderr == "binary_producing_junk: oh noes\n"'
fail_msg: async_out={{async_out}} fail_msg: |
async_out={{ async_out }}
vars: vars:
async_out: "{{result.content|b64decode|from_json}}" async_out: "{{result.content|b64decode|from_json}}"
tags: tags:

@ -42,14 +42,16 @@
- async_out.start.startswith("20") - async_out.start.startswith("20")
- async_out.stderr == "there" - async_out.stderr == "there"
- async_out.stdout == "hi" - async_out.stdout == "hi"
fail_msg: async_out={{async_out}} fail_msg: |
async_out={{ async_out }}
vars: vars:
async_out: "{{result.content|b64decode|from_json}}" async_out: "{{result.content|b64decode|from_json}}"
- assert: - assert:
that: that:
- async_out.invocation.module_args.stdin == None - async_out.invocation.module_args.stdin == None
fail_msg: async_out={{async_out}} fail_msg: |
async_out={{ async_out }}
when: when:
- ansible_version.full is version('2.4', '>=', strict=True) - ansible_version.full is version('2.4', '>=', strict=True)
vars: vars:

@ -15,7 +15,9 @@
- assert: - assert:
that: that:
- sync_proc1.pid == sync_proc2.pid - sync_proc1.pid == sync_proc2.pid
fail_msg: sync_proc1={{sync_proc1}} sync_proc2={{sync_proc2}} fail_msg: |
sync_proc1={{ sync_proc1 }}
sync_proc2={{ sync_proc2 }}
when: is_mitogen when: is_mitogen
- name: get async process ID. - name: get async process ID.
@ -52,7 +54,9 @@
- sync_proc1.pid == sync_proc2.pid - sync_proc1.pid == sync_proc2.pid
- async_result1.pid != sync_proc1.pid - async_result1.pid != sync_proc1.pid
- async_result1.pid != async_result2.pid - async_result1.pid != async_result2.pid
fail_msg: async_result1={{async_result1}} async_result2={{async_result2}} fail_msg: |
async_result1={{ async_result1 }}
async_result2={{ async_result2 }}
when: is_mitogen when: is_mitogen
tags: tags:
- runner_new_process - runner_new_process

@ -23,7 +23,8 @@
(job1.started == 1) and (job1.started == 1) and
(job1.changed == True) and (job1.changed == True) and
(job1.finished == 0) (job1.finished == 0)
fail_msg: job1={{job1}} fail_msg: |
job1={{ job1 }}
- name: busy-poll up to 100000 times - name: busy-poll up to 100000 times
async_status: async_status:
@ -48,7 +49,8 @@
- result1.start|length == 26 - result1.start|length == 26
- result1.finished == 1 - result1.finished == 1
- result1.rc == 0 - result1.rc == 0
fail_msg: result1={{result1}} fail_msg: |
result1={{ result1 }}
- assert: - assert:
that: that:
@ -56,14 +58,16 @@
- result1.stderr_lines == [] - result1.stderr_lines == []
- result1.stdout == "alldone" - result1.stdout == "alldone"
- result1.stdout_lines == ["alldone"] - result1.stdout_lines == ["alldone"]
fail_msg: result1={{result1}} fail_msg: |
result1={{ result1 }}
when: when:
- ansible_version.full is version('2.8', '>', strict=True) # ansible#51393 - ansible_version.full is version('2.8', '>', strict=True) # ansible#51393
- assert: - assert:
that: that:
- result1.failed == False - result1.failed == False
fail_msg: result1={{result1}} fail_msg: |
result1={{ result1 }}
when: when:
- ansible_version.full is version('2.4', '>', strict=True) - ansible_version.full is version('2.4', '>', strict=True)
tags: tags:

@ -29,7 +29,8 @@
- result.failed == 1 - result.failed == 1
- result.finished == 1 - result.finished == 1
- result.msg == "Job reached maximum time limit of 1 seconds." - result.msg == "Job reached maximum time limit of 1 seconds."
fail_msg: result={{result}} fail_msg: |
result={{ result }}
tags: tags:
- mitogen_only - mitogen_only
- runner_timeout_then_polling - runner_timeout_then_polling

@ -56,12 +56,15 @@
that: that:
- result1.rc == 0 - result1.rc == 0
- result2.rc == 0 - result2.rc == 0
fail_msg: result1={{result1}} result2={{result2}} fail_msg: |
result1={{ result1 }}
result2={{ result2 }}
- assert: - assert:
that: that:
- result2.stdout == 'im_alive' - result2.stdout == 'im_alive'
fail_msg: result2={{result2}} fail_msg: |
result2={{ result2 }}
when: when:
- ansible_version.full is version('2.8', '>=', strict=True) # ansible#51393 - ansible_version.full is version('2.8', '>=', strict=True) # ansible#51393
tags: tags:

@ -21,6 +21,7 @@
job1.msg == "async task did not complete within the requested time" or job1.msg == "async task did not complete within the requested time" or
job1.msg == "async task did not complete within the requested time - 1s" or job1.msg == "async task did not complete within the requested time - 1s" or
job1.msg == "Job reached maximum time limit of 1 seconds." job1.msg == "Job reached maximum time limit of 1 seconds."
fail_msg: job1={{job1}} fail_msg: |
job1={{ job1 }}
tags: tags:
- runner_with_polling_and_timeout - runner_with_polling_and_timeout

@ -20,7 +20,8 @@
('password is required' in out.msg) or ('password is required' in out.msg) or
('password is required' in out.module_stderr) ('password is required' in out.module_stderr)
) )
fail_msg: out={{out}} fail_msg: |
out={{ out }}
when: is_mitogen when: is_mitogen
@ -40,7 +41,8 @@
('Incorrect su password' in out.msg) or ('Incorrect su password' in out.msg) or
('su password is incorrect' in out.msg) ('su password is incorrect' in out.msg)
) )
fail_msg: out={{out}} fail_msg: |
out={{ out }}
when: is_mitogen when: is_mitogen
- name: Ensure password su with chdir succeeds - name: Ensure password su with chdir succeeds
@ -62,7 +64,8 @@
- assert: - assert:
that: that:
- out.stdout == 'mitogen__user1' - out.stdout == 'mitogen__user1'
fail_msg: out={{out}} fail_msg: |
out={{ out }}
when: when:
# CI containers lack `setfacl` for unpriv -> unpriv # CI containers lack `setfacl` for unpriv -> unpriv
# https://github.com/mitogen-hq/mitogen/issues/1118 # https://github.com/mitogen-hq/mitogen/issues/1118
@ -87,7 +90,8 @@
- assert: - assert:
that: that:
- out.stdout == 'mitogen__user1' - out.stdout == 'mitogen__user1'
fail_msg: out={{out}} fail_msg: |
out={{ out }}
when: when:
# CI containers lack `setfacl` for unpriv -> unpriv # CI containers lack `setfacl` for unpriv -> unpriv
# https://github.com/mitogen-hq/mitogen/issues/1118 # https://github.com/mitogen-hq/mitogen/issues/1118

@ -20,7 +20,8 @@
or out.module_stderr is match("sudo: invalid option -- '-'") or out.module_stderr is match("sudo: invalid option -- '-'")
or out.module_stdout is match("sudo: unrecognized option [`']--derps'") or out.module_stdout is match("sudo: unrecognized option [`']--derps'")
or out.module_stderr is match("sudo: unrecognized option [`']--derps'") or out.module_stderr is match("sudo: unrecognized option [`']--derps'")
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- sudo - sudo
- sudo_flags_failure - sudo_flags_failure

@ -23,7 +23,8 @@
- >- - >-
(out.module_stderr | default(out.module_stdout, true) | default(out.msg, true)) is search('sudo: unknown user:? slartibartfast') (out.module_stderr | default(out.module_stdout, true) | default(out.msg, true)) is search('sudo: unknown user:? slartibartfast')
or (ansible_facts.os_family == 'RedHat' and ansible_facts.distribution_version == '6.10') or (ansible_facts.os_family == 'RedHat' and ansible_facts.distribution_version == '6.10')
fail_msg: out={{out}} fail_msg: |
out={{ out }}
when: when:
# https://github.com/ansible/ansible/pull/70785 # https://github.com/ansible/ansible/pull/70785
- ansible_facts.distribution not in ["MacOSX"] - ansible_facts.distribution not in ["MacOSX"]

@ -11,7 +11,8 @@
- assert: - assert:
that: that:
- out.stdout != 'root' - out.stdout != 'root'
fail_msg: out={{out}} fail_msg: |
out={{ out }}
- name: Ensure passwordless sudo to root succeeds. - name: Ensure passwordless sudo to root succeeds.
shell: whoami shell: whoami
@ -22,7 +23,8 @@
- assert: - assert:
that: that:
- out.stdout == 'root' - out.stdout == 'root'
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- sudo - sudo
- sudo_nopassword - sudo_nopassword

@ -23,7 +23,8 @@
('Missing sudo password' in out.msg) or ('Missing sudo password' in out.msg) or
('password is required' in out.module_stderr) ('password is required' in out.module_stderr)
) )
fail_msg: out={{out}} fail_msg: |
out={{ out }}
when: when:
# https://github.com/ansible/ansible/pull/70785 # https://github.com/ansible/ansible/pull/70785
- ansible_facts.distribution not in ["MacOSX"] - ansible_facts.distribution not in ["MacOSX"]
@ -50,7 +51,8 @@
('Incorrect sudo password' in out.msg) or ('Incorrect sudo password' in out.msg) or
('sudo password is incorrect' in out.msg) ('sudo password is incorrect' in out.msg)
) )
fail_msg: out={{out}} fail_msg: |
out={{ out }}
when: when:
# https://github.com/ansible/ansible/pull/70785 # https://github.com/ansible/ansible/pull/70785
- ansible_facts.distribution not in ["MacOSX"] - ansible_facts.distribution not in ["MacOSX"]

@ -26,4 +26,6 @@
- original.stat.checksum == copied.stat.checksum - original.stat.checksum == copied.stat.checksum
# Upstream does not preserve timestamps at al. # Upstream does not preserve timestamps at al.
#- (not is_mitogen) or (original.stat.mtime|int == copied.stat.mtime|int) #- (not is_mitogen) or (original.stat.mtime|int == copied.stat.mtime|int)
fail_msg: original={{original}} copied={{copied}} fail_msg: |
original={{ original }}
copied={{ copied }}

@ -18,7 +18,8 @@
- out.result[0].method == "ssh" - out.result[0].method == "ssh"
- out.result[0].kwargs.username == "joe" - out.result[0].kwargs.username == "joe"
- out.result|length == 1 # no sudo - out.result|length == 1 # no sudo
fail_msg: out={{out}} fail_msg: |
out={{ out }}
# Now try with a different account. # Now try with a different account.
@ -34,7 +35,8 @@
- out.result[1].method == "sudo" - out.result[1].method == "sudo"
- out.result[1].kwargs.username == "james" - out.result[1].kwargs.username == "james"
- out.result|length == 2 # no sudo - out.result|length == 2 # no sudo
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- become_same_user - become_same_user
- mitogen_only - mitogen_only

@ -29,7 +29,8 @@
that: that:
- out.rc == 4 - out.rc == 4
- "'Mitogen was disconnected from the remote environment while a call was in-progress.' in out.stdout" - "'Mitogen was disconnected from the remote environment while a call was in-progress.' in out.stdout"
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- disconnect - disconnect
- disconnect_during_module - disconnect_during_module

@ -16,6 +16,7 @@
- out.result[0] == 0 - out.result[0] == 0
- out.result[1].decode() == "hello, world\r\n" - out.result[1].decode() == "hello, world\r\n"
- out.result[2].decode().startswith("Shared connection to ") - out.result[2].decode().startswith("Shared connection to ")
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- exec_command - exec_command

@ -44,7 +44,11 @@
# sudo PID has changed. # sudo PID has changed.
- out_become.ppid != out_become2.ppid - out_become.ppid != out_become2.ppid
fail_msg: out={{out}} out2={{out2}} out_become={{out_become}} out_become2={{out_become2}} fail_msg: |
out={{ out }}
out2={{ out2 }}
out_become={{ out_become }}
out_become2={{ out_become2 }}
tags: tags:
- mitogen_only - mitogen_only
- reset - reset

@ -27,7 +27,9 @@
assert: assert:
that: that:
- become_acct.pid != login_acct.pid - become_acct.pid != login_acct.pid
fail_msg: become_acct={{become_acct}} login_acct={{login_acct}} fail_msg: |
become_acct={{ become_acct }}
login_acct={{ login_acct }}
- name: reset the connection - name: reset the connection
meta: reset_connection meta: reset_connection
@ -40,7 +42,9 @@
assert: assert:
that: that:
- become_acct.pid != new_become_acct.pid - become_acct.pid != new_become_acct.pid
fail_msg: become_acct={{become_acct}} new_become_acct={{new_become_acct}} fail_msg: |
become_acct={{ become_acct }}
new_become_acct={{ new_become_acct }}
- name: save new pid of login acct - name: save new pid of login acct
become: false become: false
@ -51,6 +55,8 @@
assert: assert:
that: that:
- login_acct.pid != new_login_acct.pid - login_acct.pid != new_login_acct.pid
fail_msg: login_acct={{login_acct}} new_login_acct={{new_login_acct}} fail_msg: |
login_acct={{ login_acct }}
new_login_acct={{ new_login_acct }}
tags: tags:
- reset_become - reset_become

@ -11,7 +11,8 @@
- assert: - assert:
that: (not not out.mitogen_loaded) == (not not is_mitogen) that: (not not out.mitogen_loaded) == (not not is_mitogen)
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- local - local
- local_blemished - local_blemished

@ -14,7 +14,8 @@
- assert: - assert:
that: not out.mitogen_loaded that: not out.mitogen_loaded
fail_msg: out={{out}} fail_msg: |
out={{ out }}
when: False when: False
tags: tags:
- paramiko - paramiko

@ -11,7 +11,8 @@
- assert: - assert:
that: (not not out.mitogen_loaded) == (not not is_mitogen) that: (not not out.mitogen_loaded) == (not not is_mitogen)
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- ssh - ssh
- ssh_blemished - ssh_blemished

@ -31,6 +31,8 @@
- assert: - assert:
that: that:
- old_become_env.pid != new_become_env.pid - old_become_env.pid != new_become_env.pid
fail_msg: old_become_env={{old_become_env}} new_become_env={{new_become_env}} fail_msg: |
old_become_env={{ old_become_env }}
new_become_env={{ new_become_env }}
tags: tags:
- reconnection - reconnection

@ -17,7 +17,8 @@
- assert: - assert:
that: that:
- out.stdout is match('.*python([0-9.]+)?\(mitogen:[a-z]+@[^:]+:[0-9]+\)') - out.stdout is match('.*python([0-9.]+)?\(mitogen:[a-z]+@[^:]+:[0-9]+\)')
fail_msg: out={{out}} fail_msg: |
out={{ out }}
- name: Get cmdline, with mitogen_mask_remote_name - name: Get cmdline, with mitogen_mask_remote_name
shell: 'cat /proc/$PPID/cmdline | tr \\0 \\n' shell: 'cat /proc/$PPID/cmdline | tr \\0 \\n'
@ -29,7 +30,8 @@
- assert: - assert:
that: that:
- out.stdout is match('.*python([0-9.]+)?\(mitogen:ansible\)') - out.stdout is match('.*python([0-9.]+)?\(mitogen:ansible\)')
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only
- remote_name - remote_name

@ -46,7 +46,8 @@
- out.failed - out.failed
- '"Name or service not known" in out.msg or - '"Name or service not known" in out.msg or
"Temporary failure in name resolution" in out.msg' "Temporary failure in name resolution" in out.msg'
fail_msg: out={{out}} fail_msg: |
out={{ out }}
when: when:
- ansible_facts.virtualization_type == "docker" - ansible_facts.virtualization_type == "docker"
- ansible_facts.python.version_info[:2] >= [2, 5] - ansible_facts.python.version_info[:2] >= [2, 5]

@ -135,7 +135,8 @@
assert: assert:
that: that:
- legacy.deprecations | default([]) | length > 0 - legacy.deprecations | default([]) | length > 0
fail_msg: legacy={{legacy}} fail_msg: |
legacy={{ legacy }}
# only check for a dep warning if legacy returned /usr/bin/python and auto didn't # only check for a dep warning if legacy returned /usr/bin/python and auto didn't
when: when:
- legacy.ansible_facts.discovered_interpreter_python == '/usr/bin/python' - legacy.ansible_facts.discovered_interpreter_python == '/usr/bin/python'
@ -146,7 +147,8 @@
assert: assert:
that: that:
- legacy.warnings | default([]) | length > 0 - legacy.warnings | default([]) | length > 0
fail_msg: legacy={{legacy}} fail_msg: |
legacy={{ legacy }}
# only check for a warning if legacy returned /usr/bin/python and auto didn't # only check for a warning if legacy returned /usr/bin/python and auto didn't
when: when:
- legacy.ansible_facts.discovered_interpreter_python == '/usr/bin/python' - legacy.ansible_facts.discovered_interpreter_python == '/usr/bin/python'
@ -168,7 +170,8 @@
that: that:
- auto_silent_out.warnings is not defined - auto_silent_out.warnings is not defined
- auto_silent_out.ansible_facts.discovered_interpreter_python == auto_out.ansible_facts.discovered_interpreter_python - auto_silent_out.ansible_facts.discovered_interpreter_python == auto_out.ansible_facts.discovered_interpreter_python
fail_msg: auto_silent_out={{auto_silent_out}} fail_msg: |
auto_silent_out={{ auto_silent_out }}
- name: test that auto_legacy_silent never warns and got the same answer as auto_legacy - name: test that auto_legacy_silent never warns and got the same answer as auto_legacy
@ -186,7 +189,8 @@
that: that:
- legacy_silent.warnings is not defined - legacy_silent.warnings is not defined
- legacy_silent.ansible_facts.discovered_interpreter_python == legacy.ansible_facts.discovered_interpreter_python - legacy_silent.ansible_facts.discovered_interpreter_python == legacy.ansible_facts.discovered_interpreter_python
fail_msg: legacy_silent={{legacy_silent}} fail_msg: |
legacy_silent={{ legacy_silent }}
- name: ensure modules can't set discovered_interpreter_X or ansible_X_interpreter - name: ensure modules can't set discovered_interpreter_X or ansible_X_interpreter
block: block:
@ -212,7 +216,7 @@
assert: assert:
that: that:
- auto_out.ansible_facts.discovered_interpreter_python == discovered_interpreter_expected - auto_out.ansible_facts.discovered_interpreter_python == discovered_interpreter_expected
fail_msg: >- fail_msg: |
distro={{ distro }} distro={{ distro }}
distro_major= {{ distro_major }} distro_major= {{ distro_major }}
system={{ system }} system={{ system }}

@ -19,6 +19,7 @@
- assert: - assert:
that: stat.stat.exists that: stat.stat.exists
fail_msg: stat={{stat}} fail_msg: |
stat={{ stat }}
tags: tags:
- cwd_prseserved - cwd_prseserved

@ -12,6 +12,7 @@
that: that:
- out.external1_path == "ansible/integration/module_utils/module_utils/external1.py" - out.external1_path == "ansible/integration/module_utils/module_utils/external1.py"
- out.external2_path == "ansible/lib/module_utils/external2.py" - out.external2_path == "ansible/lib/module_utils/external2.py"
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- adjacent_to_playbook - adjacent_to_playbook

@ -11,6 +11,7 @@
that: that:
- out.external1_path == "ansible/lib/module_utils/external1.py" - out.external1_path == "ansible/lib/module_utils/external1.py"
- out.external2_path == "ansible/lib/module_utils/external2.py" - out.external2_path == "ansible/lib/module_utils/external2.py"
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- from_config_path - from_config_path

@ -10,6 +10,7 @@
- assert: - assert:
that: that:
- out.extmod_path == "ansible/lib/module_utils/externalpkg/extmod.py" - out.extmod_path == "ansible/lib/module_utils/externalpkg/extmod.py"
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- from_config_path - from_config_path

@ -7,4 +7,5 @@
that: that:
- out.external3_path == "integration/module_utils/roles/modrole/module_utils/external3.py" - out.external3_path == "integration/module_utils/roles/modrole/module_utils/external3.py"
- out.external2_path == "integration/module_utils/roles/modrole/module_utils/external2.py" - out.external2_path == "integration/module_utils/roles/modrole/module_utils/external2.py"
fail_msg: out={{out}} fail_msg: |
out={{ out }}

@ -6,4 +6,5 @@
- assert: - assert:
that: that:
- out.path == "ansible/integration/module_utils/roles/override_modrole/module_utils/known_hosts.py" - out.path == "ansible/integration/module_utils/roles/override_modrole/module_utils/known_hosts.py"
fail_msg: out={{out}} fail_msg: |
out={{ out }}

@ -13,7 +13,8 @@
- assert: - assert:
that: "out.stdout == ''" that: "out.stdout == ''"
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- become_flags - become_flags
@ -29,6 +30,7 @@
- assert: - assert:
that: "out2.stdout == '2'" that: "out2.stdout == '2'"
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- become_flags - become_flags

@ -11,6 +11,7 @@
- assert: - assert:
that: "result.stdout == '123'" that: "result.stdout == '123'"
fail_msg: result={{result}} fail_msg: |
result={{ result }}
tags: tags:
- environment - environment

@ -12,7 +12,8 @@
- assert: - assert:
that: echo.stdout == "" that: echo.stdout == ""
fail_msg: echo={{echo}} fail_msg: |
echo={{ echo }}
- name: Create /etc/environment - name: Create /etc/environment
copy: copy:
@ -32,7 +33,8 @@
- assert: - assert:
that: echo.stdout == "555" that: echo.stdout == "555"
fail_msg: echo={{echo}} fail_msg: |
echo={{ echo }}
- name: Cleanup /etc/environment - name: Cleanup /etc/environment
file: file:
@ -51,4 +53,5 @@
- assert: - assert:
that: echo.stdout == "" that: echo.stdout == ""
fail_msg: echo={{echo}} fail_msg: |
echo={{ echo }}

@ -10,7 +10,8 @@
- assert: - assert:
that: echo.stdout == "" that: echo.stdout == ""
fail_msg: echo={{echo}} fail_msg: |
echo={{ echo }}
- name: Copy pam_environment - name: Copy pam_environment
copy: copy:
@ -23,7 +24,8 @@
- assert: - assert:
that: echo.stdout == "321" that: echo.stdout == "321"
fail_msg: echo={{echo}} fail_msg: |
echo={{ echo }}
- name: Cleanup pam_environment - name: Cleanup pam_environment
file: file:
@ -35,4 +37,5 @@
- assert: - assert:
that: echo.stdout == "" that: echo.stdout == ""
fail_msg: echo={{echo}} fail_msg: |
echo={{ echo }}

@ -25,6 +25,7 @@
- assert: - assert:
that: that:
- not out.stat.exists - not out.stat.exists
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- atexit - atexit

@ -16,6 +16,7 @@
out.results[0].item == '1' and out.results[0].item == '1' and
out.results[0].rc == 0 and out.results[0].rc == 0 and
(out.results[0].stdout == ansible_nodename) (out.results[0].stdout == ansible_nodename)
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- builtin_command_module - builtin_command_module

@ -22,6 +22,7 @@
- (out.module_stdout == "" and out.module_stderr is search(tb_pattern)) - (out.module_stdout == "" and out.module_stderr is search(tb_pattern))
or or
(out.module_stdout is search(tb_pattern) and out.module_stderr is match("Shared connection to localhost closed.")) (out.module_stdout is search(tb_pattern) and out.module_stderr is match("Shared connection to localhost closed."))
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- crashy_new_style_module - crashy_new_style_module

@ -22,6 +22,7 @@
(not out.results[0].changed) and (not out.results[0].changed) and
out.results[0].msg == 'Here is my input' and out.results[0].msg == 'Here is my input' and
out.results[0].run_via_env == "yes" out.results[0].run_via_env == "yes"
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- custom_bash_hashbang_argument - custom_bash_hashbang_argument

@ -12,6 +12,7 @@
(not out.changed) and (not out.changed) and
(not out.results[0].changed) and (not out.results[0].changed) and
out.results[0].msg == 'Here is my input' out.results[0].msg == 'Here is my input'
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- custom_bash_old_style_module - custom_bash_old_style_module

@ -11,6 +11,7 @@
(not out.changed) and (not out.changed) and
(not out.results[0].changed) and (not out.results[0].changed) and
out.results[0].msg == 'Here is my input' out.results[0].msg == 'Here is my input'
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- custom_bash_want_json_module - custom_bash_want_json_module

@ -23,6 +23,7 @@
out.changed and out.changed and
out.results[0].changed and out.results[0].changed and
out.results[0].msg == 'Hello, world.' out.results[0].msg == 'Hello, world.'
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- custom_binary_producing_json - custom_binary_producing_json

@ -31,6 +31,7 @@
- out.results[0].failed - out.results[0].failed
- out.results[0].msg.startswith('MODULE FAILURE') - out.results[0].msg.startswith('MODULE FAILURE')
- out.results[0].rc == 0 - out.results[0].rc == 0
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- custom_binary_producing_junk - custom_binary_producing_junk

@ -28,7 +28,8 @@
'custom_binary_single_null: cannot execute binary file: Exec format error\r\n', 'custom_binary_single_null: cannot execute binary file: Exec format error\r\n',
)) ))
or (ansible_facts.distribution == 'Ubuntu' and ansible_facts.distribution_version == '16.04') or (ansible_facts.distribution == 'Ubuntu' and ansible_facts.distribution_version == '16.04')
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- custom_binary_single_null - custom_binary_single_null

@ -10,13 +10,15 @@
that: that:
- out.results[0].input.foo - out.results[0].input.foo
- out.results[0].message == 'I am a perl script! Here is my input.' - out.results[0].message == 'I am a perl script! Here is my input.'
fail_msg: out={{out}} fail_msg: |
out={{ out }}
- assert: - assert:
that: that:
- (not out.changed) - (not out.changed)
- (not out.results[0].changed) - (not out.results[0].changed)
fail_msg: out={{out}} fail_msg: |
out={{ out }}
when: when:
- ansible_version.full is version('2.4', '>=', strict=True) - ansible_version.full is version('2.4', '>=', strict=True)
tags: tags:

@ -10,13 +10,15 @@
that: that:
- out.results[0].input.foo - out.results[0].input.foo
- out.results[0].message == 'I am a want JSON perl script! Here is my input.' - out.results[0].message == 'I am a want JSON perl script! Here is my input.'
fail_msg: out={{out}} fail_msg: |
out={{ out }}
- assert: - assert:
that: that:
- (not out.changed) - (not out.changed)
- (not out.results[0].changed) - (not out.results[0].changed)
fail_msg: out={{out}} fail_msg: |
out={{ out }}
when: when:
- ansible_version.full is version('2.4', '>=', strict=True) - ansible_version.full is version('2.4', '>=', strict=True)
tags: tags:

@ -12,6 +12,7 @@
(not out.results[0].changed) and (not out.results[0].changed) and
out.results[0].input[0].foo and out.results[0].input[0].foo and
out.results[0].msg == 'Here is my input' out.results[0].msg == 'Here is my input'
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- custom_python_json_args_module - custom_python_json_args_module

@ -18,7 +18,8 @@
# Random breaking interface change since 2.7.x # Random breaking interface change since 2.7.x
#- "out.results[0].input[0].ANSIBLE_MODULE_ARGS.foo" #- "out.results[0].input[0].ANSIBLE_MODULE_ARGS.foo"
- "out.results[0].msg == 'Here is my input'" - "out.results[0].msg == 'Here is my input'"
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- custom_python_new_style_module - custom_python_new_style_module
- mitogen_only - mitogen_only

@ -17,7 +17,8 @@
# Random breaking interface change since 2.7.x # Random breaking interface change since 2.7.x
#- "out.results[0].input[0].ANSIBLE_MODULE_ARGS.foo" #- "out.results[0].input[0].ANSIBLE_MODULE_ARGS.foo"
- "out.results[0].msg == 'Here is my input'" - "out.results[0].msg == 'Here is my input'"
fail_msg: out={{out}} fail_msg: |
out={{ out }}
# Verify sys.argv is not Unicode. # Verify sys.argv is not Unicode.
- custom_python_detect_environment: - custom_python_detect_environment:
@ -26,7 +27,8 @@
- assert: - assert:
that: that:
- out.argv_types_correct - out.argv_types_correct
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- custom_python_new_style_module - custom_python_new_style_module
- mitogen_only - mitogen_only

@ -14,7 +14,8 @@
- assert: - assert:
that: out.ok that: out.ok
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- custom_python_prehistoric_module - custom_python_prehistoric_module
- mitogen_only - mitogen_only

@ -12,6 +12,7 @@
(not out.results[0].changed) and (not out.results[0].changed) and
out.results[0].input[0].foo and out.results[0].input[0].foo and
out.results[0].msg == 'Here is my input' out.results[0].msg == 'Here is my input'
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- custom_python_want_json_module - custom_python_want_json_module

@ -14,6 +14,7 @@
(not out.changed) and (not out.changed) and
(not out.results[0].changed) and (not out.results[0].changed) and
out.results[0].msg == 'Here is my input' out.results[0].msg == 'Here is my input'
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- custom_script_interpreter - custom_script_interpreter

@ -9,7 +9,8 @@
register: out register: out
- assert: - assert:
that: not out.env.evil_key is defined that: not out.env.evil_key is defined
fail_msg: out={{out}} fail_msg: |
out={{ out }}
- name: Verify custom env setting is cleared, with evil_key - name: Verify custom env setting is cleared, with evil_key
shell: echo 'hi' shell: echo 'hi'
environment: environment:
@ -19,14 +20,16 @@
register: out register: out
- assert: - assert:
that: not out.env.evil_key is defined that: not out.env.evil_key is defined
fail_msg: out={{out}} fail_msg: |
out={{ out }}
- name: Verify non-explicit module env mutations are cleared, control - name: Verify non-explicit module env mutations are cleared, control
custom_python_detect_environment: custom_python_detect_environment:
register: out register: out
- assert: - assert:
that: not out.env.evil_key is defined that: not out.env.evil_key is defined
fail_msg: out={{out}} fail_msg: |
out={{ out }}
- name: Verify non-explicit module env mutations are cleared, mutate evil_key - name: Verify non-explicit module env mutations are cleared, mutate evil_key
custom_python_modify_environ: custom_python_modify_environ:
key: evil_key key: evil_key
@ -36,6 +39,7 @@
register: out register: out
- assert: - assert:
that: not out.env.evil_key is defined that: not out.env.evil_key is defined
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- environment_isolation - environment_isolation

@ -25,7 +25,10 @@
that: that:
- fork_proc1.pid != sync_proc1.pid - fork_proc1.pid != sync_proc1.pid
- fork_proc1.pid != fork_proc2.pid - fork_proc1.pid != fork_proc2.pid
fail_msg: fork_proc1={{fork_proc1}} sync_proc1={{sync_proc1}} fork_proc2={{fork_proc2}} fail_msg: |
fork_proc1={{ fork_proc1 }}
sync_proc1={{ sync_proc1 }}
fork_proc2={{ fork_proc2 }}
tags: tags:
- forking_active - forking_active

@ -29,17 +29,23 @@
- assert: - assert:
that: that:
- fork_proc.pid != regular_proc.pid - fork_proc.pid != regular_proc.pid
fail_msg: fork_proc={{fork_proc}} regular_proc={{regular_proc}} fail_msg: |
fork_proc={{ fork_proc }}
regular_proc={{ regular_proc }}
- assert: - assert:
that: fork_proc.ppid != regular_proc.pid that: fork_proc.ppid != regular_proc.pid
fail_msg: fork_proc={{fork_proc}} regular_proc={{regular_proc}} fail_msg: |
fork_proc={{ fork_proc }}
regular_proc={{ regular_proc }}
when: when:
- forkmode.uses_fork - forkmode.uses_fork
- assert: - assert:
that: fork_proc.ppid == regular_proc.pid that: fork_proc.ppid == regular_proc.pid
fail_msg: fork_proc={{fork_proc}} regular_proc={{regular_proc}} fail_msg: |
fork_proc={{ fork_proc }}
regular_proc={{ regular_proc }}
when: when:
- not forkmode.uses_fork - not forkmode.uses_fork

@ -16,7 +16,9 @@
- assert: - assert:
that: that:
- sync_proc1.pid == sync_proc2.pid - sync_proc1.pid == sync_proc2.pid
fail_msg: sync_proc1={{sync_proc1}} sync_proc2={{sync_proc2}} fail_msg: |
sync_proc1={{ sync_proc1 }}
sync_proc2={{ sync_proc2 }}
tags: tags:
- forking_inactive - forking_inactive

@ -23,7 +23,8 @@
- assert: - assert:
that: | that: |
'The module missing_module was not found in configured module paths' in out.stdout 'The module missing_module was not found in configured module paths' in out.stdout
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- local - local
- missing_module - missing_module

@ -16,7 +16,8 @@
out.result[0].kwargs.identity_file == ( out.result[0].kwargs.identity_file == (
lookup('env', 'HOME') + '/fakekey' lookup('env', 'HOME') + '/fakekey'
) )
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- config - config
- mitogen_only - mitogen_only

@ -31,7 +31,8 @@
- assert: - assert:
that: that:
- ssh_no_password_result.unreachable == True - ssh_no_password_result.unreachable == True
fail_msg: ssh_no_password_result={{ ssh_no_password_result }} fail_msg: |
ssh_no_password_result={{ ssh_no_password_result }}
- meta: reset_connection - meta: reset_connection
- name: ansible_ssh_pass should override ansible_password - name: ansible_ssh_pass should override ansible_password
@ -63,4 +64,5 @@
- assert: - assert:
that: that:
- ssh_wrong_password_result.unreachable == True - ssh_wrong_password_result.unreachable == True
fail_msg: ssh_wrong_password_result={{ ssh_wrong_password_result }} fail_msg: |
ssh_wrong_password_result={{ ssh_wrong_password_result }}

@ -40,7 +40,8 @@
'"unreachable": true' in out.stdout '"unreachable": true' in out.stdout
- | - |
'"msg": "Connection timed out."' in out.stdout '"msg": "Connection timed out."' in out.stdout
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only
- timeouts - timeouts

@ -57,6 +57,7 @@
- assert: - assert:
that: that:
- out.rc == 4 # ansible.executor.task_queue_manager.TaskQueueManager.RUN_UNREACHABLE_HOSTS - out.rc == 4 # ansible.executor.task_queue_manager.TaskQueueManager.RUN_UNREACHABLE_HOSTS
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only

@ -10,12 +10,14 @@
register: out register: out
- assert: - assert:
that: out.mitogen_loaded that: out.mitogen_loaded
fail_msg: out={{out}} fail_msg: |
out={{ out }}
- determine_strategy: - determine_strategy:
- assert: - assert:
that: strategy == 'ansible.plugins.strategy.mitogen_linear.StrategyModule' that: strategy == 'ansible.plugins.strategy.mitogen_linear.StrategyModule'
fail_msg: strategy={{strategy}} fail_msg: |
strategy={{ strategy }}
tags: tags:
- mitogen_linear - mitogen_linear
@ -27,12 +29,14 @@
register: out register: out
- assert: - assert:
that: not out.mitogen_loaded that: not out.mitogen_loaded
fail_msg: out={{out}} fail_msg: |
out={{ out }}
- determine_strategy: - determine_strategy:
- assert: - assert:
that: strategy == 'ansible.plugins.strategy.linear.StrategyModule' that: strategy == 'ansible.plugins.strategy.linear.StrategyModule'
fail_msg: strategy={{strategy}} fail_msg: |
strategy={{ strategy }}
tags: tags:
- linear - linear
@ -44,11 +48,13 @@
register: out register: out
- assert: - assert:
that: out.mitogen_loaded that: out.mitogen_loaded
fail_msg: out={{out}} fail_msg: |
out={{ out }}
- determine_strategy: - determine_strategy:
- assert: - assert:
that: strategy == 'ansible.plugins.strategy.mitogen_linear.StrategyModule' that: strategy == 'ansible.plugins.strategy.mitogen_linear.StrategyModule'
fail_msg: strategy={{strategy}} fail_msg: |
strategy={{ strategy }}
tags: tags:
- mitogen_linear - mitogen_linear

@ -9,12 +9,14 @@
register: out register: out
- assert: - assert:
that: not out.mitogen_loaded that: not out.mitogen_loaded
fail_msg: out={{out}} fail_msg: |
out={{ out }}
- determine_strategy: - determine_strategy:
- assert: - assert:
that: strategy == 'ansible.plugins.strategy.linear.StrategyModule' that: strategy == 'ansible.plugins.strategy.linear.StrategyModule'
fail_msg: strategy={{strategy}} fail_msg: |
strategy={{ strategy }}
tags: tags:
- linear - linear
@ -26,12 +28,14 @@
register: out register: out
- assert: - assert:
that: out.mitogen_loaded that: out.mitogen_loaded
fail_msg: out={{out}} fail_msg: |
out={{ out }}
- determine_strategy: - determine_strategy:
- assert: - assert:
that: strategy == 'ansible.plugins.strategy.mitogen_linear.StrategyModule' that: strategy == 'ansible.plugins.strategy.mitogen_linear.StrategyModule'
fail_msg: strategy={{strategy}} fail_msg: |
strategy={{ strategy }}
tags: tags:
- mitogen_linear - mitogen_linear
@ -43,11 +47,13 @@
register: out register: out
- assert: - assert:
that: not out.mitogen_loaded that: not out.mitogen_loaded
fail_msg: out={{out}} fail_msg: |
out={{ out }}
- determine_strategy: - determine_strategy:
- assert: - assert:
that: strategy == 'ansible.plugins.strategy.linear.StrategyModule' that: strategy == 'ansible.plugins.strategy.linear.StrategyModule'
fail_msg: strategy={{strategy}} fail_msg: |
strategy={{ strategy }}
tags: tags:
- linear - linear

@ -18,7 +18,8 @@
- assert: - assert:
that: that:
- out.env.THIS_IS_STUB_KUBECTL == '1' - out.env.THIS_IS_STUB_KUBECTL == '1'
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- kubectl - kubectl
- mitogen_only - mitogen_only

@ -14,7 +14,8 @@
- assert: - assert:
that: that:
- out.env.THIS_IS_STUB_LXC_ATTACH == '1' - out.env.THIS_IS_STUB_LXC_ATTACH == '1'
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- lxc - lxc
- mitogen_only - mitogen_only

@ -14,7 +14,8 @@
- assert: - assert:
that: that:
- out.env.THIS_IS_STUB_LXC == '1' - out.env.THIS_IS_STUB_LXC == '1'
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- lxd - lxd
- mitogen_only - mitogen_only

@ -17,7 +17,8 @@
that: that:
- out.env.THIS_IS_STUB_DOAS == '1' - out.env.THIS_IS_STUB_DOAS == '1'
- (out.env.ORIGINAL_ARGV|from_json)[1:3] == ['-u', 'someuser'] - (out.env.ORIGINAL_ARGV|from_json)[1:3] == ['-u', 'someuser']
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_doas - mitogen_doas
- mitogen_only - mitogen_only

@ -15,7 +15,8 @@
- assert: - assert:
that: out.env.THIS_IS_STUB_SUDO == '1' that: out.env.THIS_IS_STUB_SUDO == '1'
fail_msg: out={{out}} fail_msg: |
out={{ out }}
- assert_equal: - assert_equal:
left: (out.env.ORIGINAL_ARGV|from_json)[1:9] left: (out.env.ORIGINAL_ARGV|from_json)[1:9]

@ -32,7 +32,8 @@
- assert: - assert:
that: result.rc == 0 that: result.rc == 0
fail_msg: result={{result}} fail_msg: |
result={{ result }}
tags: tags:
- stns_lxc - stns_lxc
- mitogen_only - mitogen_only

@ -32,7 +32,8 @@
- assert: - assert:
that: result.rc == 0 that: result.rc == 0
fail_msg: result={{result}} fail_msg: |
result={{ result }}
tags: tags:
- mitogen_only - mitogen_only
- sens_lxd - sens_lxd

@ -74,7 +74,8 @@
register: _ register: _
- assert: { that: "'Python 3' in _.stdout" } - assert: { that: "'Python 3' in _.stdout" }
fail_msg: _={{_}} fail_msg: |
_={{ _ }}
- debug: var=_.stdout,_.stderr - debug: var=_.stdout,_.stderr
run_once: yes run_once: yes
@ -84,7 +85,8 @@
register: _ register: _
- assert: { that: "'Python 2' in _.stderr" } - assert: { that: "'Python 2' in _.stderr" }
fail_msg: _={{_}} fail_msg: |
_={{ _ }}
- debug: var=_.stdout,_.stderr - debug: var=_.stdout,_.stderr
run_once: yes run_once: yes
@ -117,7 +119,8 @@
- assert: - assert:
that: "'Python 3' in _.stdout" that: "'Python 3' in _.stdout"
fail_msg: _={{_}} fail_msg: |
_={{ _ }}
- debug: var=_.stdout,_.stderr - debug: var=_.stdout,_.stderr
run_once: yes run_once: yes
@ -128,7 +131,8 @@
- assert: - assert:
that: "'Python 2' in _.stderr" that: "'Python 2' in _.stderr"
fail_msg: _={{_}} fail_msg: |
_={{ _ }}
- debug: var=_.stdout,_.stderr - debug: var=_.stdout,_.stderr
run_once: yes run_once: yes

@ -12,7 +12,8 @@
- out.result|length == 1 - out.result|length == 1
- out.result[0].method == "ssh" - out.result[0].method == "ssh"
- out.result[0].kwargs.username == "ansible-cfg-remote-user" - out.result[0].kwargs.username == "ansible-cfg-remote-user"
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only
@ -32,7 +33,8 @@
- out.result[2].method == "ssh" - out.result[2].method == "ssh"
- out.result[2].kwargs.hostname == "tc-become-unset" - out.result[2].kwargs.hostname == "tc-become-unset"
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only
@ -52,7 +54,8 @@
- out.result[0].kwargs.username == "ansible-cfg-remote-user" - out.result[0].kwargs.username == "ansible-cfg-remote-user"
- out.result[1].method == "sudo" - out.result[1].method == "sudo"
- out.result[1].kwargs.username == "becomeuser" - out.result[1].kwargs.username == "becomeuser"
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only
@ -75,6 +78,7 @@
- out.result[2].method == "sudo" - out.result[2].method == "sudo"
- out.result[2].kwargs.username == "becomeuser" - out.result[2].kwargs.username == "becomeuser"
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only

@ -13,7 +13,8 @@
- out.result|length == 2 - out.result|length == 2
- out.result[0].method == "ssh" - out.result[0].method == "ssh"
- out.result[1].method == "sudo" - out.result[1].method == "sudo"
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only
@ -30,7 +31,8 @@
- out.result[1].kwargs.username == "becomeuser" - out.result[1].kwargs.username == "becomeuser"
- out.result[2].method == "ssh" - out.result[2].method == "ssh"
- out.result[2].kwargs.hostname == "tc-become-method-unset" - out.result[2].kwargs.hostname == "tc-become-method-unset"
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only
@ -48,7 +50,8 @@
- out.result[0].method == "ssh" - out.result[0].method == "ssh"
- out.result[1].method == "su" - out.result[1].method == "su"
- out.result[1].kwargs.username == "becomeuser" - out.result[1].kwargs.username == "becomeuser"
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only
@ -70,7 +73,8 @@
- out.result[2].method == "su" - out.result[2].method == "su"
- out.result[2].kwargs.username == "becomeuser" - out.result[2].kwargs.username == "becomeuser"
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only
@ -93,6 +97,7 @@
- out.result[2].method == "ssh" - out.result[2].method == "ssh"
- out.result[2].kwargs.hostname == "tc-become-method-unset" - out.result[2].kwargs.hostname == "tc-become-method-unset"
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only

@ -14,7 +14,8 @@
- out.result[0].method == "ssh" - out.result[0].method == "ssh"
- out.result[1].method == "sudo" - out.result[1].method == "sudo"
- out.result[1].kwargs.password == None - out.result[1].kwargs.password == None
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only
@ -32,7 +33,8 @@
- out.result[1].method == "ssh" - out.result[1].method == "ssh"
- out.result[2].method == "sudo" - out.result[2].method == "sudo"
- out.result[2].kwargs.password == None - out.result[2].kwargs.password == None
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only
@ -52,7 +54,8 @@
- out.result[2].method == "ssh" - out.result[2].method == "ssh"
- out.result[3].method == "sudo" - out.result[3].method == "sudo"
- out.result[3].kwargs.password == None - out.result[3].kwargs.password == None
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only
@ -69,7 +72,8 @@
- out.result[0].method == "ssh" - out.result[0].method == "ssh"
- out.result[1].method == "sudo" - out.result[1].method == "sudo"
- out.result[1].kwargs.password == "apassword" - out.result[1].kwargs.password == "apassword"
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only
@ -90,7 +94,8 @@
- out.result[2].method == "ssh" - out.result[2].method == "ssh"
- out.result[3].method == "sudo" - out.result[3].method == "sudo"
- out.result[3].kwargs.password == "apassword" - out.result[3].kwargs.password == "apassword"
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only
@ -107,7 +112,8 @@
- out.result[0].method == "ssh" - out.result[0].method == "ssh"
- out.result[1].method == "sudo" - out.result[1].method == "sudo"
- out.result[1].kwargs.password == "apass" - out.result[1].kwargs.password == "apass"
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only
@ -128,7 +134,8 @@
- out.result[2].method == "ssh" - out.result[2].method == "ssh"
- out.result[3].method == "sudo" - out.result[3].method == "sudo"
- out.result[3].kwargs.password == "apass" - out.result[3].kwargs.password == "apass"
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only
@ -147,7 +154,8 @@
# Ansible >= 2.9.2 prioritises ansible_become_pass. # Ansible >= 2.9.2 prioritises ansible_become_pass.
# https://github.com/ansible/ansible/commit/480b106d6535978ae6ecab68b40942ca4fa914a0 # https://github.com/ansible/ansible/commit/480b106d6535978ae6ecab68b40942ca4fa914a0
- out.result[1].kwargs.password == "bpass" - out.result[1].kwargs.password == "bpass"
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only
@ -165,6 +173,7 @@
- out.result[1].method == "sudo" - out.result[1].method == "sudo"
- out.result[1].kwargs.password == "bpass" - out.result[1].kwargs.password == "bpass"
- out.result[2].method == "ssh" - out.result[2].method == "ssh"
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only

@ -14,7 +14,8 @@
- out.result[0].method == "ssh" - out.result[0].method == "ssh"
- out.result[1].method == "sudo" - out.result[1].method == "sudo"
- out.result[1].kwargs.username == "root" - out.result[1].kwargs.username == "root"
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only
@ -32,7 +33,8 @@
- out.result[1].method == "ssh" - out.result[1].method == "ssh"
- out.result[2].method == "sudo" - out.result[2].method == "sudo"
- out.result[2].kwargs.username == "root" - out.result[2].kwargs.username == "root"
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only
@ -52,7 +54,8 @@
- out.result[2].method == "ssh" - out.result[2].method == "ssh"
- out.result[3].method == "sudo" - out.result[3].method == "sudo"
- out.result[3].kwargs.username == "root" - out.result[3].kwargs.username == "root"
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only
@ -69,7 +72,8 @@
- out.result[0].method == "ssh" - out.result[0].method == "ssh"
- out.result[1].method == "sudo" - out.result[1].method == "sudo"
- out.result[1].kwargs.username == "ansi-become-user" - out.result[1].kwargs.username == "ansi-become-user"
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only
@ -92,7 +96,8 @@
- out.result[2].method == "sudo" - out.result[2].method == "sudo"
- out.result[2].kwargs.username == "ansi-become-user" - out.result[2].kwargs.username == "ansi-become-user"
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only
@ -118,7 +123,8 @@
- out.result[3].method == "sudo" - out.result[3].method == "sudo"
- out.result[3].kwargs.username == "ansi-become-user" - out.result[3].kwargs.username == "ansi-become-user"
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only

@ -10,7 +10,8 @@
- out.result | length == 1 - out.result | length == 1
- out.result[0].method == "ssh" - out.result[0].method == "ssh"
- out.result[0].kwargs.check_host_keys == "ignore" - out.result[0].kwargs.check_host_keys == "ignore"
fail_msg: out={{ out }} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only
@ -27,7 +28,8 @@
- out.result[0].kwargs.check_host_keys == "enforce" - out.result[0].kwargs.check_host_keys == "enforce"
- out.result[1].method == "ssh" - out.result[1].method == "ssh"
- out.result[1].kwargs.check_host_keys == "ignore" - out.result[1].kwargs.check_host_keys == "ignore"
fail_msg: out={{ out }} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only
@ -41,7 +43,8 @@
- out.result | length == 1 - out.result | length == 1
- out.result[0].method == "ssh" - out.result[0].method == "ssh"
- out.result[0].kwargs.check_host_keys == "enforce" - out.result[0].kwargs.check_host_keys == "enforce"
fail_msg: out={{ out }} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only
@ -58,7 +61,8 @@
- out.result[0].kwargs.check_host_keys == "ignore" - out.result[0].kwargs.check_host_keys == "ignore"
- out.result[1].method == "ssh" - out.result[1].method == "ssh"
- out.result[1].kwargs.check_host_keys == "enforce" - out.result[1].kwargs.check_host_keys == "enforce"
fail_msg: out={{ out }} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only
@ -72,7 +76,8 @@
- out.result | length == 1 - out.result | length == 1
- out.result[0].method == "ssh" - out.result[0].method == "ssh"
- out.result[0].kwargs.check_host_keys == "enforce" - out.result[0].kwargs.check_host_keys == "enforce"
fail_msg: out={{ out }} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only
@ -89,6 +94,7 @@
- out.result[0].kwargs.check_host_keys == "ignore" - out.result[0].kwargs.check_host_keys == "ignore"
- out.result[1].method == "ssh" - out.result[1].method == "ssh"
- out.result[1].kwargs.check_host_keys == "enforce" - out.result[1].kwargs.check_host_keys == "enforce"
fail_msg: out={{ out }} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only

@ -12,7 +12,8 @@
- out.result|length == 1 - out.result|length == 1
- out.result[0].method == "ssh" - out.result[0].method == "ssh"
- out.result[0].kwargs.port == None - out.result[0].kwargs.port == None
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only
@ -29,7 +30,8 @@
- out.result[0].kwargs.port == None - out.result[0].kwargs.port == None
- out.result[1].method == "ssh" - out.result[1].method == "ssh"
- out.result[1].kwargs.port == 4321 - out.result[1].kwargs.port == 4321
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only
@ -43,7 +45,8 @@
- out.result|length == 1 - out.result|length == 1
- out.result[0].method == "ssh" - out.result[0].method == "ssh"
- out.result[0].kwargs.port == 4321 - out.result[0].kwargs.port == 4321
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only
@ -59,7 +62,8 @@
- out.result[0].kwargs.port == 4321 - out.result[0].kwargs.port == 4321
- out.result[1].method == "ssh" - out.result[1].method == "ssh"
- out.result[1].kwargs.port == None - out.result[1].kwargs.port == None
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only
@ -73,7 +77,8 @@
- out.result|length == 1 - out.result|length == 1
- out.result[0].method == "ssh" - out.result[0].method == "ssh"
- out.result[0].kwargs.port == 1234 - out.result[0].kwargs.port == 1234
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only
@ -89,7 +94,8 @@
- out.result[0].kwargs.port == 1234 - out.result[0].kwargs.port == 1234
- out.result[1].method == "ssh" - out.result[1].method == "ssh"
- out.result[1].kwargs.port == None - out.result[1].kwargs.port == None
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only
@ -104,7 +110,8 @@
- out.result|length == 1 - out.result|length == 1
- out.result[0].method == "ssh" - out.result[0].method == "ssh"
- out.result[0].kwargs.port == 1532 - out.result[0].kwargs.port == 1532
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only
@ -120,6 +127,7 @@
- out.result[0].kwargs.port == 1532 - out.result[0].kwargs.port == 1532
- out.result[1].method == "ssh" - out.result[1].method == "ssh"
- out.result[1].kwargs.port == None - out.result[1].kwargs.port == None
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- mitogen_only - mitogen_only

@ -25,7 +25,8 @@
that: that:
- env.cwd == ansible_user_dir - env.cwd == ansible_user_dir
- (not env.mitogen_loaded) or (env.python_path.count("") == 1) - (not env.mitogen_loaded) or (env.python_path.count("") == 1)
fail_msg: env={{env}} fail_msg: |
env={{ env }}
- name: Run some new-style from ansible.module_utils... modules - name: Run some new-style from ansible.module_utils... modules
stat: stat:

@ -20,7 +20,8 @@
that: that:
- out.status == -1 - out.status == -1
- out.url == 'http://127.0.0.1:14321/post' - out.url == 'http://127.0.0.1:14321/post'
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- issue_113 - issue_113

@ -24,7 +24,8 @@
- assert: - assert:
that: that:
- out.env.CUSTOM_INTERPRETER == "1" - out.env.CUSTOM_INTERPRETER == "1"
fail_msg: out={{out}} fail_msg: |
out={{ out }}
- name: Cleanup /tmp/issue_152_interpreter.sh - name: Cleanup /tmp/issue_152_interpreter.sh
file: file:

@ -35,7 +35,8 @@
assert: assert:
that: that:
- out.sys_executable in expected_executables - out.sys_executable in expected_executables
fail_msg: out={{out}} fail_msg: |
out={{ out }}
when: when:
- lout.python.version.full is version('2.7', '>=', strict=True) - lout.python.version.full is version('2.7', '>=', strict=True)

@ -14,7 +14,8 @@
that: that:
- out.results[item|int].leak1 == ["David"] - out.results[item|int].leak1 == ["David"]
- out.results[item|int].leak2 == ["David"] - out.results[item|int].leak2 == ["David"]
fail_msg: out={{out}} fail_msg: |
out={{ out }}
with_sequence: start=0 end=3 with_sequence: start=0 end=3
tags: tags:
- issue_154 - issue_154

@ -16,6 +16,7 @@
- assert: - assert:
that: that:
- out.msg == 'file (/usr/bin/does-not-exist) is absent, cannot continue' - out.msg == 'file (/usr/bin/does-not-exist) is absent, cannot continue'
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- issue_332 - issue_332

@ -11,6 +11,7 @@
- assert: - assert:
that: that:
- "'id' in out.info" - "'id' in out.info"
fail_msg: out={{out}} fail_msg: |
out={{ out }}
tags: tags:
- issue_590 - issue_590

Loading…
Cancel
Save