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

This commit is contained in:
Wolfgang Walther 2025-07-09 17:46:37 +00:00 committed by GitHub
commit 8210e5043c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 52 additions and 67 deletions

View File

@ -1265,7 +1265,7 @@ in
scion-freestanding-deployment = handleTest ./scion/freestanding-deployment { }; scion-freestanding-deployment = handleTest ./scion/freestanding-deployment { };
scrutiny = runTest ./scrutiny.nix; scrutiny = runTest ./scrutiny.nix;
scx = runTest ./scx/default.nix; scx = runTest ./scx/default.nix;
sddm = handleTest ./sddm.nix { }; sddm = import ./sddm.nix { inherit runTest; };
sdl3 = runTest ./sdl3.nix; sdl3 = runTest ./sdl3.nix;
seafile = runTest ./seafile.nix; seafile = runTest ./seafile.nix;
searx = runTest ./searx.nix; searx = runTest ./searx.nix;

View File

@ -1,21 +1,9 @@
{ runTest }:
{ {
system ? builtins.currentSystem, default = runTest {
config ? { },
pkgs ? import ../.. { inherit system config; },
}:
with import ../lib/testing-python.nix { inherit system pkgs; };
let
inherit (pkgs) lib;
tests = {
default = {
name = "sddm"; name = "sddm";
nodes.machine = nodes.machine = {
{ ... }:
{
imports = [ ./common/user-account.nix ]; imports = [ ./common/user-account.nix ];
services.xserver.enable = true; services.xserver.enable = true;
services.displayManager.sddm.enable = true; services.displayManager.sddm.enable = true;
@ -41,15 +29,15 @@ let
''; '';
}; };
autoLogin = { autoLogin = runTest (
{ lib, ... }:
{
name = "sddm-autologin"; name = "sddm-autologin";
meta = with pkgs.lib.maintainers; { meta = with lib.maintainers; {
maintainers = [ ttuegel ]; maintainers = [ ttuegel ];
}; };
nodes.machine = nodes.machine = {
{ ... }:
{
imports = [ ./common/user-account.nix ]; imports = [ ./common/user-account.nix ];
services.xserver.enable = true; services.xserver.enable = true;
services.displayManager = { services.displayManager = {
@ -63,15 +51,12 @@ let
services.xserver.windowManager.icewm.enable = true; services.xserver.windowManager.icewm.enable = true;
}; };
testScript = testScript = ''
{ nodes, ... }:
''
start_all() start_all()
machine.wait_for_file("/tmp/xauth_*") machine.wait_for_file("/tmp/xauth_*")
machine.succeed("xauth merge /tmp/xauth_*") machine.succeed("xauth merge /tmp/xauth_*")
machine.wait_for_window("^IceWM ") machine.wait_for_window("^IceWM ")
''; '';
}; }
}; );
in }
lib.mapAttrs (lib.const makeTest) tests