nixosTests.lemurs*: init

Signed-off-by: John Titor <50095635+JohnRTitor@users.noreply.github.com>

+5
nixos/tests/all-tests.nix
···
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;
+50
nixos/tests/lemurs/lemurs-wayland-script.nix
···
+
{ 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")
+
'';
+
}
+43
nixos/tests/lemurs/lemurs-wayland.nix
···
+
{ 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")
+
'';
+
}
+46
nixos/tests/lemurs/lemurs-xorg-script.nix
···
+
{ 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")
+
'';
+
}
+40
nixos/tests/lemurs/lemurs-xorg.nix
···
+
{ 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")
+
'';
+
}
+37
nixos/tests/lemurs/lemurs.nix
···
+
{
+
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")
+
'';
+
}
+11
pkgs/by-name/le/lemurs/package.nix
···
rustPlatform,
systemdMinimal,
versionCheckHook,
+
nixosTests,
}:
rustPlatform.buildRustPackage rec {
pname = "lemurs";
···
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";