1 import ../make-test-python.nix ({ lib, pkgs, ... }:
4 name = "initrd-network-ssh";
5 meta.maintainers = with lib.maintainers; [ willibutz emily ];
12 "ip=${config.networking.primaryIPAddress}:::255.255.255.0::eth1:none"
14 boot.initrd.network = {
18 authorizedKeys = [ (lib.readFile ./id_ed25519.pub) ];
20 hostKeys = [ ./ssh_host_ed25519_key ];
23 boot.initrd.preLVMCommands = ''
38 text = lib.concatStrings [
40 "${toString (lib.head (lib.splitString " " (
41 toString (lib.elemAt (lib.splitString "\n" config.networking.extraHosts) 2)
43 "${lib.readFile ./ssh_host_ed25519_key.pub}"
47 source = ./id_ed25519;
56 client.wait_for_unit("network.target")
59 def ssh_is_up(_) -> bool:
60 status, _ = client.execute("nc -z server 22")
64 with client.nested("waiting for SSH server to come up"):
69 "ssh -i /etc/sshKey -o UserKnownHostsFile=/etc/knownHosts server 'touch /fnord'"