about summary refs log tree commit diff
path: root/tests/substitutes.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/substitutes.sh')
-rw-r--r--tests/substitutes.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/substitutes.sh b/tests/substitutes.sh
new file mode 100644
index 000000000000..0c6adf2601fa
--- /dev/null
+++ b/tests/substitutes.sh
@@ -0,0 +1,22 @@
+source common.sh
+
+clearStore
+
+# Instantiate.
+drvPath=$(nix-instantiate simple.nix)
+echo "derivation is $drvPath"
+
+# Find the output path.
+outPath=$(nix-store -qvv "$drvPath")
+echo "output path is $outPath"
+
+echo $outPath > $TEST_ROOT/sub-paths
+
+export NIX_SUBSTITUTERS=$(pwd)/substituter.sh
+
+nix-store -r "$drvPath" --dry-run 2>&1 | grep -q "1.00 MiB.*2.00 MiB"
+
+nix-store -rvv "$drvPath"
+
+text=$(cat "$outPath"/hello)
+if test "$text" != "Hallo Wereld"; then echo "wrong substitute output: $text"; exit 1; fi