diff options
author | aszlig <aszlig@redmoonstudios.org> | 2017-04-23 19:14:44 +0200 |
---|---|---|
committer | aszlig <aszlig@redmoonstudios.org> | 2017-04-23 19:25:27 +0200 |
commit | dc87b5587e3fb39e96e6b965a26f324daf7508f8 (patch) | |
tree | bb1e3625c850ae1b79bafa9a42ea7bf4b552103d /nixos | |
parent | 83e1400e0ce762a9932041977e3c9b90f049425b (diff) | |
download | nixpkgs-dc87b5587e3fb39e96e6b965a26f324daf7508f8.tar nixpkgs-dc87b5587e3fb39e96e6b965a26f324daf7508f8.tar.gz nixpkgs-dc87b5587e3fb39e96e6b965a26f324daf7508f8.tar.bz2 nixpkgs-dc87b5587e3fb39e96e6b965a26f324daf7508f8.tar.lz nixpkgs-dc87b5587e3fb39e96e6b965a26f324daf7508f8.tar.xz nixpkgs-dc87b5587e3fb39e96e6b965a26f324daf7508f8.tar.zst nixpkgs-dc87b5587e3fb39e96e6b965a26f324daf7508f8.zip |
nixos: Add a VM test for the SLiM display manager
This is currently our default display manager, so I'm adding this to the "tested" job as well to ensure we don't ship broken revisions where X is most likely not working. The test uses a custom SLiM theme that's specifically tailored for good OCR results (mainly white background and black fonts without anything else), because our default NixOS theme has a very small contrast between background and fonts in some places. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/release-combined.nix | 1 | ||||
-rw-r--r-- | nixos/release.nix | 1 | ||||
-rw-r--r-- | nixos/tests/slim.nix | 66 |
3 files changed, 68 insertions, 0 deletions
diff --git a/nixos/release-combined.nix b/nixos/release-combined.nix index 5c1112a1c6d..4217f5940ec 100644 --- a/nixos/release-combined.nix +++ b/nixos/release-combined.nix @@ -94,6 +94,7 @@ in rec { (all nixos.tests.proxy) (all nixos.tests.sddm.default) (all nixos.tests.simple) + (all nixos.tests.slim) (all nixos.tests.udisks2) (all nixos.tests.xfce) diff --git a/nixos/release.nix b/nixos/release.nix index 95b284cb705..0fec97b9c27 100644 --- a/nixos/release.nix +++ b/nixos/release.nix @@ -299,6 +299,7 @@ in rec { tests.samba = callTest tests/samba.nix {}; tests.sddm = callSubTests tests/sddm.nix {}; tests.simple = callTest tests/simple.nix {}; + tests.slim = callTest tests/slim.nix {}; tests.smokeping = callTest tests/smokeping.nix {}; tests.taskserver = callTest tests/taskserver.nix {}; tests.tomcat = callTest tests/tomcat.nix {}; diff --git a/nixos/tests/slim.nix b/nixos/tests/slim.nix new file mode 100644 index 00000000000..7b939d83638 --- /dev/null +++ b/nixos/tests/slim.nix @@ -0,0 +1,66 @@ +import ./make-test.nix ({ pkgs, ...} : { + name = "slim"; + + meta = with pkgs.stdenv.lib.maintainers; { + maintainers = [ aszlig ]; + }; + + machine = { pkgs, lib, ... }: { + imports = [ ./common/user-account.nix ]; + services.xserver.enable = true; + services.xserver.windowManager.default = "icewm"; + services.xserver.windowManager.icewm.enable = true; + services.xserver.desktopManager.default = "none"; + services.xserver.displayManager.slim = { + enable = true; + + # Use a custom theme in order to get best OCR results + theme = pkgs.runCommand "slim-theme-ocr" { + nativeBuildInputs = [ pkgs.imagemagick ]; + } '' + mkdir "$out" + convert -size 1x1 xc:white "$out/background.jpg" + convert -size 200x100 xc:white "$out/panel.jpg" + cat > "$out/slim.theme" <<EOF + background_color #ffffff + background_style tile + + input_fgcolor #000000 + msg_color #000000 + + session_color #000000 + session_font Verdana:size=16:bold + + username_msg Username: + username_font Verdana:size=16:bold + username_color #000000 + username_x 50% + username_y 40% + + password_msg Password: + password_x 50% + password_y 40% + EOF + ''; + }; + }; + + enableOCR = true; + + testScript = { nodes, ... }: let + user = nodes.machine.config.users.extraUsers.alice; + in '' + startAll; + $machine->waitForText(qr/Username:/); + $machine->sendChars("${user.name}\n"); + $machine->waitForText(qr/Password:/); + $machine->sendChars("${user.password}\n"); + + $machine->waitForFile('${user.home}/.Xauthority'); + $machine->succeed('xauth merge ${user.home}/.Xauthority'); + $machine->waitForWindow('^IceWM '); + + # Make sure SLiM doesn't create a log file + $machine->fail('test -e /var/log/slim.log'); + ''; +}) |