aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-11-16 22:51:32 +0100
committerGitHub <noreply@github.com>2021-11-16 22:51:32 +0100
commit059785c3edfe937ce8f39d235440bf0e03620ed8 (patch)
tree487eaa03276d01202eb2adffa712011e0ac49236
parent197ebe8b5e6c10db786ad22692536e395c911b87 (diff)
parente367f46147e92b89a6d61d8d017853d46e76c8ca (diff)
downloadpodman-059785c3edfe937ce8f39d235440bf0e03620ed8.tar.gz
podman-059785c3edfe937ce8f39d235440bf0e03620ed8.tar.bz2
podman-059785c3edfe937ce8f39d235440bf0e03620ed8.zip
Merge pull request #12322 from edsantiago/bats_helper_bins
hack/bats: deal with new bin helpers
-rwxr-xr-xhack/bats12
-rw-r--r--test/system/700-play.bats2
2 files changed, 10 insertions, 4 deletions
diff --git a/hack/bats b/hack/bats
index 7cc3b9bde..cd81a9c73 100755
--- a/hack/bats
+++ b/hack/bats
@@ -93,19 +93,25 @@ done
rc=0
+# As of 2021-11 podman has a bunch of external helper binaries
+if [[ -z "$CONTAINERS_HELPER_BINARY_DIR" ]]; then
+ export CONTAINERS_HELPER_BINARY_DIR=$(pwd)/bin
+fi
+
# Root
if [ -z "$ROOTLESS_ONLY" ]; then
echo "# bats ${bats_filter[@]} $TESTS"
sudo --preserve-env=PODMAN \
--preserve-env=PODMAN_TEST_DEBUG \
--preserve-env=OCI_RUNTIME \
+ --preserve-env=CONTAINERS_HELPER_BINARY_DIR \
bats "${bats_opts[@]}" "${bats_filter[@]}" $TESTS
rc=$?
fi
-# Rootless
-echo "--------------------------------------------------"
-if [ -z "$ROOT_ONLY" ]; then
+# Rootless. (Only if we're not already root)
+if [[ -z "$ROOT_ONLY" && "$(id -u)" != 0 ]]; then
+ echo "--------------------------------------------------"
echo "\$ bats ${bats_filter[@]} $TESTS"
bats "${bats_opts[@]}" "${bats_filter[@]}" $TESTS
rc=$((rc | $?))
diff --git a/test/system/700-play.bats b/test/system/700-play.bats
index c3e5e9354..b77d41920 100644
--- a/test/system/700-play.bats
+++ b/test/system/700-play.bats
@@ -11,7 +11,7 @@ function teardown() {
run_podman rm -t 0 -f -a
run_podman image list --format '{{.ID}} {{.Repository}}'
while read id name; do
- if [[ "$name" =~ /pause ]]; then
+ if [[ "$name" =~ /podman-pause ]]; then
run_podman rmi $id
fi
done <<<"$output"