about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-06-01T13·27+0200
committerEelco Dolstra <edolstra@gmail.com>2019-06-01T13·27+0200
commitaec545c20b15eace71c6733107dd6fde7736afbe (patch)
tree92d39dcde117a6ee586e0db12f6035848157db7d /tests
parent5450af5d0db0fe90ae6e28f051d713b9925d7274 (diff)
Fix segfault in builtin fetchurl with hashed mirrors + SRI hashes
Diffstat (limited to 'tests')
-rw-r--r--tests/fetchurl.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/fetchurl.sh b/tests/fetchurl.sh
index ec3399b08d00..7319ced2b599 100644
--- a/tests/fetchurl.sh
+++ b/tests/fetchurl.sh
@@ -42,6 +42,10 @@ ln -s $(pwd)/fetchurl.sh $mirror/sha512/$hash32
 
 outPath=$(nix-build '<nix/fetchurl.nix>' --argstr url file:///no-such-dir/fetchurl.sh --argstr sha512 $hash --no-out-link --hashed-mirrors "file://$mirror")
 
+# Test hashed mirrors with an SRI hash.
+nix-build '<nix/fetchurl.nix>' --argstr url file:///no-such-dir/fetchurl.sh --argstr hash $(nix to-sri --type sha512 $hash) \
+          --argstr name bla --no-out-link --hashed-mirrors "file://$mirror"
+
 # Test unpacking a NAR.
 rm -rf $TEST_ROOT/archive
 mkdir -p $TEST_ROOT/archive