nixosTests.lemurs*: init

Signed-off-by: John Titor <50095635+JohnRTitor@users.noreply.github.com>
This commit is contained in:
NullCube 2024-07-26 20:08:04 +02:00 committed by Masum Reza
parent 140a6b4522
commit 2a1e82461b
7 changed files with 232 additions and 0 deletions

View File

@ -791,6 +791,11 @@ in
leaps = runTest ./leaps.nix;
lemmy = runTest ./lemmy.nix;
libinput = runTest ./libinput.nix;
lemurs = runTest ./lemurs/lemurs.nix;
lemurs-wayland = runTest ./lemurs/lemurs-wayland.nix;
lemurs-wayland-script = runTest ./lemurs/lemurs-wayland-script.nix;
lemurs-xorg = runTest ./lemurs/lemurs-xorg.nix;
lemurs-xorg-script = runTest ./lemurs/lemurs-xorg-script.nix;
librenms = runTest ./librenms.nix;
libresprite = runTest ./libresprite.nix;
libreswan = runTest ./libreswan.nix;

View File

@ -0,0 +1,50 @@
{ lib, ... }:
{
name = "lemurs-wayland-script";
meta = with lib.maintainers; {
maintainers = [
nullcube
stunkymonkey
];
};
nodes.machine =
{ lib, config, ... }:
{
imports = [ ../common/user-account.nix ];
# Required for wayland to work with Lemurs
services.seatd.enable = true;
users.users.alice.extraGroups = [ "seat" ];
services.displayManager.lemurs.enable = true;
programs.sway.enable = true;
environment.etc."lemurs/wayland/sway" = {
mode = "755";
text = ''
#! /bin/sh
exec ${lib.getExe config.programs.sway.package}
'';
};
};
testScript = ''
machine.start()
machine.wait_for_unit("multi-user.target")
machine.wait_until_succeeds("pgrep -f 'lemurs.*tty1'")
machine.screenshot("postboot")
with subtest("Log in as alice to Sway"):
machine.send_chars("\n")
machine.send_chars("alice\n")
machine.sleep(1)
machine.send_chars("foobar\n")
machine.sleep(1)
machine.wait_until_succeeds("pgrep -u alice sway")
machine.sleep(10)
machine.succeed("pgrep -u alice sway")
machine.screenshot("postlogin")
'';
}

View File

@ -0,0 +1,43 @@
{ lib, ... }:
{
name = "lemurs-wayland";
meta = with lib.maintainers; {
maintainers = [
nullcube
stunkymonkey
];
};
nodes.machine =
{ ... }:
{
imports = [ ../common/user-account.nix ];
# Required for wayland to work with Lemurs
services.seatd.enable = true;
users.users.alice.extraGroups = [ "seat" ];
services.displayManager.lemurs.enable = true;
programs.river.enable = true;
};
testScript = ''
machine.start()
machine.wait_for_unit("multi-user.target")
machine.wait_until_succeeds("pgrep -f 'lemurs.*tty1'")
machine.screenshot("postboot")
with subtest("Log in as alice to river"):
machine.send_chars("\n")
machine.send_chars("alice\n")
machine.sleep(1)
machine.send_chars("foobar\n")
machine.sleep(1)
machine.wait_until_succeeds("pgrep -u alice river")
machine.sleep(10)
machine.succeed("pgrep -u alice river")
machine.screenshot("postlogin")
'';
}

View File

@ -0,0 +1,46 @@
{ lib, ... }:
{
name = "lemurs-xorg-script";
meta = with lib.maintainers; {
maintainers = [
nullcube
stunkymonkey
];
};
nodes.machine =
{ pkgs, ... }:
{
imports = [ ../common/user-account.nix ];
services.displayManager.lemurs.enable = true;
services.xserver.enable = true;
environment.etc."lemurs/wms/icewm" = {
mode = "755";
text = ''
#! /bin/sh
exec ${pkgs.icewm}/bin/icewm-session
'';
};
};
testScript = ''
machine.start()
machine.wait_for_unit("multi-user.target")
machine.wait_until_succeeds("pgrep -f 'lemurs.*tty1'")
machine.screenshot("postboot")
with subtest("Log in as alice to icewm"):
machine.send_chars("\n")
machine.send_chars("alice\n")
machine.sleep(1)
machine.send_chars("foobar\n")
machine.wait_until_succeeds("pgrep -u alice icewm")
machine.sleep(10)
machine.succeed("pgrep -u alice icewm")
machine.screenshot("postlogin")
'';
}

View File

@ -0,0 +1,40 @@
{ lib, ... }:
{
name = "lemurs-xorg";
meta = with lib.maintainers; {
maintainers = [
nullcube
stunkymonkey
];
};
nodes.machine =
{ ... }:
{
imports = [ ../common/user-account.nix ];
services.displayManager.lemurs.enable = true;
services.xserver.enable = true;
services.xserver.windowManager.icewm.enable = true;
};
testScript = ''
machine.start()
machine.wait_for_unit("multi-user.target")
machine.wait_until_succeeds("pgrep -f 'lemurs.*tty1'")
machine.screenshot("postboot")
with subtest("Log in as alice to icewm"):
machine.send_chars("\n")
machine.send_chars("alice\n")
machine.sleep(1)
machine.send_chars("foobar\n")
machine.wait_until_succeeds("pgrep -u alice icewm")
machine.sleep(10)
machine.succeed("pgrep -u alice icewm")
machine.screenshot("postlogin")
'';
}

View File

@ -0,0 +1,37 @@
{
lib,
...
}:
{
name = "lemurs";
meta = with lib.maintainers; {
maintainers = [
nullcube
stunkymonkey
];
};
nodes.machine = _: {
imports = [ ../common/user-account.nix ];
services.displayManager.lemurs.enable = true;
};
testScript = ''
machine.start()
machine.wait_for_unit("multi-user.target")
machine.wait_until_succeeds("pgrep -f 'lemurs.*tty1'")
machine.screenshot("postboot")
with subtest("Log in as alice on a virtual console"):
machine.send_chars("\n")
machine.send_chars("alice\n")
machine.sleep(1)
machine.send_chars("foobar\n")
machine.sleep(1)
machine.wait_until_succeeds("pgrep -u alice bash")
machine.screenshot("postlogin")
machine.send_chars("touch done\n")
machine.wait_for_file("/home/alice/done")
'';
}

View File

@ -6,6 +6,7 @@
rustPlatform,
systemdMinimal,
versionCheckHook,
nixosTests,
}:
rustPlatform.buildRustPackage rec {
pname = "lemurs";
@ -30,6 +31,16 @@ rustPlatform.buildRustPackage rec {
doInstallCheck = true;
nativeInstallCheckInputs = [ versionCheckHook ];
passthru.tests = {
inherit (nixosTests)
lemurs
lemurs-wayland
lemurs-wayland-script
lemurs-xorg
lemurs-xorg-script
;
};
meta = {
description = "Customizable TUI display/login manager written in Rust";
homepage = "https://github.com/coastalwhite/lemurs";