From 9cb31aab853e51835204a55b4dffc20ed93902ea Mon Sep 17 00:00:00 2001 From: phanirithvij Date: Fri, 24 Oct 2025 15:53:45 +0530 Subject: [PATCH 1/2] nixosTests.ly: adapt test to new user selection login Signed-off-by: phanirithvij --- nixos/tests/ly.nix | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/nixos/tests/ly.nix b/nixos/tests/ly.nix index 1b57ebfabacd..81a84d92da1e 100644 --- a/nixos/tests/ly.nix +++ b/nixos/tests/ly.nix @@ -36,27 +36,56 @@ in let user = nodes.machine.users.users.alice; in + # python '' + from test_driver.errors import RequestedAssertionFailed start_all() - machine.wait_until_tty_matches("1", "password:") + # old ly versions before 1.1.2 used to allow typing the username + # but now a user can only be selected from a set of users + def navigate_user(machine, username, wm, tty="1"): + wm = wm.lower() + tries = 0 + while username not in machine.get_tty_text(tty): + machine.send_key("left") + machine.sleep(0.3) + if tries > 3: + RequestedAssertionFailed(f"Failed to find user:{username} in ly") + tries += 1 + + # move cursor to wm selection + machine.send_key("up") + + tries = 0 + while wm not in machine.get_tty_text(tty).lower(): + machine.send_key("left") + machine.sleep(0.3) + if tries > 3: + RequestedAssertionFailed(f"Failed to find wm:{wm} in ly") + tries += 1 + + # reset cursor to user selection + machine.send_key("tab") + + machine.wait_until_tty_matches("1", "password") machine.send_key("ctrl-alt-f1") machine.sleep(1) machine.screenshot("ly") - machine.send_chars("alice") + navigate_user(machine, "${user.name}", "icewm") machine.send_key("tab") machine.send_chars("${user.password}") machine.send_key("ret") machine.wait_for_file("/run/user/${toString user.uid}/lyxauth") machine.succeed("xauth merge /run/user/${toString user.uid}/lyxauth") machine.wait_for_window("^IceWM ") + machine.sleep(2) machine.screenshot("icewm") - machineNoX11.wait_until_tty_matches("1", "password:") + machineNoX11.wait_until_tty_matches("1", "password") machineNoX11.send_key("ctrl-alt-f1") machineNoX11.sleep(1) machineNoX11.screenshot("ly-no-x11") - machineNoX11.send_chars("alice") + navigate_user(machineNoX11, "${user.name}", "Sway") machineNoX11.send_key("tab") machineNoX11.send_chars("${user.password}") machineNoX11.send_key("ret") From 15bd3ae26278a39eca5fd21e0cb8f447e4759936 Mon Sep 17 00:00:00 2001 From: phanirithvij Date: Thu, 6 Nov 2025 03:05:13 +0530 Subject: [PATCH 2/2] nixosTests.ly: fix aarch64-linux test It was failing with xserver crashing, full logs https://github.com/NixOS/nixpkgs/pull/427541#issuecomment-3111046240 Co-Authored-By: Markus Wamser Signed-off-by: phanirithvij --- nixos/tests/ly.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nixos/tests/ly.nix b/nixos/tests/ly.nix index 81a84d92da1e..a9c74c5f3ca7 100644 --- a/nixos/tests/ly.nix +++ b/nixos/tests/ly.nix @@ -67,6 +67,8 @@ in # reset cursor to user selection machine.send_key("tab") + # https://github.com/NixOS/nixpkgs/pull/455191#discussion_r2507716719 + machine.wait_until_succeeds("getfacl /dev/dri/card0 | grep video") machine.wait_until_tty_matches("1", "password") machine.send_key("ctrl-alt-f1") machine.sleep(1)