tests: raft of fixes for vanilla Ansible

pull/193/head
David Wilson 7 years ago
parent b8908919b1
commit ef47347cdf

@ -28,7 +28,8 @@
- debug: msg={{raw}} - debug: msg={{raw}}
- name: Verify raw module output. - name: Verify raw module output.
assert: assert:
that: | that:
raw.rc == 0 and - raw.rc == 0
raw.stdout == "root\r\n" and # WHY DOES VANILLA ANSIBLE INSERT NEWLINES HERE!?!?!?!?!?!ONE
raw.stdout_lines == ["root"] - raw.stdout in ("\r\nroot\r\n", "root\r\n")
- raw.stdout_lines in (["", "root"], ["root"])

@ -20,4 +20,5 @@
- out.failed - out.failed
- | - |
('sudo: no such option: --derps' in out.msg) or ('sudo: no such option: --derps' in out.msg) or
("sudo: unrecognized option `--derps'" in out.module_stderr) ("sudo: unrecognized option `--derps'" in out.module_stderr) or
("sudo: unrecognized option '--derps'" in out.module_stderr)

@ -11,4 +11,4 @@
register: out register: out
- assert: - assert:
that: out.mitogen_loaded or not is_mitogen that: (not not out.mitogen_loaded) == (not not is_mitogen)

@ -11,4 +11,4 @@
register: out register: out
- assert: - assert:
that: out.mitogen_loaded or not is_mitogen that: (not not out.mitogen_loaded) == (not not is_mitogen)

@ -13,6 +13,7 @@
- name: Reset all connections - name: Reset all connections
mitogen_shutdown_all: mitogen_shutdown_all:
when: is_mitogen
- name: Spin up a bunch of interpreters - name: Spin up a bunch of interpreters
custom_python_detect_environment: custom_python_detect_environment:

@ -7,9 +7,9 @@ export MITOGEN_MAX_INTERPRETERS=3
if [ "${ANSIBLE_STRATEGY:0:7}" = "mitogen" ] if [ "${ANSIBLE_STRATEGY:0:7}" = "mitogen" ]
then then
extra="-e is_mitogen=1" EXTRA='{"is_mitogen": true}'
else else
extra="-e is_mitogen=0" EXTRA='{"is_mitogen": false}'
fi fi
exec ansible-playbook $extra "$@" exec ansible-playbook -e "$EXTRA" "$@"

Loading…
Cancel
Save