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-18 12:49:44 +03:00
|
|
|
unset NIX_STORE_DIR # TODO: This causes toRealPath to fail (it expects this var to be set)
|
2023-07-13 22:39:46 +03:00
|
|
|
unset NIX_STATE_DIR
|
|
|
|
|
2023-05-16 06:00:18 +03:00
|
|
|
storeDirs
|
|
|
|
|
|
|
|
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-18 12:49:44 +03:00
|
|
|
expect 1 stat $(toRealPath "$storeB/nix/store" "$path") # TODO: Check this is failing for the right reason.
|
|
|
|
# $storeB is a store URI not a directory path
|