1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-09 16:13:54 +02:00

Test nix copy --substitute-on-destination

It works with both `ssh://` and `ssh-ng://` now since #9600 (and
`ssh-ng:// didn't work before that).

Also, by making the two tests share code, we nudge ourselves towards
making sure there is feature parity.
This commit is contained in:
John Ericson 2023-12-13 11:26:14 -05:00
parent 1b7968ed86
commit e76df87814
3 changed files with 77 additions and 28 deletions

View file

@ -1,20 +1,3 @@
source common.sh
clearStore
clearCache
remoteRoot=$TEST_ROOT/store2
chmod -R u+w "$remoteRoot" || true
rm -rf "$remoteRoot"
outPath=$(nix-build --no-out-link dependencies.nix)
nix copy --to "ssh://localhost?store=$NIX_STORE_DIR&remote-store=$remoteRoot%3fstore=$NIX_STORE_DIR%26real=$remoteRoot$NIX_STORE_DIR" $outPath
[ -f $remoteRoot$outPath/foobar ]
clearStore
nix copy --no-check-sigs --from "ssh://localhost?store=$NIX_STORE_DIR&remote-store=$remoteRoot%3fstore=$NIX_STORE_DIR%26real=$remoteRoot$NIX_STORE_DIR" $outPath
[ -f $outPath/foobar ]
source nix-copy-ssh-common.sh "ssh"