2023-05-16 03:00:18 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -eu -o pipefail
|
|
|
|
|
|
|
|
set -x
|
|
|
|
|
|
|
|
source common.sh
|
|
|
|
|
2023-07-13 19:39:46 +00:00
|
|
|
# Avoid store dir being inside sandbox build-dir
|
2023-07-20 10:03:14 +00:00
|
|
|
unset NIX_STORE_DIR
|
2023-07-13 19:39:46 +00:00
|
|
|
unset NIX_STATE_DIR
|
|
|
|
|
2023-12-11 18:30:40 +00:00
|
|
|
setupStoreDirs
|
2023-05-16 03:00:18 +00:00
|
|
|
|
|
|
|
initLowerStore
|
|
|
|
|
|
|
|
mountOverlayfs
|
|
|
|
|
|
|
|
### Do a redundant add
|
|
|
|
|
|
|
|
# upper layer should not have it
|
|
|
|
expect 1 stat $(toRealPath "$storeBTop/nix/store" "$path")
|
|
|
|
|
|
|
|
path=$(nix-store --store "$storeB" --add ../dummy)
|
|
|
|
|
|
|
|
# lower store should have it from before
|
|
|
|
stat $(toRealPath "$storeA/nix/store" "$path")
|
|
|
|
|
|
|
|
# upper layer should still not have it (no redundant copy)
|
2023-07-20 10:03:14 +00:00
|
|
|
expect 1 stat $(toRealPath "$storeBTop" "$path")
|