about summary refs log tree commit diff
path: root/tests/fallback.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/fallback.sh')
-rw-r--r--tests/fallback.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/fallback.sh b/tests/fallback.sh
new file mode 100644
index 000000000000..5799775eb2f8
--- /dev/null
+++ b/tests/fallback.sh
@@ -0,0 +1,15 @@
+storeExpr=$($TOP/src/nix-instantiate/nix-instantiate fall-back.nix)
+
+echo "store expr is $storeExpr"
+
+# Register a non-existant successor (and a nox-existant substitute).
+suc=$NIX_STORE_DIR/deadbeafdeadbeafdeadbeafdeadbeaf-s.store
+(echo $suc && echo $NIX_STORE_DIR/ffffffffffffffffffffffffffffffff.store && echo "/bla" && echo 0) | $TOP/src/nix-store/nix-store --substitute
+$TOP/src/nix-store/nix-store --successor $storeExpr $suc
+
+outPath=$($TOP/src/nix-store/nix-store -qnf --fallback "$storeExpr")
+
+echo "output path is $outPath"
+
+text=$(cat "$outPath"/hello)
+if test "$text" != "Hello World!"; then exit 1; fi