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/nix-copy-ssh-common.sh

This commit is contained in:
Farid Zakaria 2025-09-29 09:52:31 -07:00
parent 83e203fe45
commit c9fd721be9
2 changed files with 8 additions and 8 deletions

View file

@ -106,7 +106,6 @@
enable = true;
excludes = [
# We haven't linted these files yet
''^tests/functional/nix-copy-ssh-common\.sh$''
''^tests/functional/nix-copy-ssh-ng\.sh$''
''^tests/functional/nix-copy-ssh\.sh$''
''^tests/functional/nix-daemon-untrusting\.sh$''

View file

@ -1,3 +1,4 @@
# shellcheck shell=bash
proto=$1
shift
(( $# == 0 ))
@ -7,7 +8,7 @@ TODO_NixOS
clearStore
clearCache
mkdir -p $TEST_ROOT/stores
mkdir -p "$TEST_ROOT"/stores
# Create path to copy back and forth
outPath=$(nix-build --no-out-link dependencies.nix)
@ -37,17 +38,17 @@ if [[ "$proto" == "ssh-ng" ]]; then
args+=(--no-check-sigs)
fi
[ ! -f ${remoteRoot}${outPath}/foobar ]
nix copy "${args[@]}" --to "$remoteStore" $outPath
[ -f ${remoteRoot}${outPath}/foobar ]
[ ! -f "${remoteRoot}""${outPath}"/foobar ]
nix copy "${args[@]}" --to "$remoteStore" "$outPath"
[ -f "${remoteRoot}""${outPath}"/foobar ]
# Copy back from store
clearStore
[ ! -f $outPath/foobar ]
nix copy --no-check-sigs --from "$remoteStore" $outPath
[ -f $outPath/foobar ]
[ ! -f "$outPath"/foobar ]
nix copy --no-check-sigs --from "$remoteStore" "$outPath"
[ -f "$outPath"/foobar ]
# Check --substitute-on-destination, avoid corrupted store