1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-08 19:46:02 +01:00

shellcheck fix: tests/functional/local-overlay-store/delete-refs-inner.sh

This commit is contained in:
Farid Zakaria 2025-09-28 20:32:12 -07:00
parent 62b36eba11
commit 326d626ad7
3 changed files with 10 additions and 10 deletions

View file

@ -132,8 +132,6 @@
''^tests/functional/local-overlay-store/common\.sh$''
''^tests/functional/local-overlay-store/delete-duplicate-inner\.sh$''
''^tests/functional/local-overlay-store/delete-duplicate\.sh$''
''^tests/functional/local-overlay-store/delete-refs-inner\.sh$''
''^tests/functional/local-overlay-store/delete-refs\.sh$''
''^tests/functional/logging\.sh$''
''^tests/functional/misc\.sh$''
''^tests/functional/multiple-outputs\.sh$''

View file

@ -15,6 +15,7 @@ initLowerStore
mountOverlayfs
export NIX_REMOTE="$storeB"
# shellcheck disable=SC2034
stateB="$storeBRoot/nix/var/nix"
hermetic=$(nix-build ../hermetic.nix --no-out-link --arg busybox "$busybox" --arg withFinalRefs true --arg seed 2)
input1=$(nix-build ../hermetic.nix --no-out-link --arg busybox "$busybox" --arg withFinalRefs true --arg seed 2 -A passthru.input1 -j0)
@ -22,18 +23,18 @@ input2=$(nix-build ../hermetic.nix --no-out-link --arg busybox "$busybox" --arg
input3=$(nix-build ../hermetic.nix --no-out-link --arg busybox "$busybox" --arg withFinalRefs true --arg seed 2 -A passthru.input3 -j0)
# Can't delete because referenced
expectStderr 1 nix-store --delete $input1 | grepQuiet "Cannot delete path"
expectStderr 1 nix-store --delete $input2 | grepQuiet "Cannot delete path"
expectStderr 1 nix-store --delete $input3 | grepQuiet "Cannot delete path"
expectStderr 1 nix-store --delete "$input1" | grepQuiet "Cannot delete path"
expectStderr 1 nix-store --delete "$input2" | grepQuiet "Cannot delete path"
expectStderr 1 nix-store --delete "$input3" | grepQuiet "Cannot delete path"
# These same paths are referenced in the lower layer (by the seed 1
# build done in `initLowerStore`).
expectStderr 1 nix-store --store "$storeA" --delete $input2 | grepQuiet "Cannot delete path"
expectStderr 1 nix-store --store "$storeA" --delete $input3 | grepQuiet "Cannot delete path"
expectStderr 1 nix-store --store "$storeA" --delete "$input2" | grepQuiet "Cannot delete path"
expectStderr 1 nix-store --store "$storeA" --delete "$input3" | grepQuiet "Cannot delete path"
# Can delete
nix-store --delete $hermetic
nix-store --delete "$hermetic"
# Now unreferenced in upper layer, can delete
nix-store --delete $input3
nix-store --delete $input2
nix-store --delete "$input3"
nix-store --delete "$input2"

View file

@ -1,3 +1,4 @@
# shellcheck shell=bash
source common.sh
source ../common/init.sh