Add some tests for nix store ping

Always good to have :)
This commit is contained in:
regnat 2022-01-26 11:01:25 +01:00
parent 4f24a33d34
commit d139474f48
2 changed files with 13 additions and 0 deletions

View file

@ -62,6 +62,7 @@ nix_tests = \
ca/nix-copy.sh \
eval-store.sh \
readfile-context.sh \
store-ping.sh \
why-depends.sh
# parallel.sh

12
tests/store-ping.sh Normal file
View file

@ -0,0 +1,12 @@
source common.sh
STORE_INFO=$(nix store ping 2>&1)
echo "$STORE_INFO" | grep "Store URL: ${NIX_REMOTE}"
if isDaemonNewer "2.7pre20220126"; then
echo "$STORE_INFO" | grep "Version: $($NIX_DAEMON_PACKAGE/bin/nix-daemon --version)"
fi
expect 127 NIX_REMOTE=unix:$PWD/store nix store ping || \
fail "nix store ping on a non-existent store should fail"