1
- From 0e31bb3a189ecd3e3fca36d16bb29b5162cb7d5c Mon Sep 17 00:00:00 2001
1
+ From e11d1f32577a8b0307789208c3a39b0ab2a026d8 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
---
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(-)
10
10
11
11
diff --git a/tests/helpers.bash b/tests/helpers.bash
12
- index aab3f72e..fe02a6f1 100644
12
+ index aab3f72e..6e3b0eb5 100644
13
13
--- a/tests/helpers.bash
14
14
+++ b/tests/helpers.bash
15
15
@@ -70,6 +70,23 @@ EOF
@@ -49,18 +49,21 @@ index aab3f72e..fe02a6f1 100644
49
49
# Workaround for #1991 - buildah + overlayfs leaks mount points.
50
50
# Many tests leave behind /var/tmp/.../root/overlay and sub-mounts;
51
51
# 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 "$@"
54
63
}
55
64
56
- + function podman-remote() {
57
- + command ${PODMAN_BINARY:-podman-remote} ${ROOTDIR_OPTS} "$@"
58
- + }
59
- +
60
65
# 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() {
64
67
--retry) retry=3; shift;; # retry network flakes
65
68
esac
66
69
@@ -98,7 +101,7 @@ index aab3f72e..fe02a6f1 100644
98
101
99
102
# If session is rootless and `buildah mount` is invoked, perform unshare,
100
103
# 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() {
102
105
retry=$(( retry - 1 ))
103
106
104
107
# stdout is only emitted upon error; this echo is to help a debugger
@@ -109,7 +112,7 @@ index aab3f72e..fe02a6f1 100644
109
112
# without "quotes", multiple lines are glommed together into one
110
113
if [ -n "$output" ]; then
111
114
echo "$output"
112
- @@ -614,6 +669 ,15 @@ function skip_if_no_docker() {
115
+ @@ -614,6 +670 ,15 @@ function skip_if_no_docker() {
113
116
fi
114
117
}
115
118
@@ -126,5 +129,5 @@ index aab3f72e..fe02a6f1 100644
126
129
daemondir=${TEST_SCRATCH_DIR}/git-daemon
127
130
mkdir -p ${daemondir}/repo
128
131
- -
129
- 2.37.3
132
+ 2.38.1
130
133
0 commit comments