Skip to content

Commit

Permalink
Merge pull request #12322 from edsantiago/bats_helper_bins
Browse files Browse the repository at this point in the history
hack/bats: deal with new bin helpers
  • Loading branch information
openshift-merge-robot authored Nov 16, 2021
2 parents 197ebe8 + e367f46 commit 059785c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions hack/bats
Original file line number Diff line number Diff line change
Expand Up @@ -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 | $?))
Expand Down
2 changes: 1 addition & 1 deletion test/system/700-play.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 059785c

Please sign in to comment.