From b6bb869e52bc4990aeac09aa64025e66e02b780e Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Mon, 4 Mar 2024 08:17:32 +0100 Subject: [PATCH] Merge pull request #9632 from cole-h/nix-daemon-testing Use `nix daemon` in the test suite (cherry picked from commit e6e160a0758c0354ed810b0ec9846ed885adcc11) Change-Id: I537a25d3d48f609cd77b2c3a8ad68e87aebabfe8 --- tests/functional/common/vars-and-functions.sh.in | 4 ++-- tests/functional/store-ping.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/functional/common/vars-and-functions.sh.in b/tests/functional/common/vars-and-functions.sh.in index 0bde0180f..b054bf834 100644 --- a/tests/functional/common/vars-and-functions.sh.in +++ b/tests/functional/common/vars-and-functions.sh.in @@ -96,7 +96,7 @@ startDaemon() { fi # Start the daemon, wait for the socket to appear. rm -f $NIX_DAEMON_SOCKET_PATH - PATH=$DAEMON_PATH nix-daemon & + PATH=$DAEMON_PATH nix --extra-experimental-features 'nix-command' daemon & _NIX_TEST_DAEMON_PID=$! export _NIX_TEST_DAEMON_PID for ((i = 0; i < 300; i++)); do @@ -149,7 +149,7 @@ fi isDaemonNewer () { [[ -n "${NIX_DAEMON_PACKAGE:-}" ]] || return 0 local requiredVersion="$1" - local daemonVersion=$($NIX_DAEMON_PACKAGE/bin/nix-daemon --version | cut -d' ' -f3) + local daemonVersion=$($NIX_DAEMON_PACKAGE/bin/nix daemon --version | cut -d' ' -f3) [[ $(nix eval --expr "builtins.compareVersions ''$daemonVersion'' ''$requiredVersion''") -ge 0 ]] } diff --git a/tests/functional/store-ping.sh b/tests/functional/store-ping.sh index 9846c7d3d..d84247ad5 100644 --- a/tests/functional/store-ping.sh +++ b/tests/functional/store-ping.sh @@ -6,7 +6,7 @@ STORE_INFO_JSON=$(nix store ping --json) echo "$STORE_INFO" | grep "Store URL: ${NIX_REMOTE}" if [[ -v NIX_DAEMON_PACKAGE ]] && isDaemonNewer "2.7.0pre20220126"; then - DAEMON_VERSION=$($NIX_DAEMON_PACKAGE/bin/nix-daemon --version | cut -d' ' -f3) + DAEMON_VERSION=$($NIX_DAEMON_PACKAGE/bin/nix daemon --version | cut -d' ' -f3) echo "$STORE_INFO" | grep "Version: $DAEMON_VERSION" [[ "$(echo "$STORE_INFO_JSON" | jq -r ".version")" == "$DAEMON_VERSION" ]] fi