diff --git a/test/cases/api.sh b/test/cases/api.sh index 06f4f4b5c..072431a89 100755 --- a/test/cases/api.sh +++ b/test/cases/api.sh @@ -101,9 +101,9 @@ export CONTAINER_IMAGE_CLOUD_TOOLS="quay.io/osbuild/cloud-tools:latest" # # Set up the database queue # -if which podman 2>/dev/null >&2; then +if type -p podman 2>/dev/null >&2; then CONTAINER_RUNTIME=podman -elif which docker 2>/dev/null >&2; then +elif type -p docker 2>/dev/null >&2; then CONTAINER_RUNTIME=docker else echo No container runtime found, install podman or docker. diff --git a/test/cases/aws.sh b/test/cases/aws.sh index f9acf5b60..fbeb6715f 100755 --- a/test/cases/aws.sh +++ b/test/cases/aws.sh @@ -20,9 +20,9 @@ CONTAINER_IMAGE_CLOUD_TOOLS="quay.io/osbuild/cloud-tools:latest" /usr/libexec/osbuild-composer-test/provision.sh none # Check available container runtime -if which podman 2>/dev/null >&2; then +if type -p podman 2>/dev/null >&2; then CONTAINER_RUNTIME=podman -elif which docker 2>/dev/null >&2; then +elif type -p docker 2>/dev/null >&2; then CONTAINER_RUNTIME=docker else echo No container runtime found, install podman or docker. diff --git a/test/cases/aws_s3.sh b/test/cases/aws_s3.sh index 5e1634b28..d28ab0a49 100755 --- a/test/cases/aws_s3.sh +++ b/test/cases/aws_s3.sh @@ -11,9 +11,9 @@ CONTAINER_IMAGE_CLOUD_TOOLS="quay.io/osbuild/cloud-tools:latest" /usr/libexec/osbuild-composer-test/provision.sh none # Check available container runtime -if which podman 2>/dev/null >&2; then +if type -p podman 2>/dev/null >&2; then CONTAINER_RUNTIME=podman -elif which docker 2>/dev/null >&2; then +elif type -p docker 2>/dev/null >&2; then CONTAINER_RUNTIME=docker else echo No container runtime found, install podman or docker. diff --git a/test/cases/azure.sh b/test/cases/azure.sh index 5138ecb8b..ddde74776 100755 --- a/test/cases/azure.sh +++ b/test/cases/azure.sh @@ -24,9 +24,9 @@ CONTAINER_IMAGE_CLOUD_TOOLS="quay.io/osbuild/cloud-tools:latest" /usr/libexec/osbuild-composer-test/provision.sh none # Check available container runtime -if which podman 2>/dev/null >&2; then +if type -p podman 2>/dev/null >&2; then CONTAINER_RUNTIME=podman -elif which docker 2>/dev/null >&2; then +elif type -p docker 2>/dev/null >&2; then CONTAINER_RUNTIME=docker else echo No container runtime found, install podman or docker. diff --git a/test/cases/filesystem.sh b/test/cases/filesystem.sh index f03564d4a..8d8a889b0 100644 --- a/test/cases/filesystem.sh +++ b/test/cases/filesystem.sh @@ -37,7 +37,7 @@ function cleanup_on_exit() { trap cleanup_on_exit EXIT # Workaround the problem that 'image-info' can not read SELinux labels unknown to the host from the image -OSBUILD_LABEL=$(matchpathcon -n "$(which osbuild)") +OSBUILD_LABEL=$(matchpathcon -n "$(type -p osbuild)") sudo chcon "$OSBUILD_LABEL" /usr/libexec/osbuild-composer-test/image-info # Build ostree image. diff --git a/test/cases/gcp.sh b/test/cases/gcp.sh index 3182848e6..485512f95 100755 --- a/test/cases/gcp.sh +++ b/test/cases/gcp.sh @@ -19,9 +19,9 @@ CONTAINER_IMAGE_CLOUD_TOOLS="quay.io/osbuild/cloud-tools:latest" /usr/libexec/osbuild-composer-test/provision.sh none # Check available container runtime -if which podman 2>/dev/null >&2; then +if type -p podman 2>/dev/null >&2; then CONTAINER_RUNTIME=podman -elif which docker 2>/dev/null >&2; then +elif type -p docker 2>/dev/null >&2; then CONTAINER_RUNTIME=docker else echo No container runtime found, install podman or docker. diff --git a/test/cases/generic_s3.sh b/test/cases/generic_s3.sh index 6344261ae..4ec8de5bd 100755 --- a/test/cases/generic_s3.sh +++ b/test/cases/generic_s3.sh @@ -12,9 +12,9 @@ CONTAINER_MINIO_SERVER="quay.io/minio/minio:latest" /usr/libexec/osbuild-composer-test/provision.sh none # Check available container runtime -if which podman 2>/dev/null >&2; then +if type -p podman 2>/dev/null >&2; then CONTAINER_RUNTIME=podman -elif which docker 2>/dev/null >&2; then +elif type -p docker 2>/dev/null >&2; then CONTAINER_RUNTIME=docker else echo No container runtime found, install podman or docker. diff --git a/test/cases/image_tests.sh b/test/cases/image_tests.sh index 27270a36e..149bf2f56 100755 --- a/test/cases/image_tests.sh +++ b/test/cases/image_tests.sh @@ -97,7 +97,7 @@ run_test_case () { cd $WORKING_DIRECTORY # Workaround the problem that 'image-info' can not read SELinux labels unknown to the host from the image -OSBUILD_LABEL=$(matchpathcon -n "$(which osbuild)") +OSBUILD_LABEL=$(matchpathcon -n "$(type -p osbuild)") sudo chcon "$OSBUILD_LABEL" /usr/libexec/osbuild-composer-test/image-info # Run each test case. diff --git a/test/cases/koji.sh b/test/cases/koji.sh index 507fff293..11fc0f3a0 100755 --- a/test/cases/koji.sh +++ b/test/cases/koji.sh @@ -78,9 +78,9 @@ if [[ "$TEST_TYPE" == "$TEST_TYPE_CLOUD_UPLOAD" ]]; then # Container image used for cloud provider CLI tools export CONTAINER_IMAGE_CLOUD_TOOLS="quay.io/osbuild/cloud-tools:latest" - if which podman 2>/dev/null >&2; then + if type -p podman 2>/dev/null >&2; then export CONTAINER_RUNTIME=podman - elif which docker 2>/dev/null >&2; then + elif type -p docker 2>/dev/null >&2; then export CONTAINER_RUNTIME=docker else echo No container runtime found, install podman or docker. diff --git a/test/cases/oci.sh b/test/cases/oci.sh index bc0e4cbfb..81aeb7fa9 100755 --- a/test/cases/oci.sh +++ b/test/cases/oci.sh @@ -17,9 +17,9 @@ CONTAINER_IMAGE_CLOUD_TOOLS="quay.io/osbuild/cloud-tools:latest" # Provision the software under test. /usr/libexec/osbuild-composer-test/provision.sh none -if which podman 2>/dev/null >&2; then +if type -p podman 2>/dev/null >&2; then CONTAINER_RUNTIME=podman -elif which docker 2>/dev/null >&2; then +elif type -p docker 2>/dev/null >&2; then CONTAINER_RUNTIME=docker else echo No container runtime found, install podman or docker. diff --git a/test/cases/regression-old-worker-new-composer.sh b/test/cases/regression-old-worker-new-composer.sh index c269bfd8f..4aa6db0f3 100644 --- a/test/cases/regression-old-worker-new-composer.sh +++ b/test/cases/regression-old-worker-new-composer.sh @@ -84,9 +84,9 @@ sudo dnf install -y osbuild-composer-worker podman composer-cli # verify the right worker is installed just to be sure rpm -q "$DESIRED_WORKER_RPM" -if which podman 2>/dev/null >&2; then +if type -p podman 2>/dev/null >&2; then CONTAINER_RUNTIME=podman -elif which docker 2>/dev/null >&2; then +elif type -p docker 2>/dev/null >&2; then CONTAINER_RUNTIME=docker else echo No container runtime found, install podman or docker. diff --git a/test/cases/ubi-wsl.sh b/test/cases/ubi-wsl.sh index ccc08b0ce..fec9a67da 100755 --- a/test/cases/ubi-wsl.sh +++ b/test/cases/ubi-wsl.sh @@ -19,9 +19,9 @@ CONTAINER_IMAGE_CLOUD_TOOLS="quay.io/osbuild/cloud-tools:latest" /usr/libexec/osbuild-composer-test/provision.sh none # Check available container runtime -if which podman 2>/dev/null >&2; then +if type -p podman 2>/dev/null >&2; then CONTAINER_RUNTIME=podman -elif which docker 2>/dev/null >&2; then +elif type -p docker 2>/dev/null >&2; then CONTAINER_RUNTIME=docker else echo No container runtime found, install podman or docker. diff --git a/test/cases/worker-executor.sh b/test/cases/worker-executor.sh index 5f8947e17..6ccacd3db 100644 --- a/test/cases/worker-executor.sh +++ b/test/cases/worker-executor.sh @@ -22,9 +22,9 @@ KEYPAIR=${TEMPDIR}/keypair.pem INSTANCE_ID=$(curl -Ls http://169.254.169.254/latest/meta-data/instance-id) # Check available container runtime -if which podman 2>/dev/null >&2; then +if type -p podman 2>/dev/null >&2; then CONTAINER_RUNTIME=podman -elif which docker 2>/dev/null >&2; then +elif type -p docker 2>/dev/null >&2; then CONTAINER_RUNTIME=docker else echo No container runtime found, install podman or docker.