From 1f735a34406c1856fd2f6f9a522a06b429c4f799 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 30 Oct 2015 12:33:40 +0100 Subject: : Support xz-compressed NARs --- tests/fetchurl.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests') 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 '' --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 '' --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 -- cgit 1.4.1