Skip to content

Commit 7671b63

Browse files
committed
Add test
1 parent 75d8479 commit 7671b63

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

tests/functional/binary-cache.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,13 +233,23 @@ mkdir "$narCache"
233233

234234
[[ $(nix store cat --store "file://$cacheDir?local-nar-cache=$narCache" "$outPath/foobar") = FOOBAR ]]
235235

236-
rm -rfv "$cacheDir/nar"
236+
mv "$cacheDir/nar" "$cacheDir/nar2"
237237

238238
[[ $(nix store cat --store "file://$cacheDir?local-nar-cache=$narCache" "$outPath/foobar") = FOOBAR ]]
239239

240240
(! nix store cat --store "file://$cacheDir" "$outPath/foobar")
241241

242242

243+
# Check substitution from the local NAR cache.
244+
clearStore
245+
rm -rf "$narCache" "$cacheDir/nar"
246+
mv "$cacheDir/nar2" "$cacheDir/nar"
247+
nix-store -r --substituters "file://$cacheDir?local-nar-cache=$narCache" --no-require-sigs "$outPath"
248+
mv "$cacheDir/nar" "$cacheDir/nar2"
249+
clearStore
250+
nix-store -r --substituters "file://$cacheDir?local-nar-cache=$narCache" --no-require-sigs "$outPath"
251+
252+
243253
# Test NAR listing generation.
244254
clearCache
245255

0 commit comments

Comments
 (0)