summary refs log tree commit diff
path: root/nixos/tests/i3wm.nix
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2015-03-05 05:16:26 +0100
committeraszlig <aszlig@redmoonstudios.org>2015-03-05 05:21:36 +0100
commit19a749460072592568fee7387a3a888a83d4c9ca (patch)
treef095fa4f237a7bc30e85393389e1454bd368b432 /nixos/tests/i3wm.nix
parent7915060d7955975318c99a0ec1de0543ec063d07 (diff)
downloadnixpkgs-19a749460072592568fee7387a3a888a83d4c9ca.tar
nixpkgs-19a749460072592568fee7387a3a888a83d4c9ca.tar.gz
nixpkgs-19a749460072592568fee7387a3a888a83d4c9ca.tar.bz2
nixpkgs-19a749460072592568fee7387a3a888a83d4c9ca.tar.lz
nixpkgs-19a749460072592568fee7387a3a888a83d4c9ca.tar.xz
nixpkgs-19a749460072592568fee7387a3a888a83d4c9ca.tar.zst
nixpkgs-19a749460072592568fee7387a3a888a83d4c9ca.zip
nixos: Add VM test for i3 window manager.
Currently just makes sure that by default it's possible to open a
terminal.

And exactly this should be the main point that might confuse users of i3
in NixOS, because i3 doesn't print a warning/error if it is unable to
start the terminal emulator.

Thanks to @waaaaargh for reporting this issue.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'nixos/tests/i3wm.nix')
-rw-r--r--nixos/tests/i3wm.nix28
1 files changed, 28 insertions, 0 deletions
diff --git a/nixos/tests/i3wm.nix b/nixos/tests/i3wm.nix
new file mode 100644
index 00000000000..0966dba8a3c
--- /dev/null
+++ b/nixos/tests/i3wm.nix
@@ -0,0 +1,28 @@
+import ./make-test.nix {
+  name = "i3wm";
+
+  machine = { lib, pkgs, ... }: {
+    imports = [ ./common/x11.nix ./common/user-account.nix ];
+    services.xserver.displayManager.auto.user = "alice";
+    services.xserver.windowManager.default = lib.mkForce "i3";
+    services.xserver.windowManager.i3.enable = true;
+  };
+
+  testScript = { nodes, ... }: ''
+    $machine->waitForX;
+    $machine->waitForWindow(qr/first configuration/);
+    $machine->sleep(1);
+    $machine->screenshot("started");
+    $machine->sendKeys("ret");
+    $machine->sleep(1);
+    $machine->sendKeys("alt");
+    $machine->sleep(1);
+    $machine->screenshot("configured");
+    $machine->sendKeys("ret");
+    $machine->sleep(2);
+    $machine->sendKeys("alt-ret");
+    $machine->waitForWindow(qr/machine.*alice/);
+    $machine->sleep(1);
+    $machine->screenshot("terminal");
+  '';
+}