af99194379
The result still looks far from ideal but at least it gets recognized now. "-fa Monospace" is required to switch to a font from the FreeType library so that "-fs 24" works. Note: Using linuxPackages_latest is not required anymore.
35 lines
883 B
Nix
35 lines
883 B
Nix
import ./make-test-python.nix ({ pkgs, ...} :
|
|
|
|
{
|
|
name = "cage";
|
|
meta = with pkgs.lib.maintainers; {
|
|
maintainers = [ matthewbauer ];
|
|
};
|
|
|
|
machine = { ... }:
|
|
|
|
{
|
|
imports = [ ./common/user-account.nix ];
|
|
services.cage = {
|
|
enable = true;
|
|
user = "alice";
|
|
# Disable color and bold and use a larger font to make OCR easier:
|
|
program = "${pkgs.xterm}/bin/xterm -cm -pc -fa Monospace -fs 24";
|
|
};
|
|
|
|
virtualisation.memorySize = 1024;
|
|
};
|
|
|
|
enableOCR = true;
|
|
|
|
testScript = { nodes, ... }: let
|
|
user = nodes.machine.config.users.users.alice;
|
|
in ''
|
|
with subtest("Wait for cage to boot up"):
|
|
start_all()
|
|
machine.wait_for_file("/run/user/${toString user.uid}/wayland-0.lock")
|
|
machine.wait_until_succeeds("pgrep xterm")
|
|
machine.wait_for_text("alice@machine")
|
|
machine.screenshot("screen")
|
|
'';
|
|
})
|