Skip to content

Commit 1fa5d7e

Browse files
committed
Add test
1 parent 83d5f2f commit 1fa5d7e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tests/functional/binary-cache.sh

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

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

230-
rm -rfv "$cacheDir/nar"
230+
mv "$cacheDir/nar" "$cacheDir/nar2"
231231

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

234234
(! nix store cat --store "file://$cacheDir" "$outPath/foobar")
235235

236236

237+
# Check substitution from the local NAR cache.
238+
clearStore
239+
rm -rf "$narCache" "$cacheDir/nar"
240+
mv "$cacheDir/nar2" "$cacheDir/nar"
241+
nix-store -r --substituters "file://$cacheDir?local-nar-cache=$narCache" --no-require-sigs "$outPath"
242+
mv "$cacheDir/nar" "$cacheDir/nar2"
243+
clearStore
244+
nix-store -r --substituters "file://$cacheDir?local-nar-cache=$narCache" --no-require-sigs "$outPath"
245+
246+
237247
# Test NAR listing generation.
238248
clearCache
239249

0 commit comments

Comments
 (0)