Many: replace 'which' with 'type -p' in test cases
Unfortunately, `which` does not seem to be installed by default on our F41 CI images. Instead of doing the dance with rebuilds, which has been problematic recently, let's not rely on `which` in scripts any more, since we can replace it with the Bash built-in `type` command. Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
parent
55c22bf4df
commit
2bc27d2d85
13 changed files with 24 additions and 24 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue