Skip to content

Commit c772c00

Browse files
Merge pull request #16384 from edsantiago/budtests_remote
buildah bud tests: better handling of remote
2 parents 3b05473 + 56fae7d commit c772c00

File tree

2 files changed

+19
-22
lines changed

2 files changed

+19
-22
lines changed

test/buildah-bud/apply-podman-deltas

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,6 @@ skip_if_remote "Explicit request in buildah PR 4190 to skip this on remote" \
248248
skip_if_remote "different error messages between podman & podman-remote" \
249249
"bud with .dockerignore #2"
250250

251-
# These two tests, new in 2022-01, invoke podman (create, export) in ways
252-
# that don't work with podman-remote due to the use of --registries-conf
253-
skip_if_remote "FIXME FIXME FIXME: find a way to clean up their podman calls" \
254-
"bud with run should not leave mounts behind cleanup test" \
255-
"bud with custom files in /run/ should persist cleanup test"
256-
257251
# END tests which are skipped due to actual podman or podman-remote bugs.
258252
###############################################################################
259253

test/buildah-bud/buildah-tests.diff

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
From 0e31bb3a189ecd3e3fca36d16bb29b5162cb7d5c Mon Sep 17 00:00:00 2001
1+
From e11d1f32577a8b0307789208c3a39b0ab2a026d8 Mon Sep 17 00:00:00 2001
22
From: Ed Santiago <[email protected]>
33
Date: Thu, 6 Oct 2022 17:32:59 -0600
44
Subject: [PATCH] tweaks for running buildah tests under podman
55

66
Signed-off-by: Ed Santiago <[email protected]>
77
---
8-
tests/helpers.bash | 70 ++++++++++++++++++++++++++++++++++++++++++++--
9-
1 file changed, 67 insertions(+), 3 deletions(-)
8+
tests/helpers.bash | 73 +++++++++++++++++++++++++++++++++++++++++++---
9+
1 file changed, 69 insertions(+), 4 deletions(-)
1010

1111
diff --git a/tests/helpers.bash b/tests/helpers.bash
12-
index aab3f72e..fe02a6f1 100644
12+
index aab3f72e..6e3b0eb5 100644
1313
--- a/tests/helpers.bash
1414
+++ b/tests/helpers.bash
1515
@@ -70,6 +70,23 @@ EOF
@@ -49,18 +49,21 @@ index aab3f72e..fe02a6f1 100644
4949
# Workaround for #1991 - buildah + overlayfs leaks mount points.
5050
# Many tests leave behind /var/tmp/.../root/overlay and sub-mounts;
5151
# let's find those and clean them up, otherwise 'rm -rf' fails.
52-
@@ -205,6 +228,10 @@ function podman() {
53-
command ${PODMAN_BINARY:-podman} ${PODMAN_REGISTRY_OPTS} ${ROOTDIR_OPTS} "$@"
52+
@@ -202,7 +225,12 @@ function copy() {
53+
}
54+
55+
function podman() {
56+
- command ${PODMAN_BINARY:-podman} ${PODMAN_REGISTRY_OPTS} ${ROOTDIR_OPTS} "$@"
57+
+ local cmd=${PODMAN_BINARY:-podman}
58+
+ local opts="${PODMAN_REGISTRY_OPTS} ${ROOTDIR_OPTS}"
59+
+ if [[ $cmd =~ remote ]]; then
60+
+ opts=
61+
+ fi
62+
+ command $cmd $opts "$@"
5463
}
5564

56-
+function podman-remote() {
57-
+ command ${PODMAN_BINARY:-podman-remote} ${ROOTDIR_OPTS} "$@"
58-
+}
59-
+
6065
# There are various scenarios where we would like to execute `tests` as rootless user, however certain commands like `buildah mount`
61-
# do not work in rootless session since a normal user cannot mount a filesystem unless they're in a user namespace along with its
62-
# own mount namespace. In order to run such specific commands from a rootless session we must perform `buildah unshare`.
63-
@@ -266,8 +293,36 @@ function run_buildah() {
66+
@@ -266,8 +294,36 @@ function run_buildah() {
6467
--retry) retry=3; shift;; # retry network flakes
6568
esac
6669

@@ -98,7 +101,7 @@ index aab3f72e..fe02a6f1 100644
98101

99102
# If session is rootless and `buildah mount` is invoked, perform unshare,
100103
# since normal user cannot mount a filesystem unless they're in a user namespace along with its own mount namespace.
101-
@@ -281,8 +336,8 @@ function run_buildah() {
104+
@@ -281,8 +337,8 @@ function run_buildah() {
102105
retry=$(( retry - 1 ))
103106

104107
# stdout is only emitted upon error; this echo is to help a debugger
@@ -109,7 +112,7 @@ index aab3f72e..fe02a6f1 100644
109112
# without "quotes", multiple lines are glommed together into one
110113
if [ -n "$output" ]; then
111114
echo "$output"
112-
@@ -614,6 +669,15 @@ function skip_if_no_docker() {
115+
@@ -614,6 +670,15 @@ function skip_if_no_docker() {
113116
fi
114117
}
115118

@@ -126,5 +129,5 @@ index aab3f72e..fe02a6f1 100644
126129
daemondir=${TEST_SCRATCH_DIR}/git-daemon
127130
mkdir -p ${daemondir}/repo
128131
--
129-
2.37.3
132+
2.38.1
130133

0 commit comments

Comments
 (0)