Files
komorebi/nix/tests/vm/suites/run-kde/default.nix
T
LGUG2Z 0e8e25957c build(nix): the demo guest as a VM suite
The demo guest is what the command `run-kde` starts, so it should not stop
working between the times somebody runs it by hand. The suite `run-kde` puts the
guest module, nix/dev/run-kde.nix, on the session node, as the rdp suite does
with krdp.nix, and checks what only a booted session can say: the demo opens two
Konsole windows, Kate and Dolphin and komorebi tiles them clear of the panel,
the cheat sheet is a window that is not a tile, what it shows of `komorebic
check` has no error, and KWin says what it draws with.

The node makes the directory the host shares as the guest finds it once it has
mounted it: owned by a user the guest does not have, with a password and a
public key in it. The suite checks that the guest takes them as root before the
login, that ssh lets in that key and no other, that KRDP starts by itself and
listens, and that a client with the password is let in and shows the display.

The client of those RDP checks moves from the rdp suite into the library as
RdpClient, with unit tests against the fake machine, so that both suites run the
same checks; the machine protocol gains copy_from_machine for it.
2026-10-28 14:20:08 -07:00

54 lines
1.6 KiB
Nix

{
tier = "fast";
kind = "session";
timeoutMinutes = 12;
node =
{ pkgs, ... }:
let
# a key pair for the ssh check: the suite makes one, and the host's directory has its public half
key = pkgs.runCommand "run-kde-test-key" { nativeBuildInputs = [ pkgs.openssh ]; } ''
mkdir $out
ssh-keygen -q -t ed25519 -N "" -f $out/key
'';
# the directory the host shares, as the guest finds it once it has mounted it: a user of the
# host owns it, and the guest's user cannot read it
host = {
user = "4242";
group = "4242";
};
in
{
# the guest of `run-kde`, as the command starts it, on the session node
imports = [ ../../../../dev/run-kde.nix ];
systemd.tmpfiles.settings."run-kde-share" = {
"/run/run-kde".d = host // {
mode = "0700";
};
"/run/run-kde/rdp-password".f = host // {
mode = "0600";
argument = "a-password-of-the-host";
};
"/run/run-kde/ssh_key.pub".C = host // {
mode = "0600";
argument = "${key}/key.pub";
};
};
environment.etc."run-kde-test/ssh_key".source = "${key}/key";
# the session guests have sshd, and the key is for it
services.openssh = {
enable = true;
settings.PasswordAuthentication = false;
};
# the client of the RDP checks: an X server of its own, and what reads its picture back
environment.systemPackages = [
pkgs.iproute2
pkgs.netpbm
pkgs.xvfb
pkgs.xwd
];
};
}