nixosTests.sddm: handleTest -> runTest (#423698)

authored by Wolfgang Walther and committed by GitHub 8210e504 a28854ce

+51 -66
+1 -1
nixos/tests/all-tests.nix
··· 1265 1265 scion-freestanding-deployment = handleTest ./scion/freestanding-deployment { }; 1266 1266 scrutiny = runTest ./scrutiny.nix; 1267 1267 scx = runTest ./scx/default.nix; 1268 - sddm = handleTest ./sddm.nix { }; 1268 + sddm = import ./sddm.nix { inherit runTest; }; 1269 1269 sdl3 = runTest ./sdl3.nix; 1270 1270 seafile = runTest ./seafile.nix; 1271 1271 searx = runTest ./searx.nix;
+50 -65
nixos/tests/sddm.nix
··· 1 + { runTest }: 1 2 { 2 - system ? builtins.currentSystem, 3 - config ? { }, 4 - pkgs ? import ../.. { inherit system config; }, 5 - }: 3 + default = runTest { 4 + name = "sddm"; 6 5 7 - with import ../lib/testing-python.nix { inherit system pkgs; }; 6 + nodes.machine = { 7 + imports = [ ./common/user-account.nix ]; 8 + services.xserver.enable = true; 9 + services.displayManager.sddm.enable = true; 10 + services.displayManager.defaultSession = "none+icewm"; 11 + services.xserver.windowManager.icewm.enable = true; 12 + }; 8 13 9 - let 10 - inherit (pkgs) lib; 11 - 12 - tests = { 13 - default = { 14 - name = "sddm"; 15 - 16 - nodes.machine = 17 - { ... }: 18 - { 19 - imports = [ ./common/user-account.nix ]; 20 - services.xserver.enable = true; 21 - services.displayManager.sddm.enable = true; 22 - services.displayManager.defaultSession = "none+icewm"; 23 - services.xserver.windowManager.icewm.enable = true; 24 - }; 14 + enableOCR = true; 25 15 26 - enableOCR = true; 16 + testScript = 17 + { nodes, ... }: 18 + let 19 + user = nodes.machine.users.users.alice; 20 + in 21 + '' 22 + start_all() 23 + machine.wait_for_text("(?i)select your user") 24 + machine.screenshot("sddm") 25 + machine.send_chars("${user.password}\n") 26 + machine.wait_for_file("/tmp/xauth_*") 27 + machine.succeed("xauth merge /tmp/xauth_*") 28 + machine.wait_for_window("^IceWM ") 29 + ''; 30 + }; 27 31 28 - testScript = 29 - { nodes, ... }: 30 - let 31 - user = nodes.machine.users.users.alice; 32 - in 33 - '' 34 - start_all() 35 - machine.wait_for_text("(?i)select your user") 36 - machine.screenshot("sddm") 37 - machine.send_chars("${user.password}\n") 38 - machine.wait_for_file("/tmp/xauth_*") 39 - machine.succeed("xauth merge /tmp/xauth_*") 40 - machine.wait_for_window("^IceWM ") 41 - ''; 42 - }; 43 - 44 - autoLogin = { 32 + autoLogin = runTest ( 33 + { lib, ... }: 34 + { 45 35 name = "sddm-autologin"; 46 - meta = with pkgs.lib.maintainers; { 36 + meta = with lib.maintainers; { 47 37 maintainers = [ ttuegel ]; 48 38 }; 49 39 50 - nodes.machine = 51 - { ... }: 52 - { 53 - imports = [ ./common/user-account.nix ]; 54 - services.xserver.enable = true; 55 - services.displayManager = { 56 - sddm.enable = true; 57 - autoLogin = { 58 - enable = true; 59 - user = "alice"; 60 - }; 40 + nodes.machine = { 41 + imports = [ ./common/user-account.nix ]; 42 + services.xserver.enable = true; 43 + services.displayManager = { 44 + sddm.enable = true; 45 + autoLogin = { 46 + enable = true; 47 + user = "alice"; 61 48 }; 62 - services.displayManager.defaultSession = "none+icewm"; 63 - services.xserver.windowManager.icewm.enable = true; 64 49 }; 50 + services.displayManager.defaultSession = "none+icewm"; 51 + services.xserver.windowManager.icewm.enable = true; 52 + }; 65 53 66 - testScript = 67 - { nodes, ... }: 68 - '' 69 - start_all() 70 - machine.wait_for_file("/tmp/xauth_*") 71 - machine.succeed("xauth merge /tmp/xauth_*") 72 - machine.wait_for_window("^IceWM ") 73 - ''; 74 - }; 75 - }; 76 - in 77 - lib.mapAttrs (lib.const makeTest) tests 54 + testScript = '' 55 + start_all() 56 + machine.wait_for_file("/tmp/xauth_*") 57 + machine.succeed("xauth merge /tmp/xauth_*") 58 + machine.wait_for_window("^IceWM ") 59 + ''; 60 + } 61 + ); 62 + }