From d139474f484ef16850e0d6d3f8706c5bd1f352d0 Mon Sep 17 00:00:00 2001 From: regnat Date: Wed, 26 Jan 2022 11:01:25 +0100 Subject: [PATCH] Add some tests for `nix store ping` Always good to have :) --- tests/local.mk | 1 + tests/store-ping.sh | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 tests/store-ping.sh diff --git a/tests/local.mk b/tests/local.mk index 93cf20d43..47d2862a4 100644 --- a/tests/local.mk +++ b/tests/local.mk @@ -62,6 +62,7 @@ nix_tests = \ ca/nix-copy.sh \ eval-store.sh \ readfile-context.sh \ + store-ping.sh \ why-depends.sh # parallel.sh diff --git a/tests/store-ping.sh b/tests/store-ping.sh new file mode 100644 index 000000000..4e8c8b770 --- /dev/null +++ b/tests/store-ping.sh @@ -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"