aboutsummaryrefslogtreecommitdiff
path: root/tests/functional/local-store.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional/local-store.sh')
-rw-r--r--tests/functional/local-store.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/functional/local-store.sh b/tests/functional/local-store.sh
new file mode 100644
index 000000000..89502f864
--- /dev/null
+++ b/tests/functional/local-store.sh
@@ -0,0 +1,22 @@
+source common.sh
+
+cd $TEST_ROOT
+
+echo example > example.txt
+mkdir -p ./x
+
+NIX_STORE_DIR=$TEST_ROOT/x
+
+CORRECT_PATH=$(nix-store --store ./x --add example.txt)
+
+PATH1=$(nix path-info --store ./x $CORRECT_PATH)
+[ $CORRECT_PATH == $PATH1 ]
+
+PATH2=$(nix path-info --store "$PWD/x" $CORRECT_PATH)
+[ $CORRECT_PATH == $PATH2 ]
+
+PATH3=$(nix path-info --store "local?root=$PWD/x" $CORRECT_PATH)
+[ $CORRECT_PATH == $PATH3 ]
+
+# Ensure store ping trusted works with local store
+nix --store ./x store ping --json | jq -e '.trusted'