diff --git a/tests/overlay-local-store/common.sh b/tests/overlay-local-store/common.sh index 2fba2e7f6..6aec96ba1 100644 --- a/tests/overlay-local-store/common.sh +++ b/tests/overlay-local-store/common.sh @@ -13,26 +13,29 @@ setupConfig () { } storeDirs () { - storeA="$TEST_ROOT/store-a" - storeBTop="$TEST_ROOT/store-b" - storeB="local-overlay?root=$TEST_ROOT/merged-store&lower-store=$storeA&upper-layer=$storeBTop" + storesRoot="$TEST_ROOT/stores" + mkdir -p "$storesRoot" + mount -t tmpfs tmpfs "$storesRoot" + storeA="$storesRoot/store-a" + storeBTop="$storesRoot/store-b" + storeB="local-overlay?root=$storesRoot/merged-store&lower-store=$storeA&upper-layer=$storeBTop" # Creating testing directories - mkdir -p "$TEST_ROOT"/{store-a/nix/store,store-b,merged-store/nix/store,workdir} + mkdir -p "$storesRoot"/{store-a/nix/store,store-b,merged-store/nix/store,workdir} } # Mounting Overlay Store mountOverlayfs () { - mergedStorePath="$TEST_ROOT/merged-store/nix/store" + mergedStorePath="$storesRoot/merged-store/nix/store" mount -t overlay overlay \ -o lowerdir="$storeA/nix/store" \ -o upperdir="$storeBTop" \ - -o workdir="$TEST_ROOT/workdir" \ + -o workdir="$storesRoot/workdir" \ "$mergedStorePath" \ || skipTest "overlayfs is not supported" cleanupOverlay () { - umount "$TEST_ROOT/merged-store/nix/store" - rm -r $TEST_ROOT/workdir + umount "$storesRoot/merged-store/nix/store" + rm -r $storesRoot/workdir } trap cleanupOverlay EXIT } diff --git a/tests/overlay-local-store/optimise-inner.sh b/tests/overlay-local-store/optimise-inner.sh index 2b778b311..079e22326 100755 --- a/tests/overlay-local-store/optimise-inner.sh +++ b/tests/overlay-local-store/optimise-inner.sh @@ -17,7 +17,7 @@ initLowerStore mountOverlayfs # Create a file to add to store -dupFilePath="$TEST_ROOT/dup-file" +dupFilePath="$storesRoot/dup-file" echo Duplicate > "$dupFilePath" # Add it to the overlay store (it will be written to the upper layer)