about summary refs log tree commit diff
path: root/tests/substitutes2.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/substitutes2.sh')
-rw-r--r--tests/substitutes2.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/substitutes2.sh b/tests/substitutes2.sh
new file mode 100644
index 000000000000..bd914575cca8
--- /dev/null
+++ b/tests/substitutes2.sh
@@ -0,0 +1,21 @@
+source common.sh
+
+clearStore
+
+# Instantiate.
+drvPath=$(nix-instantiate simple.nix)
+echo "derivation is $drvPath"
+
+# Find the output path.
+outPath=$(nix-store -qvvvvv "$drvPath")
+echo "output path is $outPath"
+
+echo $outPath > $TEST_ROOT/sub-paths
+
+# First try a substituter that fails, then one that succeeds
+export NIX_SUBSTITUTERS=$(pwd)/substituter2.sh:$(pwd)/substituter.sh
+
+nix-store -j0 -rvv "$drvPath"
+
+text=$(cat "$outPath"/hello)
+if test "$text" != "Hallo Wereld"; then echo "wrong substitute output: $text"; exit 1; fi