From 31dbd55579d9cedded197498c32806ec4e6d1207 Mon Sep 17 00:00:00 2001 From: Sergey <6213510+sshnaidm@users.noreply.github.com> Date: Sun, 4 Sep 2022 22:33:28 +0300 Subject: [PATCH] Prepare tests to use custom executable, part 6 (#478) Signed-off-by: Sagi Shnaidman --- ci/playbooks/connection_test.yml | 2 +- ci/run_connection_test.sh | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ci/playbooks/connection_test.yml b/ci/playbooks/connection_test.yml index 04d8149..013fed8 100644 --- a/ci/playbooks/connection_test.yml +++ b/ci/playbooks/connection_test.yml @@ -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 diff --git a/ci/run_connection_test.sh b/ci/run_connection_test.sh index 510d894..ecdeff6 100755 --- a/ci/run_connection_test.sh +++ b/ci/run_connection_test.sh @@ -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=$?