about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-06-01T14·18+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-06-01T14·18+0200
commitbc51175dc0c5f5e2106e73779663e9942dd451c4 (patch)
tree167d524816bd16c9678e5cf7d199559db0e55668 /tests
parentda196ec68f8b34e0c4c7ee32beb9073b31b1531e (diff)
Add tarball tests
Diffstat (limited to 'tests')
-rw-r--r--tests/local.mk2
-rw-r--r--tests/tarball.sh20
2 files changed, 21 insertions, 1 deletions
diff --git a/tests/local.mk b/tests/local.mk
index 7a24fadcb8b9..03f53b44c275 100644
--- a/tests/local.mk
+++ b/tests/local.mk
@@ -11,7 +11,7 @@ nix_tests = \
   binary-patching.sh timeout.sh secure-drv-outputs.sh nix-channel.sh \
   multiple-outputs.sh import-derivation.sh fetchurl.sh optimise-store.sh \
   binary-cache.sh nix-profile.sh repair.sh dump-db.sh case-hack.sh \
-  check-reqs.sh pass-as-file.sh
+  check-reqs.sh pass-as-file.sh tarball.sh
   # parallel.sh
 
 install-tests += $(foreach x, $(nix_tests), tests/$(x))
diff --git a/tests/tarball.sh b/tests/tarball.sh
new file mode 100644
index 000000000000..6d02544cfae3
--- /dev/null
+++ b/tests/tarball.sh
@@ -0,0 +1,20 @@
+source common.sh
+
+clearStore
+
+tarroot=$TEST_ROOT/tarball
+rm -rf $tarroot
+mkdir -p $tarroot
+cp dependencies.nix $tarroot/default.nix
+cp config.nix dependencies.builder*.sh $tarroot/
+
+tarball=$TEST_ROOT/tarball.tar.xz
+(cd $TEST_ROOT && tar c tarball) | xz > $tarball
+
+nix-env -f file://$tarball -qa --out-path | grep -q dependencies
+
+nix-build file://$tarball
+
+nix-build '<foo>' -I foo=file://$tarball
+
+nix-build -E "import (fetchTarball file://$tarball)"