1
0
Fork 0
mirror of https://github.com/containers/ansible-podman-collections.git synced 2026-02-04 07:11:49 +00:00

Prepare tests to use custom executable, part 6 (#478)

Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
This commit is contained in:
Sergey 2022-09-04 22:33:28 +03:00 committed by GitHub
parent 03f19dfe25
commit 31dbd55579
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View file

@ -11,7 +11,7 @@
shell: >-
{% if ansible_venv is defined %}source {{ ansible_venv }}/bin/activate; {% endif %}
{{ repo_dir }}/ci/run_connection_test.sh
{{ repo_dir }}/ci/run_connection_test.sh podman {{ test_executable | default('podman') }}
args:
chdir: "{{ repo_dir }}"
executable: /bin/bash

View file

@ -9,13 +9,17 @@ export LANGUAGE=en_US.UTF-8
CON_TYPE="${1:-podman}"
SUDO=${ROOT:+"sudo -E"}
PODMAN_EXE="${2:-podman}"
echo "Print current Podman version"
$PODMAN_EXE version
ANSIBLECMD=${ANSIBLECMD:-$(command -v ansible-playbook)}
echo "Testing $CON_TYPE connection ${ROOT:+'with root'}"
if [[ "$CON_TYPE" == "podman" ]]; then
${SUDO} podman ps | grep -q "${CON_TYPE}-container" || \
${SUDO} podman run -d --name "${CON_TYPE}-container" python:3-alpine sleep 1d
${SUDO} $PODMAN_EXE ps | grep -q "${CON_TYPE}-container" || \
${SUDO} $PODMAN_EXE run -d --name "${CON_TYPE}-container" python:3-alpine sleep 1d
elif [[ "$CON_TYPE" == "buildah" ]]; then
${SUDO} buildah from --name=buildah-container python:2
fi
@ -31,6 +35,7 @@ exit_code=0
CMD="${SUDO:-} ${ANSIBLECMD:-ansible-playbook} \
-i tests/integration/targets/connection_${CON_TYPE}/test_connection.inventory \
-e connection_type=containers.podman.${CON_TYPE} \
-e ansible_podman_executable=$PODMAN_EXE \
ci/playbooks/connections/test.yml"
$CMD -vv || exit_code=$?