at 23.11-pre 1.7 kB view raw
1import ./make-test-python.nix ({ pkgs, ...} : { 2 name = "wmderland"; 3 meta = with pkgs.lib.maintainers; { 4 maintainers = [ takagiy ]; 5 }; 6 7 nodes.machine = { lib, ... }: { 8 imports = [ ./common/x11.nix ./common/user-account.nix ]; 9 test-support.displayManager.auto.user = "alice"; 10 services.xserver.displayManager.defaultSession = lib.mkForce "none+wmderland"; 11 services.xserver.windowManager.wmderland.enable = true; 12 13 systemd.services.setupWmderlandConfig = { 14 wantedBy = [ "multi-user.target" ]; 15 before = [ "multi-user.target" ]; 16 environment = { 17 HOME = "/home/alice"; 18 }; 19 unitConfig = { 20 type = "oneshot"; 21 RemainAfterExit = true; 22 user = "alice"; 23 }; 24 script = let 25 config = pkgs.writeText "config" '' 26 set $Mod = Mod1 27 bindsym $Mod+Return exec ${pkgs.xterm}/bin/xterm -cm -pc 28 ''; 29 in '' 30 mkdir -p $HOME/.config/wmderland 31 cp ${config} $HOME/.config/wmderland/config 32 ''; 33 }; 34 }; 35 36 testScript = { ... }: '' 37 with subtest("ensure x starts"): 38 machine.wait_for_x() 39 machine.wait_for_file("/home/alice/.Xauthority") 40 machine.succeed("xauth merge ~alice/.Xauthority") 41 42 with subtest("ensure we can open a new terminal"): 43 machine.send_key("alt-ret") 44 machine.wait_until_succeeds("pgrep xterm") 45 machine.wait_for_window(r"alice.*?machine") 46 machine.screenshot("terminal") 47 48 with subtest("ensure we can communicate through ipc with wmderlandc"): 49 # Kills the previously open xterm 50 machine.succeed("pgrep xterm") 51 machine.execute("DISPLAY=:0 wmderlandc kill") 52 machine.fail("pgrep xterm") 53 ''; 54})