aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2023-08-29 17:02:06 +0200
committerGitHub <noreply@github.com>2023-08-29 17:02:06 +0200
commit5b5f56a9d487274c1498aa4852bcf80b44c7acd0 (patch)
tree0be78e6ab5927fcc5ad05ce99c1e5192f29f406b /tests
parent151120a1ae082c6460f9a54cf795c57d154f6c27 (diff)
parent56763ff918eb308db23080e560ed2ea3e00c80a7 (diff)
Merge pull request #8859 from edolstra/tarball-last-modified
Tarball trees: Propagate lastModified
Diffstat (limited to 'tests')
-rw-r--r--tests/tarball.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/tarball.sh b/tests/tarball.sh
index 5f39658c9..6e621a28c 100644
--- a/tests/tarball.sh
+++ b/tests/tarball.sh
@@ -9,6 +9,7 @@ rm -rf $tarroot
mkdir -p $tarroot
cp dependencies.nix $tarroot/default.nix
cp config.nix dependencies.builder*.sh $tarroot/
+touch -d '@1000000000' $tarroot $tarroot/*
hash=$(nix hash path $tarroot)
@@ -36,6 +37,8 @@ test_tarball() {
nix-build -o $TEST_ROOT/result -E "import (fetchTree { type = \"tarball\"; url = file:///does-not-exist/must-remain-unused/$tarball; narHash = \"$hash\"; })"
expectStderr 102 nix-build -o $TEST_ROOT/result -E "import (fetchTree { type = \"tarball\"; url = file://$tarball; narHash = \"sha256-xdKv2pq/IiwLSnBBJXW8hNowI4MrdZfW+SYqDQs7Tzc=\"; })" | grep 'NAR hash mismatch in input'
+ [[ $(nix eval --impure --expr "(fetchTree file://$tarball).lastModified") = 1000000000 ]]
+
nix-instantiate --strict --eval -E "!((import (fetchTree { type = \"tarball\"; url = file://$tarball; narHash = \"$hash\"; })) ? submodules)" >&2
nix-instantiate --strict --eval -E "!((import (fetchTree { type = \"tarball\"; url = file://$tarball; narHash = \"$hash\"; })) ? submodules)" 2>&1 | grep 'true'