aboutsummaryrefslogtreecommitdiff
path: root/tests/binary-cache.sh
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-07-13 16:01:00 +0200
committerEelco Dolstra <edolstra@gmail.com>2020-07-13 16:25:48 +0200
commit143a5f32ed2ce37ce6edddf36ed7ed984532541f (patch)
tree1dda64a78a05245e9758088438057b7e66371bc1 /tests/binary-cache.sh
parent1d01ae816b80eaefb0996a9605d00a3031ecd4d9 (diff)
Add a test for local NAR caching
Diffstat (limited to 'tests/binary-cache.sh')
-rw-r--r--tests/binary-cache.sh14
1 files changed, 14 insertions, 0 deletions
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