* stable-2.02 - tests: fix unbound variable
@ 2020-10-16 19:12 Zdenek Kabelac
0 siblings, 0 replies; only message in thread
From: Zdenek Kabelac @ 2020-10-16 19:12 UTC (permalink / raw)
To: lvm-devel
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=d1db024e169c3c6af08477524e8048d54b678714
Commit: d1db024e169c3c6af08477524e8048d54b678714
Parent: 6b3d0166ee2057ddaac3e73955e07acb1204be42
Author: Marian Csontos <mcsontos@redhat.com>
AuthorDate: Tue Jul 23 15:36:13 2019 +0200
Committer: Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Fri Oct 16 18:09:55 2020 +0200
tests: fix unbound variable
Test `aux kernel_at_least 5 1` fails even for newer kernel
with `$3: unbound variable` when using `set -u`.
---
test/lib/aux.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index a84d41189..7235e69b8 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -1548,17 +1548,17 @@ version_at_least() {
IFS=".-" read -r major minor revision <<< "$1"
shift
- test -z "$1" && return 0
+ test -n "${1:-}" || return 0
test -n "$major" || return 1
test "$major" -gt "$1" && return 0
test "$major" -eq "$1" || return 1
- test -z "$2" && return 0
+ test -n "${2:-}" || return 0
test -n "$minor" || return 1
test "$minor" -gt "$2" && return 0
test "$minor" -eq "$2" || return 1
- test -z "$3" && return 0
+ test -n "${3:-}" || return 0
test "$revision" -ge "$3" 2>/dev/null || return 1
}
#
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2020-10-16 19:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-16 19:12 stable-2.02 - tests: fix unbound variable Zdenek Kabelac
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.