From 143a5f32ed2ce37ce6edddf36ed7ed984532541f Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 13 Jul 2020 16:01:00 +0200 Subject: [PATCH] Add a test for local NAR caching --- tests/binary-cache.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/binary-cache.sh b/tests/binary-cache.sh index 17d7a2df6..40f1a4f76 100644 --- a/tests/binary-cache.sh +++ b/tests/binary-cache.sh @@ -191,6 +191,20 @@ unset _NIX_FORCE_HTTP nix verify -vvvvv --all --store file://$cacheDir --no-trust +# Test local NAR caching. +narCache=$TEST_ROOT/nar-cache +rm -rf $narCache +mkdir $narCache + +[[ $(nix cat-store --store "file://$cacheDir?local-nar-cache=$narCache" $outPath/foobar) = FOOBAR ]] + +rm -rfv "$cacheDir/nar" + +[[ $(nix cat-store --store "file://$cacheDir?local-nar-cache=$narCache" $outPath/foobar) = FOOBAR ]] + +(! nix cat-store --store file://$cacheDir $outPath/foobar) + + # Test NAR listing generation. clearCache