Merge pull request #5995 from NixOS/test-nix-store-ping

Add some tests for `nix store ping`
This commit is contained in:
Eelco Dolstra 2022-01-26 11:50:04 +01:00 committed by GitHub
commit e9d2ac6d7f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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"