1import ./make-test-python.nix ({ lib, pkgs, ... }: {
2 name = "systemd-initrd-vconsole";
3
4 nodes.machine = { pkgs, ... }: {
5 boot.kernelParams = [ "rd.systemd.unit=rescue.target" ];
6
7 boot.initrd.systemd = {
8 enable = true;
9 emergencyAccess = true;
10 };
11
12 console = {
13 earlySetup = true;
14 keyMap = "colemak";
15 };
16 };
17
18 testScript = ''
19 # Boot into rescue shell in initrd
20 machine.start()
21 machine.wait_for_console_text("Press Enter for maintenance")
22 machine.send_console("\n")
23 machine.wait_for_console_text("Logging in with home")
24
25 # Check keymap
26 machine.send_console("(printf '%s to receive text: \\n' Ready && read text && echo \"$text\") </dev/tty1\n")
27 machine.wait_for_console_text("Ready to receive text:")
28 for key in "asdfjkl;\n":
29 machine.send_key(key)
30 machine.wait_for_console_text("arstneio")
31 machine.send_console("systemctl poweroff\n")
32 '';
33})