1 import ./make-test-python.nix (
4 name = "systemd-initrd-network-ssh";
5 meta.maintainers = [ lib.maintainers.elvishjerricco ];
11 testing.initrdBackdoor = true;
12 boot.initrd.systemd.enable = true;
13 boot.initrd.systemd.contents."/etc/msg".text = "foo";
14 boot.initrd.network = {
18 authorizedKeys = [ (lib.readFile ./initrd-network-ssh/id_ed25519.pub) ];
20 hostKeys = [ ./initrd-network-ssh/ssh_host_ed25519_key ];
30 text = lib.concatStrings [
32 "${toString (lib.head (lib.splitString " " (toString (lib.elemAt (lib.splitString "\n" config.networking.extraHosts) 2))))} "
33 "${lib.readFile ./initrd-network-ssh/ssh_host_ed25519_key.pub}"
37 source = ./initrd-network-ssh/id_ed25519;
47 def ssh_is_up(_) -> bool:
48 status, _ = client.execute("nc -z server 22")
51 client.wait_for_unit("network.target")
52 with client.nested("waiting for SSH server to come up"):
56 "ssh -i /etc/sshKey -o UserKnownHostsFile=/etc/knownHosts server 'cat /etc/msg'"
61 server.wait_for_unit("multi-user.target")