about summary refs log tree commit diff
path: root/tests/fetchurl.sh
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-10-30T11·33+0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-10-30T11·34+0100
commit1f735a34406c1856fd2f6f9a522a06b429c4f799 (patch)
tree0d3495cc6cb753b5b241ceb2d85ff98f831e37ec /tests/fetchurl.sh
parentdae5dc7ade60aa6a9a05e41133da7faebe6bdc1b (diff)
<nix/fetchurl.nix>: Support xz-compressed NARs
Diffstat (limited to 'tests/fetchurl.sh')
-rw-r--r--tests/fetchurl.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/fetchurl.sh b/tests/fetchurl.sh
index 495d42a2568a..b6fa3a27edd8 100644
--- a/tests/fetchurl.sh
+++ b/tests/fetchurl.sh
@@ -2,12 +2,14 @@ source common.sh
 
 clearStore
 
+# Test fetching a flat file.
 hash=$(nix-hash --flat --type sha256 ./fetchurl.sh)
 
 outPath=$(nix-build '<nix/fetchurl.nix>' --argstr url file://$(pwd)/fetchurl.sh --argstr sha256 $hash --no-out-link)
 
 cmp $outPath fetchurl.sh
 
+# Test unpacking a NAR.
 rm -rf $TEST_ROOT/archive
 mkdir -p $TEST_ROOT/archive
 cp ./fetchurl.sh $TEST_ROOT/archive
@@ -25,3 +27,15 @@ echo $outPath | grep -q 'xyzzy'
 
 test -x $outPath/fetchurl.sh
 test -L $outPath/symlink
+
+nix-store --delete $outPath
+
+# Test unpacking a compressed NAR.
+narxz=$TEST_ROOT/archive.nar.xz
+rm -f $narxz
+xz --keep $nar
+outPath=$(nix-build '<nix/fetchurl.nix>' --argstr url file://$narxz --argstr sha256 $hash \
+          --arg unpack true --argstr name xyzzy --no-out-link)
+
+test -x $outPath/fetchurl.sh
+test -L $outPath/symlink