mirror of
https://github.com/containers/skopeo.git
synced 2025-06-27 07:07:31 +00:00
Add conditional release-checking system test
Unfortunately on a number of occasions, Skopeo has been released officially with a `-dev` suffix in the version number. Assist in catching this mistake at release time by the addition of a simple conditional test. Note that it must be positively enabled by a magic env. var. before executing the system tests. Also (as suggested by @lsm5) update the TMT test to trigger the new condition for future Fedora releases. Signed-off-by: Chris Evich <cevich@redhat.com>
This commit is contained in:
parent
25d4df6ee8
commit
3ddcdee045
@ -16,4 +16,30 @@ function setup() {
|
|||||||
expect_output --substring "skopeo version [0-9.]+"
|
expect_output --substring "skopeo version [0-9.]+"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "skopeo release isn't a development version" {
|
||||||
|
[[ "${RELEASE_TESTING:-false}" == "true" ]] || \
|
||||||
|
skip "Release testing may be enabled by setting \$RELEASE_TESTING = 'true'."
|
||||||
|
|
||||||
|
run_skopeo --version
|
||||||
|
|
||||||
|
# expect_output() doesn't support negative matching
|
||||||
|
if [[ "$output" =~ "dev" ]]; then
|
||||||
|
# This is a multi-line message, which may in turn contain multi-line
|
||||||
|
# output, so let's format it ourselves, readably
|
||||||
|
local -a output_split
|
||||||
|
readarray -t output_split <<<"$output"
|
||||||
|
printf "#/vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n" >&2
|
||||||
|
printf "#| FAIL: $BATS_TEST_NAME\n" >&2
|
||||||
|
printf "#| unexpected: 'dev'\n" >&2
|
||||||
|
printf "#| actual: '%s'\n" "${output_split[0]}" >&2
|
||||||
|
local line
|
||||||
|
for line in "${output_split[@]:1}"; do
|
||||||
|
printf "#| > '%s'\n" "$line" >&2
|
||||||
|
done
|
||||||
|
printf "#\\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" >&2
|
||||||
|
false
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# vim: filetype=sh
|
# vim: filetype=sh
|
||||||
|
@ -5,6 +5,11 @@ require:
|
|||||||
environment:
|
environment:
|
||||||
SKOPEO_BINARY: /usr/bin/skopeo
|
SKOPEO_BINARY: /usr/bin/skopeo
|
||||||
|
|
||||||
|
adjust:
|
||||||
|
- when: initiator != "packit"
|
||||||
|
environment+:
|
||||||
|
RELEASE_TESTING: true
|
||||||
|
|
||||||
summary: System test
|
summary: System test
|
||||||
test: bash ./test.sh
|
test: bash ./test.sh
|
||||||
duration: 60m
|
duration: 60m
|
||||||
|
Loading…
Reference in New Issue
Block a user