ansible/test/integration/targets/pause/runme.sh
Sam Doran 96c2375692
Add setup roles for passlib and pexpect for use with pause and vars_prompt tests (#43613)
* Add passlib to RHEL test instance

This looks like the only tests instance that is missing this libary. It is needed for vars_prompt tests.

* Create setup roles for pexect and passlib

Switch to using aliases rather than installing directly in the test scripts
2018-11-08 17:05:54 -05:00

28 lines
881 B
Bash
Executable file

#!/usr/bin/env bash
set -eux
# Test pause module when no tty and non-interactive. This is to prevent playbooks
# from hanging in cron and Tower jobs.
/usr/bin/env bash << EOF
ansible-playbook test-pause-no-tty.yml -i ../../inventory 2>&1 | \
grep '\[WARNING\]: Not waiting for response to prompt as stdin is not interactive' && {
echo 'Successfully skipped pause in no TTY mode' >&2
exit 0
} || {
echo 'Failed to skip pause module' >&2
exit 1
}
EOF
# Test redirecting stdout
# Issue #41717
ansible-playbook pause-3.yml -i ../../inventory > /dev/null \
&& echo "Successfully redirected stdout" \
|| echo "Failure when attempting to redirect stdout"
# Test pause with seconds and minutes specified
ansible-playbook test-pause.yml -i ../../inventory "$@"
# Interactively test pause
python test-pause.py -i ../../inventory "$@"