diff options
| author | Martin Hiner <m.hiner@partner.samsung.com> | 2022-11-21 18:38:57 +0100 |
|---|---|---|
| committer | Martin Hiner <m.hiner@partner.samsung.com> | 2023-04-28 16:16:55 +0200 |
| commit | 53e8b80ed36a9193627862427fa224ed38375d3a (patch) | |
| tree | 14463dda4a87452345c37a1a5252d50db057bc12 /tests/test-masakari.sh | |
| parent | 92ddbdfbc190ec430f5527fcf867efec97e455b4 (diff) | |
| download | kolla-ansible-53e8b80ed36a9193627862427fa224ed38375d3a.tar.gz kolla-ansible-53e8b80ed36a9193627862427fa224ed38375d3a.zip | |
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 <m.hiner@partner.samsung.com>
Change-Id: I395d2bdb0dfb4b325b6ad197c8893c8a0f768324
Diffstat (limited to 'tests/test-masakari.sh')
| -rwxr-xr-x | tests/test-masakari.sh | 11 |
1 files changed, 6 insertions, 5 deletions
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 |
