aboutsummaryrefslogtreecommitdiff
path: root/tests/nixos
diff options
context:
space:
mode:
authorAlexander Bantyev <balsoft@balsoft.ru>2023-05-17 11:34:45 +0400
committerAlexander Bantyev <balsoft@balsoft.ru>2023-05-17 11:34:45 +0400
commit992e2ed0cf5d1e15eab1c6c523403a7fb7d3136a (patch)
tree4b0c4de43c6fcb835e6863655589b8463b945737 /tests/nixos
parent61cdb0b0576017a636eabb6899aac097bb7718c0 (diff)
Add a test for ControlMaster
Diffstat (limited to 'tests/nixos')
-rw-r--r--tests/nixos/nix-copy.nix10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/nixos/nix-copy.nix b/tests/nixos/nix-copy.nix
index ee8b77100..16c477bf9 100644
--- a/tests/nixos/nix-copy.nix
+++ b/tests/nixos/nix-copy.nix
@@ -23,6 +23,12 @@ in {
nix.settings.substituters = lib.mkForce [ ];
nix.settings.experimental-features = [ "nix-command" ];
services.getty.autologinUser = "root";
+ programs.ssh.extraConfig = ''
+ Host *
+ ControlMaster auto
+ ControlPath ~/.ssh/master-%h:%r@%n:%p
+ ControlPersist 15m
+ '';
};
server =
@@ -62,6 +68,10 @@ in {
client.wait_for_text("done")
server.succeed("nix-store --check-validity ${pkgA}")
+ # Check that ControlMaster is working
+ client.send_chars("nix copy --to ssh://server ${pkgA} >&2; echo done\n")
+ client.wait_for_text("done")
+
client.copy_from_host("key", "/root/.ssh/id_ed25519")
client.succeed("chmod 600 /root/.ssh/id_ed25519")