2023-05-16 06:00:18 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -eu -o pipefail
|
|
|
|
|
|
|
|
set -x
|
|
|
|
|
|
|
|
source common.sh
|
|
|
|
|
2023-07-13 22:39:46 +03:00
|
|
|
# Avoid store dir being inside sandbox build-dir
|
2023-07-20 13:03:14 +03:00
|
|
|
unset NIX_STORE_DIR
|
2023-07-13 22:39:46 +03:00
|
|
|
unset NIX_STATE_DIR
|
|
|
|
|
2023-12-11 20:30:40 +02:00
|
|
|
setupStoreDirs
|
2023-05-16 06:00:18 +03: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 13:03:14 +03:00
|
|
|
expect 1 stat $(toRealPath "$storeBTop" "$path")
|