From 53e8b80ed36a9193627862427fa224ed38375d3a Mon Sep 17 00:00:00 2001 From: Martin Hiner Date: Mon, 21 Nov 2022 18:38:57 +0100 Subject: Add container engine option to scripts This patch add a way to choose container engine inside tool and test scripts. This is in preparation for Podman introduction but still leaves Docker as default container engine. Signed-off-by: Martin Hiner Change-Id: I395d2bdb0dfb4b325b6ad197c8893c8a0f768324 --- tests/test-masakari.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'tests/test-masakari.sh') diff --git a/tests/test-masakari.sh b/tests/test-masakari.sh index 42a1e26d3..81f0a6185 100755 --- a/tests/test-masakari.sh +++ b/tests/test-masakari.sh @@ -8,6 +8,7 @@ set -o pipefail export PYTHONUNBUFFERED=1 function test_hacluster_logged { + container_engine="${1:-docker}" local cluster_failure cluster_failure=0 @@ -17,17 +18,17 @@ function test_hacluster_logged { # var setting from the container which would cause these commands to log up # to 'trace' (likely a pacemaker bug) - if ! sudo docker exec hacluster_pacemaker cibadmin -VVVVVV --query --local; then + if ! sudo ${container_engine} exec hacluster_pacemaker cibadmin -VVVVVV --query --local; then cluster_failure=1 fi local mon_output - if ! mon_output=$(sudo docker exec -e PCMK_debug=no hacluster_pacemaker crm_mon -VVVVV --one-shot); then + if ! mon_output=$(sudo ${container_engine} exec -e PCMK_debug=no hacluster_pacemaker crm_mon -VVVVV --one-shot); then cluster_failure=1 fi - if ! sudo docker exec -e PCMK_debug=no hacluster_pacemaker crm_verify -VVVVV --live-check; then + if ! sudo ${container_engine} exec -e PCMK_debug=no hacluster_pacemaker crm_verify -VVVVV --live-check; then cluster_failure=1 fi @@ -81,7 +82,7 @@ function test_masakari_logged { function test_masakari { echo "Testing Masakari" - test_hacluster_logged > /tmp/logs/ansible/test-hacluster 2>&1 + test_hacluster_logged $1 > /tmp/logs/ansible/test-hacluster 2>&1 test_masakari_logged > /tmp/logs/ansible/test-masakari 2>&1 result=$? if [[ $result != 0 ]]; then @@ -92,4 +93,4 @@ function test_masakari { return $result } -test_masakari +test_masakari $1 -- cgit v1.2.3