diff options
author | takagiy <takagiy.4dev@gmail.com> | 2021-01-27 23:44:27 +0900 |
---|---|---|
committer | takagiy <takagiy.4dev@gmail.com> | 2021-02-06 02:36:39 +0900 |
commit | b248510454fb9ab7d1857aede9d974be251e667c (patch) | |
tree | d2f2b60c332650831615cffb4acc9f042b4ce177 /nixos/tests | |
parent | 7b8376e5d323fc0633079a3de9f28dba9a323f2e (diff) | |
download | nixpkgs-b248510454fb9ab7d1857aede9d974be251e667c.tar nixpkgs-b248510454fb9ab7d1857aede9d974be251e667c.tar.gz nixpkgs-b248510454fb9ab7d1857aede9d974be251e667c.tar.bz2 nixpkgs-b248510454fb9ab7d1857aede9d974be251e667c.tar.lz nixpkgs-b248510454fb9ab7d1857aede9d974be251e667c.tar.xz nixpkgs-b248510454fb9ab7d1857aede9d974be251e667c.tar.zst nixpkgs-b248510454fb9ab7d1857aede9d974be251e667c.zip |
wmderland: init at 2020-07-17
Diffstat (limited to 'nixos/tests')
-rw-r--r-- | nixos/tests/all-tests.nix | 1 | ||||
-rw-r--r-- | nixos/tests/wmderland.nix | 54 |
2 files changed, 55 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 9ffeba27a7f..536778467df 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -371,6 +371,7 @@ in virtualbox = handleTestOn ["x86_64-linux"] ./virtualbox.nix {}; wasabibackend = handleTest ./wasabibackend.nix {}; wireguard = handleTest ./wireguard {}; + wmderland = handleTest ./wmderland.nix {}; wordpress = handleTest ./wordpress.nix {}; xandikos = handleTest ./xandikos.nix {}; xautolock = handleTest ./xautolock.nix {}; diff --git a/nixos/tests/wmderland.nix b/nixos/tests/wmderland.nix new file mode 100644 index 00000000000..d121ed98b7a --- /dev/null +++ b/nixos/tests/wmderland.nix @@ -0,0 +1,54 @@ +import ./make-test-python.nix ({ pkgs, ...} : { + name = "wmderland"; + meta = with pkgs.stdenv.lib.maintainers; { + maintainers = [ takagiy ]; + }; + + machine = { lib, ... }: { + imports = [ ./common/x11.nix ./common/user-account.nix ]; + test-support.displayManager.auto.user = "alice"; + services.xserver.displayManager.defaultSession = lib.mkForce "none+wmderland"; + services.xserver.windowManager.wmderland.enable = true; + + systemd.services.setupWmderlandConfig = { + wantedBy = [ "multi-user.target" ]; + before = [ "multi-user.target" ]; + environment = { + HOME = "/home/alice"; + }; + unitConfig = { + type = "oneshot"; + RemainAfterExit = true; + user = "alice"; + }; + script = let + config = pkgs.writeText "config" '' + set $Mod = Mod1 + bindsym $Mod+Return exec ${pkgs.xterm}/bin/xterm -cm -pc + ''; + in '' + mkdir -p $HOME/.config/wmderland + cp ${config} $HOME/.config/wmderland/config + ''; + }; + }; + + testScript = { ... }: '' + with subtest("ensure x starts"): + machine.wait_for_x() + machine.wait_for_file("/home/alice/.Xauthority") + machine.succeed("xauth merge ~alice/.Xauthority") + + with subtest("ensure we can open a new terminal"): + machine.send_key("alt-ret") + machine.wait_until_succeeds("pgrep xterm") + machine.wait_for_window(r"alice.*?machine") + machine.screenshot("terminal") + + with subtest("ensure we can communicate through ipc with wmderlandc"): + # Kills the previously open xterm + machine.succeed("pgrep xterm") + machine.execute("DISPLAY=:0 wmderlandc kill") + machine.fail("pgrep xterm") + ''; +}) |