aboutsummaryrefslogtreecommitdiff
path: root/test/upgrade/helpers.bash
diff options
context:
space:
mode:
Diffstat (limited to 'test/upgrade/helpers.bash')
-rw-r--r--test/upgrade/helpers.bash8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/upgrade/helpers.bash b/test/upgrade/helpers.bash
index 41d9279e6..16fedb053 100644
--- a/test/upgrade/helpers.bash
+++ b/test/upgrade/helpers.bash
@@ -9,3 +9,11 @@ setup() {
teardown() {
:
}
+
+# skip a test when the given version is older than the currently tested one
+skip_if_version_older() {
+ # use ${PODMAN_UPGRADE_FROM##v} to trim the leading "v"
+ if printf '%s\n%s\n' "${PODMAN_UPGRADE_FROM##v}" "$1" | sort --check=quiet --version-sort; then
+ skip "${2-test is only meaningful when upgrading from $1 or later}"
+ fi
+}