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