mirror of
https://github.com/NixOS/nix.git
synced 2025-11-09 03:56:01 +01:00
shellcheck fix: tests/functional/local-overlay-store/common.sh
This commit is contained in:
parent
20665e1c3d
commit
bb97f4b07a
2 changed files with 10 additions and 5 deletions
|
|
@ -129,7 +129,6 @@
|
||||||
''^tests/functional/local-overlay-store/build\.sh$''
|
''^tests/functional/local-overlay-store/build\.sh$''
|
||||||
''^tests/functional/local-overlay-store/check-post-init-inner\.sh$''
|
''^tests/functional/local-overlay-store/check-post-init-inner\.sh$''
|
||||||
''^tests/functional/local-overlay-store/check-post-init\.sh$''
|
''^tests/functional/local-overlay-store/check-post-init\.sh$''
|
||||||
''^tests/functional/local-overlay-store/common\.sh$''
|
|
||||||
''^tests/functional/logging\.sh$''
|
''^tests/functional/logging\.sh$''
|
||||||
''^tests/functional/misc\.sh$''
|
''^tests/functional/misc\.sh$''
|
||||||
''^tests/functional/multiple-outputs\.sh$''
|
''^tests/functional/multiple-outputs\.sh$''
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
# shellcheck shell=bash
|
||||||
source ../common/vars.sh
|
source ../common/vars.sh
|
||||||
source ../common/functions.sh
|
source ../common/functions.sh
|
||||||
|
|
||||||
|
|
@ -54,6 +55,7 @@ setupStoreDirs () {
|
||||||
storeA="$storeVolume/store-a"
|
storeA="$storeVolume/store-a"
|
||||||
storeBTop="$storeVolume/store-b"
|
storeBTop="$storeVolume/store-b"
|
||||||
storeBRoot="$storeVolume/merged-store"
|
storeBRoot="$storeVolume/merged-store"
|
||||||
|
# shellcheck disable=SC2034
|
||||||
storeB="local-overlay://?root=$storeBRoot&lower-store=$storeA&upper-layer=$storeBTop"
|
storeB="local-overlay://?root=$storeBRoot&lower-store=$storeA&upper-layer=$storeBTop"
|
||||||
# Creating testing directories
|
# Creating testing directories
|
||||||
mkdir -p "$storeVolume"/{store-a/nix/store,store-b,merged-store/nix/store,workdir}
|
mkdir -p "$storeVolume"/{store-a/nix/store,store-b,merged-store/nix/store,workdir}
|
||||||
|
|
@ -69,8 +71,10 @@ mountOverlayfs () {
|
||||||
|| skipTest "overlayfs is not supported"
|
|| skipTest "overlayfs is not supported"
|
||||||
|
|
||||||
cleanupOverlay () {
|
cleanupOverlay () {
|
||||||
|
# shellcheck disable=2317
|
||||||
umount -n "$storeBRoot/nix/store"
|
umount -n "$storeBRoot/nix/store"
|
||||||
rm -r $storeVolume/workdir
|
# shellcheck disable=2317
|
||||||
|
rm -r "$storeVolume"/workdir
|
||||||
}
|
}
|
||||||
trap cleanupOverlay EXIT
|
trap cleanupOverlay EXIT
|
||||||
}
|
}
|
||||||
|
|
@ -82,7 +86,8 @@ remountOverlayfs () {
|
||||||
toRealPath () {
|
toRealPath () {
|
||||||
storeDir=$1; shift
|
storeDir=$1; shift
|
||||||
storePath=$1; shift
|
storePath=$1; shift
|
||||||
echo $storeDir$(echo $storePath | sed "s^${NIX_STORE_DIR:-/nix/store}^^")
|
# shellcheck disable=SC2001
|
||||||
|
echo "$storeDir""$(echo "$storePath" | sed "s^${NIX_STORE_DIR:-/nix/store}^^")"
|
||||||
}
|
}
|
||||||
|
|
||||||
initLowerStore () {
|
initLowerStore () {
|
||||||
|
|
@ -90,8 +95,9 @@ initLowerStore () {
|
||||||
nix-store --store "$storeA" --add ../dummy
|
nix-store --store "$storeA" --add ../dummy
|
||||||
|
|
||||||
# Build something in lower store
|
# Build something in lower store
|
||||||
drvPath=$(nix-instantiate --store $storeA ../hermetic.nix --arg withFinalRefs true --arg busybox "$busybox" --arg seed 1)
|
drvPath=$(nix-instantiate --store "$storeA" ../hermetic.nix --arg withFinalRefs true --arg busybox "$busybox" --arg seed 1)
|
||||||
pathInLowerStore=$(nix-store --store "$storeA" --realise $drvPath)
|
# shellcheck disable=SC2034
|
||||||
|
pathInLowerStore=$(nix-store --store "$storeA" --realise "$drvPath")
|
||||||
}
|
}
|
||||||
|
|
||||||
addTextToStore() {
|
addTextToStore() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue