mirror of
https://github.com/NixOS/nix
synced 2025-07-10 04:43:53 +02:00
Split tests some more
Good for parallelism and easier reading.
This commit is contained in:
parent
97deb00cbc
commit
5d18120ba8
8 changed files with 81 additions and 39 deletions
|
@ -1,23 +1,23 @@
|
|||
source ../common.sh
|
||||
|
||||
requireEnvironment () {
|
||||
requireSandboxSupport
|
||||
[[ $busybox =~ busybox ]] || skipTest "no busybox"
|
||||
if [[ $(uname) != Linux ]]; then skipTest "Need Linux for overlayfs"; fi
|
||||
needLocalStore "The test uses --store always so we would just be bypassing the daemon"
|
||||
requireSandboxSupport
|
||||
[[ $busybox =~ busybox ]] || skipTest "no busybox"
|
||||
if [[ $(uname) != Linux ]]; then skipTest "Need Linux for overlayfs"; fi
|
||||
needLocalStore "The test uses --store always so we would just be bypassing the daemon"
|
||||
}
|
||||
|
||||
setupConfig () {
|
||||
echo "drop-supplementary-groups = false" >> "$NIX_CONF_DIR"/nix.conf
|
||||
echo "build-users-group = " >> "$NIX_CONF_DIR"/nix.conf
|
||||
echo "drop-supplementary-groups = false" >> "$NIX_CONF_DIR"/nix.conf
|
||||
echo "build-users-group = " >> "$NIX_CONF_DIR"/nix.conf
|
||||
}
|
||||
|
||||
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"
|
||||
# Creating testing directories
|
||||
mkdir -p "$TEST_ROOT"/{store-a/nix/store,store-b,merged-store/nix/store,workdir}
|
||||
storeA="$TEST_ROOT/store-a"
|
||||
storeBTop="$TEST_ROOT/store-b"
|
||||
storeB="local-overlay?root=$TEST_ROOT/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}
|
||||
}
|
||||
|
||||
# Mounting Overlay Store
|
||||
|
@ -50,3 +50,7 @@ initLowerStore () {
|
|||
drvPath=$(nix-instantiate --store $storeA ../hermetic.nix --arg busybox "$busybox" --arg seed 1)
|
||||
path=$(nix-store --store "$storeA" --realise $drvPath)
|
||||
}
|
||||
|
||||
execUnshare () {
|
||||
exec unshare --mount --map-root-user "$@"
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue