1import ./make-test-python.nix ({ pkgs, ...} :
2
3{
4 name = "cage";
5 meta = with pkgs.lib.maintainers; {
6 maintainers = [ matthewbauer ];
7 };
8
9 machine = { ... }:
10
11 {
12 imports = [ ./common/user-account.nix ];
13 services.cage = {
14 enable = true;
15 user = "alice";
16 # Disable color and bold and use a larger font to make OCR easier:
17 program = "${pkgs.xterm}/bin/xterm -cm -pc -fa Monospace -fs 24";
18 };
19
20 # Need to switch to a different GPU driver than the default one (-vga std) so that Cage can launch:
21 virtualisation.qemu.options = [ "-vga none -device virtio-gpu-pci" ];
22 };
23
24 enableOCR = true;
25
26 testScript = { nodes, ... }: let
27 user = nodes.machine.config.users.users.alice;
28 in ''
29 with subtest("Wait for cage to boot up"):
30 start_all()
31 machine.wait_for_file("/run/user/${toString user.uid}/wayland-0.lock")
32 machine.wait_until_succeeds("pgrep xterm")
33 machine.wait_for_text("alice@machine")
34 machine.screenshot("screen")
35 '';
36})