mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 08:16:15 +02:00
Have verify test exercise check-contents too.
This commit is contained in:
parent
0ccf6382af
commit
58085e4eff
1 changed files with 16 additions and 9 deletions
|
@ -16,17 +16,24 @@ initLowerStore
|
|||
|
||||
mountOverlayfs
|
||||
|
||||
#path=$(nix-store --store "$storeB" --add ../dummy)
|
||||
# Realise a derivation from the lower store to propagate paths to overlay DB
|
||||
nix-store --store "$storeB" --realise $drvPath
|
||||
|
||||
path=$(nix-build --store $storeB ../hermetic.nix --arg busybox "$busybox" --arg seed 1)
|
||||
# Also ensure dummy file exists in overlay DB
|
||||
dummyPath=$(nix-store --store "$storeB" --add ../dummy)
|
||||
|
||||
inputDrvPath=$(find "$storeA" -name "*-hermetic-input-1.drv")
|
||||
rm -v "$inputDrvPath"
|
||||
# Verify should be successful at this point
|
||||
nix-store --store "$storeB" --verify --check-contents
|
||||
|
||||
#tree "$TEST_ROOT"
|
||||
# Now delete one of the derivation inputs in the lower store
|
||||
inputDrvFullPath=$(find "$storeA" -name "*-hermetic-input-1.drv")
|
||||
inputDrvPath=${inputDrvFullPath/*\/nix\/store\///nix/store/}
|
||||
rm -v "$inputDrvFullPath"
|
||||
|
||||
#rm -v "$TEST_ROOT/store-a/$path"
|
||||
# And truncate the contents of dummy file in lower store
|
||||
find "$storeA" -name "*-dummy" -exec truncate -s 0 {} \;
|
||||
|
||||
nix-store --store "$storeB" --verify
|
||||
|
||||
echo "SUCCESS"
|
||||
# Verify should fail with the messages about missing input and modified dummy file
|
||||
verifyOutput=$(expectStderr 1 nix-store --store "$storeB" --verify --check-contents)
|
||||
<<<"$verifyOutput" grepQuiet "path '$inputDrvPath' disappeared, but it still has valid referrers!"
|
||||
<<<"$verifyOutput" grepQuiet "path '$dummyPath' was modified! expected hash"
|
||||
|
|
Loading…
Reference in a new issue