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