nixos/tests/login: use machine.reboot() for a proper reboot

Astro f4331c49 9fc85a85

Changed files
+11 -2
nixos
tests
+11 -2
nixos/tests/login.nix
···
};
testScript = ''
+
machine.allow_reboot = True
+
machine.wait_for_unit("multi-user.target")
machine.wait_until_succeeds("pgrep -f 'agetty.*tty1'")
machine.screenshot("postboot")
···
machine.screenshot("getty")
with subtest("Check whether ctrl-alt-delete works"):
-
machine.send_key("ctrl-alt-delete")
-
machine.wait_for_shutdown()
+
boot_id1 = machine.succeed("cat /proc/sys/kernel/random/boot_id").strip()
+
assert boot_id1 != ""
+
+
machine.reboot()
+
+
boot_id2 = machine.succeed("cat /proc/sys/kernel/random/boot_id").strip()
+
assert boot_id2 != ""
+
+
assert boot_id1 != boot_id2
'';
})