From: Zdenek Kabelac <zkabelac@sourceware.org>
To: lvm-devel@redhat.com
Subject: stable-2.02 - tests: fix unbound variable
Date: Fri, 16 Oct 2020 19:12:20 +0000 (GMT) [thread overview]
Message-ID: <20201016191220.A7F05396EC6B@sourceware.org> (raw)
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
}
#
reply other threads:[~2020-10-16 19:12 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201016191220.A7F05396EC6B@sourceware.org \
--to=zkabelac@sourceware.org \
--cc=lvm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.