diff options
-rw-r--r-- | tests/functional/common/vars-and-functions.sh.in | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/functional/common/vars-and-functions.sh.in b/tests/functional/common/vars-and-functions.sh.in index bd1990973..bfc4fbc44 100644 --- a/tests/functional/common/vars-and-functions.sh.in +++ b/tests/functional/common/vars-and-functions.sh.in @@ -144,11 +144,15 @@ if [[ $(uname) == Linux ]] && [[ -L /proc/self/ns/user ]] && unshare --user true fi isDaemonNewer () { - [[ -n "${NIX_DAEMON_PACKAGE:-}" ]] || return 0 - local requiredVersion="$1" - local versionOutput=$($NIX_DAEMON_PACKAGE/bin/nix daemon --version) - local daemonVersion=${versionOutput##* } - [[ $(nix eval --expr "builtins.compareVersions ''$daemonVersion'' ''$requiredVersion''") -ge 0 ]] + [[ -n "${NIX_DAEMON_PACKAGE:-}" ]] || return 0 + local requiredVersion="$1" + local versionOutput + versionOutput=$("$NIX_DAEMON_PACKAGE/bin/nix" daemon --version) + local daemonVersion=${versionOutput##* } + if [[ ! $daemonVersion =~ [[:digit:]]+\.[[:digit:]]+\..* ]]; then + fail "Daemon version '$daemonVersion' does not look plausible, this is a testsuite bug!" + fi + [[ $(nix eval --expr "builtins.compareVersions ''$daemonVersion'' ''$requiredVersion''") -ge 0 ]] } skipTest () { |