aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-02-12 10:33:16 +0100
committerEelco Dolstra <edolstra@gmail.com>2020-02-12 10:33:52 +0100
commit9659940659b36ffab3cbd1eff9f343c9ada2491b (patch)
tree5e05c8a4a831b331e1ae24830abb91fff0bc2af2 /tests
parent26dacc09837cb5226b7d97ed70a0fbade5e40304 (diff)
Test narHash mismatch
Diffstat (limited to 'tests')
-rw-r--r--tests/tarball.sh1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/tarball.sh b/tests/tarball.sh
index 7c8896b2e..f43bd6e71 100644
--- a/tests/tarball.sh
+++ b/tests/tarball.sh
@@ -30,6 +30,7 @@ test_tarball() {
nix-build -o $TEST_ROOT/result -E "import (fetchTree file://$tarball)"
nix-build -o $TEST_ROOT/result -E "import (fetchTree { type = \"tarball\"; url = file://$tarball; })"
nix-build -o $TEST_ROOT/result -E "import (fetchTree { type = \"tarball\"; url = file://$tarball; narHash = \"$hash\"; })"
+ nix-build -o $TEST_ROOT/result -E "import (fetchTree { type = \"tarball\"; url = file://$tarball; narHash = \"sha256-xdKv2pq/IiwLSnBBJXW8hNowI4MrdZfW+SYqDQs7Tzc=\"; })" 2>&1 | grep 'NAR hash mismatch in input'
nix-instantiate --eval -E '1 + 2' -I fnord=file://no-such-tarball.tar$ext
nix-instantiate --eval -E 'with <fnord/xyzzy>; 1 + 2' -I fnord=file://no-such-tarball$ext