mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-08-05 00:15:44 +00:00
test/buildah-bud: update buildah diff
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
parent
dc5c3b0c55
commit
aab2abf646
1 changed files with 19 additions and 21 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
From 53c97f858285ff043b4121988433f2312482eba9 Mon Sep 17 00:00:00 2001
|
From 13c82f9d6c18eafd3ff86140125ffeaab3ce75fb Mon Sep 17 00:00:00 2001
|
||||||
From: Ed Santiago <santiago@redhat.com>
|
From: Ed Santiago <santiago@redhat.com>
|
||||||
Date: Thu, 6 Oct 2022 17:32:59 -0600
|
Date: Thu, 6 Oct 2022 17:32:59 -0600
|
||||||
Subject: [PATCH] tweaks for running buildah tests under podman
|
Subject: [PATCH] tweaks for running buildah tests under podman
|
||||||
|
|
@ -12,10 +12,10 @@ Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
|
||||||
1 file changed, 162 insertions(+), 4 deletions(-)
|
1 file changed, 162 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
diff --git a/tests/helpers.bash b/tests/helpers.bash
|
diff --git a/tests/helpers.bash b/tests/helpers.bash
|
||||||
index 5ba4f5a..6a41f10 100644
|
index 7a64d8345..4cd544324 100644
|
||||||
--- a/tests/helpers.bash
|
--- a/tests/helpers.bash
|
||||||
+++ b/tests/helpers.bash
|
+++ b/tests/helpers.bash
|
||||||
@@ -86,6 +86,42 @@ EOF
|
@@ -89,6 +89,42 @@ EOF
|
||||||
BUILDAH_REGISTRY_OPTS="${regconfopt} ${regconfdir} --short-name-alias-conf ${TEST_SCRATCH_DIR}/cache/shortnames.conf"
|
BUILDAH_REGISTRY_OPTS="${regconfopt} ${regconfdir} --short-name-alias-conf ${TEST_SCRATCH_DIR}/cache/shortnames.conf"
|
||||||
COPY_REGISTRY_OPTS="${BUILDAH_REGISTRY_OPTS}"
|
COPY_REGISTRY_OPTS="${BUILDAH_REGISTRY_OPTS}"
|
||||||
PODMAN_REGISTRY_OPTS="${regconfopt}"
|
PODMAN_REGISTRY_OPTS="${regconfopt}"
|
||||||
|
|
@ -56,12 +56,12 @@ index 5ba4f5a..6a41f10 100644
|
||||||
+ die "podman server never came up: $PODMAN_SOCK_FILE"
|
+ die "podman server never came up: $PODMAN_SOCK_FILE"
|
||||||
+ fi
|
+ fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function starthttpd() { # directoryspecs [working-directory-or-"" [certfile, keyfile]]
|
function starthttpd() { # directoryspecs [working-directory-or-"" [certfile, keyfile]]
|
||||||
@@ -155,6 +191,22 @@ function teardown_tests() {
|
@@ -154,6 +190,22 @@ function teardown_tests() {
|
||||||
stop_git_daemon
|
stop_git_daemon
|
||||||
stop_registry
|
stop_registry
|
||||||
|
|
||||||
+ if [[ -n "$PODMAN_SERVER_PID" ]]; then
|
+ if [[ -n "$PODMAN_SERVER_PID" ]]; then
|
||||||
+ echo "teardown: stopping podman server $PODMAN_SERVER_PID"
|
+ echo "teardown: stopping podman server $PODMAN_SERVER_PID"
|
||||||
+ kill $PODMAN_SERVER_PID
|
+ kill $PODMAN_SERVER_PID
|
||||||
|
|
@ -81,9 +81,9 @@ index 5ba4f5a..6a41f10 100644
|
||||||
# Workaround for #1991 - buildah + overlayfs leaks mount points.
|
# Workaround for #1991 - buildah + overlayfs leaks mount points.
|
||||||
# Many tests leave behind /var/tmp/.../root/overlay and sub-mounts;
|
# Many tests leave behind /var/tmp/.../root/overlay and sub-mounts;
|
||||||
# let's find those and clean them up, otherwise 'rm -rf' fails.
|
# let's find those and clean them up, otherwise 'rm -rf' fails.
|
||||||
@@ -276,7 +328,12 @@ function copy() {
|
@@ -275,7 +327,12 @@ function copy() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function podman() {
|
function podman() {
|
||||||
- command ${PODMAN_BINARY:-podman} ${PODMAN_REGISTRY_OPTS} ${ROOTDIR_OPTS} "$@"
|
- command ${PODMAN_BINARY:-podman} ${PODMAN_REGISTRY_OPTS} ${ROOTDIR_OPTS} "$@"
|
||||||
+ local cmd=${PODMAN_BINARY:-podman}
|
+ local cmd=${PODMAN_BINARY:-podman}
|
||||||
|
|
@ -93,12 +93,12 @@ index 5ba4f5a..6a41f10 100644
|
||||||
+ fi
|
+ fi
|
||||||
+ command $cmd $opts "$@"
|
+ command $cmd $opts "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
# There are various scenarios where we would like to execute `tests` as rootless user, however certain commands like `buildah mount`
|
# There are various scenarios where we would like to execute `tests` as rootless user, however certain commands like `buildah mount`
|
||||||
@@ -383,8 +440,86 @@ function run_buildah() {
|
@@ -382,15 +439,93 @@ function run_buildah() {
|
||||||
--retry) retry=3; shift;; # retry network flakes
|
--retry) retry=3; shift;; # retry network flakes
|
||||||
esac
|
esac
|
||||||
|
|
||||||
+ local podman_or_buildah=${BUILDAH_BINARY}
|
+ local podman_or_buildah=${BUILDAH_BINARY}
|
||||||
+ local _opts="${ROOTDIR_OPTS} ${BUILDAH_REGISTRY_OPTS}"
|
+ local _opts="${ROOTDIR_OPTS} ${BUILDAH_REGISTRY_OPTS}"
|
||||||
+ local copydown=:
|
+ local copydown=:
|
||||||
|
|
@ -180,12 +180,10 @@ index 5ba4f5a..6a41f10 100644
|
||||||
# Remember command args, for possible use in later diagnostic messages
|
# Remember command args, for possible use in later diagnostic messages
|
||||||
- MOST_RECENT_BUILDAH_COMMAND="buildah $*"
|
- MOST_RECENT_BUILDAH_COMMAND="buildah $*"
|
||||||
+ MOST_RECENT_BUILDAH_COMMAND="$cmd_basename $*"
|
+ MOST_RECENT_BUILDAH_COMMAND="$cmd_basename $*"
|
||||||
|
|
||||||
# If session is rootless and `buildah mount` is invoked, perform unshare,
|
while [ $retry -gt 0 ]; do
|
||||||
# since normal user cannot mount a filesystem unless they're in a user namespace along with its own mount namespace.
|
|
||||||
@@ -398,8 +533,8 @@ function run_buildah() {
|
|
||||||
retry=$(( retry - 1 ))
|
retry=$(( retry - 1 ))
|
||||||
|
|
||||||
# stdout is only emitted upon error; this echo is to help a debugger
|
# stdout is only emitted upon error; this echo is to help a debugger
|
||||||
- echo "${_LOG_PROMPT} ${BUILDAH_BINARY} $*"
|
- echo "${_LOG_PROMPT} ${BUILDAH_BINARY} $*"
|
||||||
- run env CONTAINERS_CONF=${CONTAINERS_CONF:-$(dirname ${BASH_SOURCE})/containers.conf} timeout --foreground --kill=10 $BUILDAH_TIMEOUT ${BUILDAH_BINARY} ${BUILDAH_REGISTRY_OPTS} ${ROOTDIR_OPTS} "$@"
|
- run env CONTAINERS_CONF=${CONTAINERS_CONF:-$(dirname ${BASH_SOURCE})/containers.conf} timeout --foreground --kill=10 $BUILDAH_TIMEOUT ${BUILDAH_BINARY} ${BUILDAH_REGISTRY_OPTS} ${ROOTDIR_OPTS} "$@"
|
||||||
|
|
@ -194,20 +192,20 @@ index 5ba4f5a..6a41f10 100644
|
||||||
# without "quotes", multiple lines are glommed together into one
|
# without "quotes", multiple lines are glommed together into one
|
||||||
if [ -n "$output" ]; then
|
if [ -n "$output" ]; then
|
||||||
echo "$output"
|
echo "$output"
|
||||||
@@ -426,6 +561,9 @@ function run_buildah() {
|
@@ -417,6 +552,9 @@ function run_buildah() {
|
||||||
false
|
false
|
||||||
fi
|
fi
|
||||||
|
|
||||||
+ if [[ "$status" -eq 0 ]] ; then
|
+ if [[ "$status" -eq 0 ]] ; then
|
||||||
+ eval ${copydown}
|
+ eval ${copydown}
|
||||||
+ fi
|
+ fi
|
||||||
if [ -n "$expected_rc" ]; then
|
if [ -n "$expected_rc" ]; then
|
||||||
if [ "$status" -eq "$expected_rc" ]; then
|
if [ "$status" -eq "$expected_rc" ]; then
|
||||||
return
|
return
|
||||||
@@ -772,6 +910,26 @@ function skip_unless_arch() {
|
@@ -794,6 +932,26 @@ function skip_unless_arch() {
|
||||||
skip "test requires one of these architectures: $* (current: $goarch)"
|
skip "test requires one of these architectures: $* (current: $goarch)"
|
||||||
}
|
}
|
||||||
|
|
||||||
+####################
|
+####################
|
||||||
+# skip_if_remote # (only applicable for podman)
|
+# skip_if_remote # (only applicable for podman)
|
||||||
+####################
|
+####################
|
||||||
|
|
@ -232,5 +230,5 @@ index 5ba4f5a..6a41f10 100644
|
||||||
# start_git_daemon #
|
# start_git_daemon #
|
||||||
######################
|
######################
|
||||||
--
|
--
|
||||||
2.53.0
|
2.55.0
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue