aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDavid McFarland <corngood@gmail.com>2023-06-12 23:42:05 -0300
committerDavid McFarland <corngood@gmail.com>2023-06-13 00:54:52 -0300
commit5454fdcceb2004c67b0c829ae1ee447da9c81d00 (patch)
tree8d2341bf6b752f9cf6202d1c9b251e4b869cda79 /tests
parent041486b11674e0480ad85f63d262c33a09276ef1 (diff)
Add test of explicit ssh control path in nix-copy test
This highlights a problem caused by SSHMaster::isMasterRunning returning false when NIX_SSHOPTS contains -oControlPath.
Diffstat (limited to 'tests')
-rw-r--r--tests/nixos/nix-copy.nix9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/nixos/nix-copy.nix b/tests/nixos/nix-copy.nix
index 16c477bf9..ef053de03 100644
--- a/tests/nixos/nix-copy.nix
+++ b/tests/nixos/nix-copy.nix
@@ -79,6 +79,15 @@ in {
server.copy_from_host("key.pub", "/root/.ssh/authorized_keys")
server.succeed("systemctl restart sshd")
client.succeed(f"ssh -o StrictHostKeyChecking=no {server.name} 'echo hello world'")
+ client.succeed(f"ssh -O check {server.name}")
+ client.succeed(f"ssh -O exit {server.name}")
+ client.fail(f"ssh -O check {server.name}")
+
+ # Check that an explicit master will work
+ client.succeed(f"ssh -MNfS /tmp/master {server.name}")
+ client.succeed(f"ssh -S /tmp/master -O check {server.name}")
+ client.succeed("NIX_SSHOPTS='-oControlPath=/tmp/master' nix copy --to ssh://server ${pkgA} >&2")
+ client.succeed(f"ssh -S /tmp/master -O exit {server.name}")
# Copy the closure of package B from the server to the client, using ssh-ng.
client.fail("nix-store --check-validity ${pkgB}")