mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-21 21:21:06 +00:00
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.
36 lines
883 B
Nix
36 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")
|
|
'';
|
|
})
|