summaryrefslogtreecommitdiff
path: root/test/buildah-bud
diff options
context:
space:
mode:
authorEd Santiago <santiago@redhat.com>2022-06-13 14:24:12 -0600
committerEd Santiago <santiago@redhat.com>2022-06-14 08:56:28 -0600
commit232b3e342a6fdf14c22dab679a330aa32d8d2829 (patch)
treeb5569b6504b42cb2ef25f251e061025d20434eb2 /test/buildah-bud
parentcffed099b8404fa7f136643116020edac2336155 (diff)
downloadpodman-232b3e342a6fdf14c22dab679a330aa32d8d2829.tar.gz
podman-232b3e342a6fdf14c22dab679a330aa32d8d2829.tar.bz2
podman-232b3e342a6fdf14c22dab679a330aa32d8d2829.zip
buildah-bud tests: add arg sanity check
Fix bad design decision (mine) by adding a simple usage check to 'skip' and 'skip_if_remote' functions: if invoked without test-name args, fail loudly and immediately. Background: yeah, their usage is not intuitive. Making the first arg be a comment helps with _reading_ the code, but not _writing_ new additions. A developer in a hurry could write "skip this-test" and, until now, that would be a silent NOP. Tested by adding broken skip/skip_if_remote calls inline; I confirm that the line number and funcname usage is correct. Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'test/buildah-bud')
-rwxr-xr-xtest/buildah-bud/apply-podman-deltas7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/buildah-bud/apply-podman-deltas b/test/buildah-bud/apply-podman-deltas
index 02a8fc222..0bde060ed 100755
--- a/test/buildah-bud/apply-podman-deltas
+++ b/test/buildah-bud/apply-podman-deltas
@@ -61,7 +61,12 @@ function _skip() {
local skip=$1; shift
local reason=$1; shift
- # All further arguments are test names
+ # All further arguments are test names. Make sure we're invoked with some!
+ if [[ -z "$*" ]]; then
+ echo "$ME: FATAL: Invalid use of '${FUNCNAME[1]}' at line ${BASH_LINENO[1]}: missing test-name argument(s)." >&2
+ exit 1
+ fi
+
for t in "$@"; do
if fgrep -qx "@test \"$t\" {" $BUD; then
$ECHO "@test \"$t\" : $skip \"$reason\""