diff options
author | Astro <astro@spaceboyz.net> | 2023-03-16 01:42:00 +0100 |
---|---|---|
committer | Astro <astro@spaceboyz.net> | 2023-03-16 01:42:00 +0100 |
commit | f4331c498367fb94d198250fb4ef285fd340bb94 (patch) | |
tree | 4dbb498014020d0ec9fb02bf24a5cc13bf768ab1 | |
parent | 9fc85a85d579014b0caddb2b33f3cb19a02c6883 (diff) | |
download | nixpkgs-f4331c498367fb94d198250fb4ef285fd340bb94.tar nixpkgs-f4331c498367fb94d198250fb4ef285fd340bb94.tar.gz nixpkgs-f4331c498367fb94d198250fb4ef285fd340bb94.tar.bz2 nixpkgs-f4331c498367fb94d198250fb4ef285fd340bb94.tar.lz nixpkgs-f4331c498367fb94d198250fb4ef285fd340bb94.tar.xz nixpkgs-f4331c498367fb94d198250fb4ef285fd340bb94.tar.zst nixpkgs-f4331c498367fb94d198250fb4ef285fd340bb94.zip |
nixos/tests/login: use machine.reboot() for a proper reboot
-rw-r--r-- | nixos/tests/login.nix | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/nixos/tests/login.nix b/nixos/tests/login.nix index 2cff38d2005..97d7c7b9b53 100644 --- a/nixos/tests/login.nix +++ b/nixos/tests/login.nix @@ -13,6 +13,8 @@ import ./make-test-python.nix ({ pkgs, latestKernel ? false, ... }: }; testScript = '' + machine.allow_reboot = True + machine.wait_for_unit("multi-user.target") machine.wait_until_succeeds("pgrep -f 'agetty.*tty1'") machine.screenshot("postboot") @@ -53,7 +55,14 @@ import ./make-test-python.nix ({ pkgs, latestKernel ? false, ... }: 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 ''; }) |