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/gc-inner.sh

This commit is contained in:
Farid Zakaria 2025-09-28 20:31:09 -07:00
parent 675179a510
commit 62b36eba11
2 changed files with 11 additions and 11 deletions

View file

@ -134,7 +134,6 @@
''^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/local-overlay-store/gc-inner\.sh$''
''^tests/functional/logging\.sh$''
''^tests/functional/misc\.sh$''
''^tests/functional/multiple-outputs\.sh$''

View file

@ -21,24 +21,24 @@ outPath=$(nix-build ../hermetic.nix --no-out-link --arg busybox "$busybox" --arg
# Set a GC root.
mkdir -p "$stateB"
rm -f "$stateB/gcroots/foo"
ln -sf $outPath "$stateB/gcroots/foo"
ln -sf "$outPath" "$stateB/gcroots/foo"
[ "$(nix-store -q --roots $outPath)" = "$stateB/gcroots/foo -> $outPath" ]
[ "$(nix-store -q --roots "$outPath")" = "$stateB/gcroots/foo -> $outPath" ]
nix-store --gc --print-roots | grep $outPath
nix-store --gc --print-live | grep $outPath
if nix-store --gc --print-dead | grep -E $outPath$; then false; fi
nix-store --gc --print-roots | grep "$outPath"
nix-store --gc --print-live | grep "$outPath"
if nix-store --gc --print-dead | grep -E "$outPath"$; then false; fi
nix-store --gc --print-dead
expect 1 nix-store --delete $outPath
expect 1 nix-store --delete "$outPath"
test -e "$storeBRoot/$outPath"
shopt -s nullglob
for i in $storeBRoot/*; do
for i in "$storeBRoot"/*; do
if [[ $i =~ /trash ]]; then continue; fi # compat with old daemon
touch $i.lock
touch $i.chroot
touch "$i".lock
touch "$i".chroot
done
nix-collect-garbage
@ -51,7 +51,8 @@ rm "$stateB/gcroots/foo"
nix-collect-garbage
# Check that the output has been GC'd.
test ! -e $outPath
test ! -e "$outPath"
# Check that the store is empty.
# shellcheck disable=SC2012
[ "$(ls -1 "$storeBTop" | wc -l)" = "0" ]