Merge pull request #14588 from edsantiago/eek_buildah_bud_coverage

buildah-bud tests: reenable skipped 'bud' tests
This commit is contained in:
openshift-ci[bot] 2022-06-14 17:17:40 +00:00 committed by GitHub
commit 071b925dec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 21 deletions

View File

@ -155,13 +155,7 @@ errmsg "checking authfile: stat /tmp/nonexistent: no such file or directory" \
############################################################################### ###############################################################################
# BEGIN tests that don't make sense under podman due to fundamental differences # BEGIN tests that don't make sense under podman due to fundamental differences
# TODO # Fails with "Error: no context directory and no Containerfile specified"
# 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" \ skip "does not work under podman" \
"bud without any arguments should succeed" "bud without any arguments should succeed"
@ -172,8 +166,9 @@ skip "does not work under podman" \
skip "FIXME FIXME FIXME: argument-order incompatible with podman" \ skip "FIXME FIXME FIXME: argument-order incompatible with podman" \
"bud-squash-hardlinks" "bud-squash-hardlinks"
skip "FIXME FIXME FIXME: this passes on Ed's laptop, fails in CI??" \ # Fails with "Error: context must be a directory: /path/to/Dockerfile"
"bud-multi-stage-nocache-nocommit" skip "podman-build fails with 'context must be a directory'" \
"bud with specified context should succeed if context contains existing Dockerfile"
############################################################################### ###############################################################################
# BEGIN tests which are skipped because they make no sense under podman-remote # BEGIN tests which are skipped because they make no sense under podman-remote
@ -240,4 +235,12 @@ skip_if_remote "FIXME FIXME FIXME: find a way to clean up their podman calls" \
"bud with run should not leave mounts behind cleanup test" \ "bud with run should not leave mounts behind cleanup test" \
"bud with custom files in /run/ should persist cleanup test" "bud with custom files in /run/ should persist cleanup test"
# Under podman-remote, the "Ignoring <stdin>:5:2: error: #error" message
# is never seen. (Not even as stdout/stderr on the server; Ed checked).
skip_if_remote "FIXME FIXME FIXME: 'Ignoring' warning is never seen" \
"bud with preprocessor error"
# END tests which are skipped due to actual podman or podman-remote bugs.
###############################################################################
exit $RC exit $RC

View File

@ -1,15 +1,15 @@
From 8a8fa1a75e0fa3261263afbc8c2504feb430df6a Mon Sep 17 00:00:00 2001 From 6508e3df2a129554fdf8336d8a6f0cdcc6fd4832 Mon Sep 17 00:00:00 2001
From: Ed Santiago <santiago@redhat.com> From: Ed Santiago <santiago@redhat.com>
Date: Tue, 9 Feb 2021 17:28:05 -0700 Date: Tue, 9 Feb 2021 17:28:05 -0700
Subject: [PATCH] tweaks for running buildah tests under podman Subject: [PATCH] tweaks for running buildah tests under podman
Signed-off-by: Ed Santiago <santiago@redhat.com> Signed-off-by: Ed Santiago <santiago@redhat.com>
--- ---
tests/helpers.bash | 69 ++++++++++++++++++++++++++++++++++++++++++++-- tests/helpers.bash | 70 ++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 66 insertions(+), 3 deletions(-) 1 file changed, 67 insertions(+), 3 deletions(-)
diff --git a/tests/helpers.bash b/tests/helpers.bash diff --git a/tests/helpers.bash b/tests/helpers.bash
index e3087063..b3a8f5ee 100644 index e3087063..178a486e 100644
--- a/tests/helpers.bash --- a/tests/helpers.bash
+++ b/tests/helpers.bash +++ b/tests/helpers.bash
@@ -51,6 +51,23 @@ EOF @@ -51,6 +51,23 @@ EOF
@ -60,13 +60,13 @@ index e3087063..b3a8f5ee 100644
# 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`
# do not work in rootless session since a normal user cannot mount a filesystem unless they're in a user namespace along with its # 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`. # own mount namespace. In order to run such specific commands from a rootless session we must perform `buildah unshare`.
@@ -247,8 +274,35 @@ function run_buildah() { @@ -247,8 +274,36 @@ 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}"
+ if [[ $1 == "build" || $1 == "build-using-dockerfile" ]]; then + if [[ $1 == "build" || $1 == "build-using-dockerfile" || $1 == "bud" ]]; then
+ shift + shift
+ # podman defaults to --layers=true; buildah to --false. + # podman defaults to --layers=true; buildah to --false.
+ # If command line includes explicit --layers, leave it untouched, + # If command line includes explicit --layers, leave it untouched,
@ -82,10 +82,11 @@ index e3087063..b3a8f5ee 100644
+ _opts= + _opts=
+ fi + fi
+ +
+ # podman always exits 125 where buildah exits 1 or 2 (or, in the + # Special case: there's one test that invokes git in such
+ # case of git, 128, which is a bug in git, but I won't harp on that). + # a way that it exits 128 (which IMO is a bug in git).
+ # podman exits 125 in that case.
+ case $expected_rc in + case $expected_rc in
+ 1|2|128) expected_rc=125 ;; + 128) expected_rc=125 ;;
+ esac + esac
+ fi + fi
+ local cmd_basename=$(basename ${podman_or_buildah}) + local cmd_basename=$(basename ${podman_or_buildah})
@ -97,7 +98,7 @@ index e3087063..b3a8f5ee 100644
# If session is rootless and `buildah mount` is invoked, perform unshare, # 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. # since normal user cannot mount a filesystem unless they're in a user namespace along with its own mount namespace.
@@ -262,8 +316,8 @@ function run_buildah() { @@ -262,8 +317,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
@ -108,7 +109,7 @@ index e3087063..b3a8f5ee 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"
@@ -595,6 +649,15 @@ function skip_if_no_docker() { @@ -595,6 +650,15 @@ function skip_if_no_docker() {
fi fi
} }
@ -125,5 +126,5 @@ index e3087063..b3a8f5ee 100644
daemondir=${TEST_SCRATCH_DIR}/git-daemon daemondir=${TEST_SCRATCH_DIR}/git-daemon
mkdir -p ${daemondir}/repo mkdir -p ${daemondir}/repo
-- --
2.35.1 2.35.3

View File

@ -93,6 +93,12 @@ fi
# From here on out, any error is fatal # From here on out, any error is fatal
set -e set -e
# Run sudo early, to refresh the credentials cache. This is a NOP under CI,
# but might be appreciated by developers who run this script, step away
# during the git-checkout-buildah step, then come back twenty minutes later
# to an expired sudo prompt and no tests have run.
sudo --validate
# Before pulling buildah (while still cd'ed to podman repo), try to determine # Before pulling buildah (while still cd'ed to podman repo), try to determine
# if this is a PR, and if so if it's a revendoring of buildah. We use this to # if this is a PR, and if so if it's a revendoring of buildah. We use this to
# try to offer a helpful hint on failure. # try to offer a helpful hint on failure.