Fix tests after last rename (path -> pathInLowerStore)

This commit is contained in:
John Ericson 2023-12-11 13:48:42 -05:00
parent c90e46d3f0
commit 8d0a03b5a2
2 changed files with 15 additions and 15 deletions

View file

@ -19,13 +19,13 @@ mountOverlayfs
### Check status
# Checking for path in lower layer
stat $(toRealPath "$storeA/nix/store" "$path")
stat $(toRealPath "$storeA/nix/store" "$pathInLowerStore")
# Checking for path in upper layer (should fail)
expect 1 stat $(toRealPath "$storeBTop" "$path")
expect 1 stat $(toRealPath "$storeBTop" "$pathInLowerStore")
# Checking for path in overlay store matching lower layer
diff $(toRealPath "$storeA/nix/store" "$path") $(toRealPath "$storeBRoot/nix/store" "$path")
diff $(toRealPath "$storeA/nix/store" "$pathInLowerStore") $(toRealPath "$storeBRoot/nix/store" "$pathInLowerStore")
# Checking requisites query agreement
[[ \
@ -44,9 +44,9 @@ busyboxStore=$(nix store --store $storeA add-path $busybox)
# Checking derivers query agreement
[[ \
$(nix-store --store $storeA --query --deriver $path) \
$(nix-store --store $storeA --query --deriver $pathInLowerStore) \
== \
$(nix-store --store $storeB --query --deriver $path) \
$(nix-store --store $storeB --query --deriver $pathInLowerStore) \
]]
# Checking outputs query agreement
@ -57,15 +57,15 @@ busyboxStore=$(nix store --store $storeA add-path $busybox)
]]
# Verifying path in lower layer
nix-store --verify-path --store "$storeA" "$path"
nix-store --verify-path --store "$storeA" "$pathInLowerStore"
# Verifying path in merged-store
nix-store --verify-path --store "$storeB" "$path"
nix-store --verify-path --store "$storeB" "$pathInLowerStore"
hashPart=$(echo $path | sed "s^${NIX_STORE_DIR:-/nix/store}/^^" | sed 's/-.*//')
hashPart=$(echo $pathInLowerStore | sed "s^${NIX_STORE_DIR:-/nix/store}/^^" | sed 's/-.*//')
# Lower store can find from hash part
[[ $(nix store --store $storeA path-from-hash-part $hashPart) == $path ]]
[[ $(nix store --store $storeA path-from-hash-part $hashPart) == $pathInLowerStore ]]
# merged store can find from hash part
[[ $(nix store --store $storeB path-from-hash-part $hashPart) == $path ]]
[[ $(nix store --store $storeB path-from-hash-part $hashPart) == $pathInLowerStore ]]

View file

@ -19,17 +19,17 @@ mountOverlayfs
### Do a redundant add
# (Already done in `initLowerStore`, but repeated here for clarity.)
path=$(nix-store --store "$storeA" --add ../dummy)
pathInLowerStore=$(nix-store --store "$storeA" --add ../dummy)
# upper layer should not have it
expect 1 stat $(toRealPath "$storeBTop/nix/store" "$path")
expect 1 stat $(toRealPath "$storeBTop/nix/store" "$pathInLowerStore")
pathFromB=$(nix-store --store "$storeB" --add ../dummy)
[[ $path == $pathFromB ]]
[[ $pathInLowerStore == $pathFromB ]]
# lower store should have it from before
stat $(toRealPath "$storeA/nix/store" "$path")
stat $(toRealPath "$storeA/nix/store" "$pathInLowerStore")
# upper layer should still not have it (no redundant copy)
expect 1 stat $(toRealPath "$storeBTop" "$path")
expect 1 stat $(toRealPath "$storeBTop" "$pathInLowerStore")