mirror of
https://github.com/NixOS/nix
synced 2025-07-08 19:23:54 +02:00
Implement test for store path deduplication.
This commit is contained in:
parent
614efc1240
commit
a9510f9502
2 changed files with 39 additions and 10 deletions
|
@ -22,11 +22,12 @@ storeDirs () {
|
|||
|
||||
# Mounting Overlay Store
|
||||
mountOverlayfs () {
|
||||
mergedStorePath="$TEST_ROOT/merged-store/nix/store"
|
||||
mount -t overlay overlay \
|
||||
-o lowerdir="$storeA/nix/store" \
|
||||
-o upperdir="$storeBTop" \
|
||||
-o workdir="$TEST_ROOT/workdir" \
|
||||
"$TEST_ROOT/merged-store/nix/store" \
|
||||
"$mergedStorePath" \
|
||||
|| skipTest "overlayfs is not supported"
|
||||
|
||||
cleanupOverlay () {
|
||||
|
@ -36,6 +37,10 @@ mountOverlayfs () {
|
|||
trap cleanupOverlay EXIT
|
||||
}
|
||||
|
||||
remountOverlayfs () {
|
||||
mount -o remount "$mergedStorePath"
|
||||
}
|
||||
|
||||
toRealPath () {
|
||||
storeDir=$1; shift
|
||||
storePath=$1; shift
|
||||
|
@ -54,12 +59,3 @@ initLowerStore () {
|
|||
execUnshare () {
|
||||
exec unshare --mount --map-root-user "$@"
|
||||
}
|
||||
|
||||
addTextToStore() {
|
||||
storeDir=$1; shift
|
||||
filename=$1; shift
|
||||
content=$1; shift
|
||||
filePath="$TEST_HOME/$filename"
|
||||
echo "$content" > "$filePath"
|
||||
nix-store --store "$storeDir" --add "$filePath"
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue