1
- From 3170dbcf74c62990a288402fb15c7f4f99703144 Mon Sep 17 00:00:00 2001
1
+ From 4c30f5e698bc1d4ca498347435174a6be7232876 Mon Sep 17 00:00:00 2001
2
2
From: Ed Santiago <
[email protected] >
3
3
Date: Thu, 6 Oct 2022 17:32:59 -0600
4
4
Subject: [PATCH] tweaks for running buildah tests under podman
5
5
6
6
Signed-off-by: Ed Santiago <
[email protected] >
7
7
Signed-off-by: Paul Holzinger <
[email protected] >
8
8
---
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(-)
11
11
12
12
diff --git a/tests/helpers.bash b/tests/helpers.bash
13
- index 9cb1bbc0c..b661fd4ad 100644
13
+ index 5acd0a3c3..7a0721305 100644
14
14
--- a/tests/helpers.bash
15
15
+++ b/tests/helpers.bash
16
- @@ -84 ,6 +84 ,42 @@ EOF
16
+ @@ -85 ,6 +85 ,42 @@ EOF
17
17
BUILDAH_REGISTRY_OPTS="${regconfopt} ${regconfdir} --short-name-alias-conf ${TEST_SCRATCH_DIR}/cache/shortnames.conf"
18
18
COPY_REGISTRY_OPTS="${BUILDAH_REGISTRY_OPTS}"
19
19
PODMAN_REGISTRY_OPTS="${regconfopt}"
@@ -56,7 +56,7 @@ index 9cb1bbc0c..b661fd4ad 100644
56
56
}
57
57
58
58
function starthttpd() { # directory [working-directory-or-"" [certfile, keyfile]]
59
- @@ -148 ,6 +184 ,22 @@ function teardown_tests() {
59
+ @@ -149 ,6 +185 ,22 @@ function teardown_tests() {
60
60
stop_git_daemon
61
61
stop_registry
62
62
@@ -79,7 +79,7 @@ index 9cb1bbc0c..b661fd4ad 100644
79
79
# Workaround for #1991 - buildah + overlayfs leaks mount points.
80
80
# Many tests leave behind /var/tmp/.../root/overlay and sub-mounts;
81
81
# 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() {
83
83
}
84
84
85
85
function podman() {
@@ -93,7 +93,7 @@ index 9cb1bbc0c..b661fd4ad 100644
93
93
}
94
94
95
95
# 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() {
97
97
--retry) retry=3; shift;; # retry network flakes
98
98
esac
99
99
@@ -110,6 +110,14 @@ index 9cb1bbc0c..b661fd4ad 100644
110
110
+ else
111
111
+ set "build" "--force-rm=false" "--layers=false" "$@"
112
112
+ 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
+ +
113
121
+ # Figure out an archive format that will match the --format flag, if one was used.
114
122
+ local nativearchive=oci-archive
115
123
+ local formatpattern="((--format( |=))(oci|docker))"
@@ -173,7 +181,7 @@ index 9cb1bbc0c..b661fd4ad 100644
173
181
174
182
# If session is rootless and `buildah mount` is invoked, perform unshare,
175
183
# 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() {
177
185
retry=$(( retry - 1 ))
178
186
179
187
# stdout is only emitted upon error; this echo is to help a debugger
@@ -184,7 +192,7 @@ index 9cb1bbc0c..b661fd4ad 100644
184
192
# without "quotes", multiple lines are glommed together into one
185
193
if [ -n "$output" ]; then
186
194
echo "$output"
187
- @@ -419 ,6 +546 ,9 @@ function run_buildah() {
195
+ @@ -420 ,6 +555 ,9 @@ function run_buildah() {
188
196
false
189
197
fi
190
198
@@ -194,7 +202,7 @@ index 9cb1bbc0c..b661fd4ad 100644
194
202
if [ -n "$expected_rc" ]; then
195
203
if [ "$status" -eq "$expected_rc" ]; then
196
204
return
197
- @@ -756 ,6 +886 ,26 @@ function skip_if_no_unshare() {
205
+ @@ -757 ,6 +895 ,26 @@ function skip_if_no_unshare() {
198
206
fi
199
207
}
200
208
@@ -222,5 +230,5 @@ index 9cb1bbc0c..b661fd4ad 100644
222
230
# start_git_daemon #
223
231
######################
224
232
- -
225
- 2.50.1
233
+ 2.51.0
226
234
0 commit comments