1
0
Fork 0
mirror of https://github.com/containers/ansible-podman-collections.git synced 2026-02-04 07:11:49 +00:00
ansible-podman-collections/ci/run_containers_tests.sh
Sergey 2c88b822cf
Set localte in CI tests to en_US.UTF-8 (#450)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2022-07-14 11:35:47 +03:00

29 lines
828 B
Bash
Executable file

#!/bin/bash
set -o pipefail
set -ex
# New requirement from ansible-core 2.14
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
[[ -z "$TEST2RUN" || ! -f "ci/playbooks/containers/${TEST2RUN}.yml" ]] && {
echo "Please specify test to run, for example TEST2RUN=podman_container";
exit 1;
}
ANSIBLECMD=${ANSIBLECMD:-$(command -v ansible-playbook)}
echo "Testing ${TEST2RUN} module"
CURWD="$(readlink -f $(dirname ${BASH_SOURCE[0]}))"
exit_code=0
CMD="ANSIBLE_ROLES_PATH=${CURWD}/../tests/integration/targets \
${ANSIBLECMD:-ansible-playbook} \
-i localhost, -c local --diff \
ci/playbooks/containers/${TEST2RUN}.yml \
-e _ansible_python_interpreter=$(command -v python)"
bash -c "$CMD -vv" || exit_code=$?
if [[ "$exit_code" != 0 ]]; then
bash -c "$CMD -vvvvv --diff"
fi