mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
700 B
Bash
21 lines
700 B
Bash
8 years ago
|
#!/usr/bin/env bash
|
||
|
|
||
|
set -eux
|
||
|
|
||
|
# we are looking to verify the callback for v2_retry_runner gets a correct task name, include
|
||
|
# if the value needs templating based on results of previous tasks
|
||
5 months ago
|
OUTFILE="callback_output_copy.out"
|
||
8 years ago
|
trap 'rm -rf "${OUTFILE}"' EXIT
|
||
|
|
||
5 months ago
|
# test task retry name
|
||
8 years ago
|
EXPECTED_REGEX="^.*TASK.*18236 callback task template fix OUTPUT 2"
|
||
5 months ago
|
ansible-playbook "$@" -i ../../inventory task_name.yml | tee "${OUTFILE}"
|
||
8 years ago
|
echo "Grepping for ${EXPECTED_REGEX} in stdout."
|
||
|
grep -e "${EXPECTED_REGEX}" "${OUTFILE}"
|
||
5 months ago
|
|
||
|
# test connection tracking
|
||
|
EXPECTED_CONNECTION='{"testhost":{"ssh":4}}'
|
||
|
OUTPUT_TAIL=$(tail -n5 ${OUTFILE} | tr -d '[:space:]')
|
||
|
[ "${EXPECTED_CONNECTION}" == "${OUTPUT_TAIL}" ]
|
||
|
echo $?
|