Skip to content

Commit faceb67

Browse files
committed
test/buildah-bud: enable one skipped test
For podman build --squash is different from the buildah bud --squash option, in podman it must use --squash-all. Fixes: #26906 Signed-off-by: Paul Holzinger <[email protected]>
1 parent 5e5f0a1 commit faceb67

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed

test/buildah-bud/apply-podman-deltas

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,6 @@ skip "FIXME: 2024-05-28 new VMs from #338" \
330330
skip_if_remote "FIXME: 2025-04-01 git related errors returning wrong exit code" \
331331
"bud with ADD with git repository source"
332332

333-
skip "FIXME: #26906 - new test failing in podman for some reason" \
334-
"bud with no instructions but with CLI flags that require a new image be written"
335-
336333
# END temporary workarounds that must be reevaluated periodically
337334
###############################################################################
338335

test/buildah-bud/buildah-tests.diff

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
From 3170dbcf74c62990a288402fb15c7f4f99703144 Mon Sep 17 00:00:00 2001
1+
From 4c30f5e698bc1d4ca498347435174a6be7232876 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
Signed-off-by: Paul Holzinger <[email protected]>
88
---
9-
tests/helpers.bash | 158 +++++++++++++++++++++++++++++++++++++++++++--
10-
1 file changed, 154 insertions(+), 4 deletions(-)
9+
tests/helpers.bash | 166 +++++++++++++++++++++++++++++++++++++++++++--
10+
1 file changed, 162 insertions(+), 4 deletions(-)
1111

1212
diff --git a/tests/helpers.bash b/tests/helpers.bash
13-
index 9cb1bbc0c..b661fd4ad 100644
13+
index 5acd0a3c3..7a0721305 100644
1414
--- a/tests/helpers.bash
1515
+++ b/tests/helpers.bash
16-
@@ -84,6 +84,42 @@ EOF
16+
@@ -85,6 +85,42 @@ EOF
1717
BUILDAH_REGISTRY_OPTS="${regconfopt} ${regconfdir} --short-name-alias-conf ${TEST_SCRATCH_DIR}/cache/shortnames.conf"
1818
COPY_REGISTRY_OPTS="${BUILDAH_REGISTRY_OPTS}"
1919
PODMAN_REGISTRY_OPTS="${regconfopt}"
@@ -56,7 +56,7 @@ index 9cb1bbc0c..b661fd4ad 100644
5656
}
5757

5858
function starthttpd() { # directory [working-directory-or-"" [certfile, keyfile]]
59-
@@ -148,6 +184,22 @@ function teardown_tests() {
59+
@@ -149,6 +185,22 @@ function teardown_tests() {
6060
stop_git_daemon
6161
stop_registry
6262

@@ -79,7 +79,7 @@ index 9cb1bbc0c..b661fd4ad 100644
7979
# Workaround for #1991 - buildah + overlayfs leaks mount points.
8080
# Many tests leave behind /var/tmp/.../root/overlay and sub-mounts;
8181
# let's find those and clean them up, otherwise 'rm -rf' fails.
82-
@@ -269,7 +321,12 @@ function copy() {
82+
@@ -270,7 +322,12 @@ function copy() {
8383
}
8484

8585
function podman() {
@@ -93,7 +93,7 @@ index 9cb1bbc0c..b661fd4ad 100644
9393
}
9494

9595
# There are various scenarios where we would like to execute `tests` as rootless user, however certain commands like `buildah mount`
96-
@@ -376,8 +433,78 @@ function run_buildah() {
96+
@@ -377,8 +434,86 @@ function run_buildah() {
9797
--retry) retry=3; shift;; # retry network flakes
9898
esac
9999

@@ -110,6 +110,14 @@ index 9cb1bbc0c..b661fd4ad 100644
110110
+ else
111111
+ set "build" "--force-rm=false" "--layers=false" "$@"
112112
+ fi
113+
+ # buildah --squash equals podman --squash-all so we need to replace that as well
114+
+ new_args=()
115+
+ for arg in "$@"; do
116+
+ new_arg="${arg/#--squash/--squash-all}"
117+
+ new_args+=("$new_arg")
118+
+ done
119+
+ set "${new_args[@]}"
120+
+
113121
+ # Figure out an archive format that will match the --format flag, if one was used.
114122
+ local nativearchive=oci-archive
115123
+ local formatpattern="((--format( |=))(oci|docker))"
@@ -173,7 +181,7 @@ index 9cb1bbc0c..b661fd4ad 100644
173181

174182
# If session is rootless and `buildah mount` is invoked, perform unshare,
175183
# since normal user cannot mount a filesystem unless they're in a user namespace along with its own mount namespace.
176-
@@ -391,8 +518,8 @@ function run_buildah() {
184+
@@ -392,8 +527,8 @@ function run_buildah() {
177185
retry=$(( retry - 1 ))
178186

179187
# stdout is only emitted upon error; this echo is to help a debugger
@@ -184,7 +192,7 @@ index 9cb1bbc0c..b661fd4ad 100644
184192
# without "quotes", multiple lines are glommed together into one
185193
if [ -n "$output" ]; then
186194
echo "$output"
187-
@@ -419,6 +546,9 @@ function run_buildah() {
195+
@@ -420,6 +555,9 @@ function run_buildah() {
188196
false
189197
fi
190198

@@ -194,7 +202,7 @@ index 9cb1bbc0c..b661fd4ad 100644
194202
if [ -n "$expected_rc" ]; then
195203
if [ "$status" -eq "$expected_rc" ]; then
196204
return
197-
@@ -756,6 +886,26 @@ function skip_if_no_unshare() {
205+
@@ -757,6 +895,26 @@ function skip_if_no_unshare() {
198206
fi
199207
}
200208

@@ -222,5 +230,5 @@ index 9cb1bbc0c..b661fd4ad 100644
222230
# start_git_daemon #
223231
######################
224232
--
225-
2.50.1
233+
2.51.0
226234

0 commit comments

Comments
 (0)