Skip to content

Commit

Permalink
[DO NOT MERGE] buildah vendor treadmill
Browse files Browse the repository at this point in the history
This is an always-open PR used for simplifying the
buildah merge process.

Changes as of 2022-04-18:

- apply-podman-deltas: minor cleanup
- buildah-tests.diff: deal with buildah containers#3894 (the registry one),
  which affected helpers.bash

Signed-off-by: Ed Santiago <santiago@redhat.com>
  • Loading branch information
edsantiago committed Apr 21, 2022
1 parent 02ab86a commit 850de7e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 32 deletions.
17 changes: 5 additions & 12 deletions test/buildah-bud/apply-podman-deltas
Expand Up @@ -136,19 +136,12 @@ errmsg "no such file or directory" \

###############################################################################
# BEGIN tests that don't make sense under podman due to fundamental differences

# TODO
# Some of the podman tests in CI expects exit code 125, which might not be true
# since exit code from runtime is relayed as it is without any modification both
# in `buildah` and `podman`. Following behaviour is seen when PR https://github.com/containers/buildah/pull/3809
# added a test here https://github.com/containers/buildah/blob/main/tests/bud.bats#L3183
# which relays exit code from runtime as it is, in case of both `podman` and `buildah`.
# However apart from this test case no other test case was able to trigger this behavior
# hence marking this test as an anomaly. Since its debatable if we should override this
# returned error number or not hence adding a note here.
skip "podman CI expects all exit code to be 125 this test has anomaly behaviour" \
"bud with --add-host"

skip "podman CI expects all exit code to be 125 this test has anomaly behaviour" \
# Normally, when buildah exits 1 on error, podman exits 125.
# These tests are the exception. They exit 1 under podman.
skip "these tests exit 1 under podman, not 125" \
"bud with --add-host" \
"bud - invalid runtime flags test"

skip "does not work under podman" \
Expand Down
36 changes: 16 additions & 20 deletions test/buildah-bud/buildah-tests.diff
@@ -1,15 +1,15 @@
From 1a5562929a85074a7498165191558f434bb30bf1 Mon Sep 17 00:00:00 2001
From 23a8d69363b23c8f3142e0a53be8a02963c40742 Mon Sep 17 00:00:00 2001
From: Ed Santiago <santiago@redhat.com>
Date: Tue, 9 Feb 2021 17:28:05 -0700
Subject: [PATCH] tweaks for running buildah tests under podman

Signed-off-by: Ed Santiago <santiago@redhat.com>
---
tests/helpers.bash | 73 +++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 69 insertions(+), 4 deletions(-)
tests/helpers.bash | 69 ++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 66 insertions(+), 3 deletions(-)

diff --git a/tests/helpers.bash b/tests/helpers.bash
index 2bb6b429..0dc98a85 100644
index 042907d0..594bf520 100644
--- a/tests/helpers.bash
+++ b/tests/helpers.bash
@@ -43,6 +43,23 @@ EOF
Expand All @@ -36,9 +36,9 @@ index 2bb6b429..0dc98a85 100644
}

function starthttpd() {
@@ -85,6 +102,12 @@ function teardown_tests() {
stophttpd
@@ -86,6 +103,12 @@ function teardown_tests() {
stop_git_daemon
stop_registry

+ if [[ -n "$PODMAN_SERVER_PID" ]]; then
+ kill $PODMAN_SERVER_PID
Expand All @@ -49,22 +49,18 @@ index 2bb6b429..0dc98a85 100644
# Workaround for #1991 - buildah + overlayfs leaks mount points.
# Many tests leave behind /var/tmp/.../root/overlay and sub-mounts;
# let's find those and clean them up, otherwise 'rm -rf' fails.
@@ -157,7 +180,13 @@ function copy() {
@@ -166,6 +189,10 @@ function podman() {
command ${PODMAN_BINARY:-podman} ${PODMAN_REGISTRY_OPTS} ${ROOTDIR_OPTS} "$@"
}

function podman() {
- command podman ${PODMAN_REGISTRY_OPTS} ${ROOTDIR_OPTS} "$@"
+ echo "# ... podman $*" >&3
+ ${PODMAN_BINARY} ${PODMAN_REGISTRY_OPTS} ${ROOTDIR_OPTS} "$@"
+function podman-remote() {
+ command ${PODMAN_BINARY:-podman-remote} ${ROOTDIR_OPTS} "$@"
+}
+
+function podman-remote() {
+ echo "# ... podman-remote $*" >&3
+ ${PODMAN_BINARY} ${ROOTDIR_OPTS} "$@"
}

# There are various scenarios where we would like to execute `tests` as rootless user, however certain commands like `buildah mount`
@@ -221,8 +250,35 @@ function run_buildah() {
# do not work in rootless session since a normal user cannot mount a filesystem unless they're in a user namespace along with its
# own mount namespace. In order to run such specific commands from a rootless session we must perform `buildah unshare`.
@@ -227,8 +254,35 @@ function run_buildah() {
--retry) retry=3; shift;; # retry network flakes
esac

Expand Down Expand Up @@ -101,7 +97,7 @@ index 2bb6b429..0dc98a85 100644

# If session is rootless and `buildah mount` is invoked, perform unshare,
# since normal user cannot mount a filesystem unless they're in a user namespace along with its own mount namespace.
@@ -236,8 +292,8 @@ function run_buildah() {
@@ -242,8 +296,8 @@ function run_buildah() {
retry=$(( retry - 1 ))

# stdout is only emitted upon error; this echo is to help a debugger
Expand All @@ -112,7 +108,7 @@ index 2bb6b429..0dc98a85 100644
# without "quotes", multiple lines are glommed together into one
if [ -n "$output" ]; then
echo "$output"
@@ -545,6 +601,15 @@ function skip_if_no_docker() {
@@ -575,6 +629,15 @@ function skip_if_no_docker() {
fi
}

Expand All @@ -129,5 +125,5 @@ index 2bb6b429..0dc98a85 100644
daemondir=${TESTDIR}/git-daemon
mkdir -p ${daemondir}/repo
--
2.31.1
2.35.1

0 comments on commit 850de7e

Please sign in to comment.