git.iko.soy/typeable/nixpkgs
on master help sign in
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>

commit19a749460072592568fee7387a3a888a83d4c9ca authoraszlig <aszlig@redmoonstudios.org> dateThu 5 Mar 2015, 05:16 (12 years ago) parent7915060
2 files changed+29
nixos/release.nix+1 nixos/tests/i3wm.nix+28
nixos/release.nix+1
@@ -254,6 +254,7 @@ in rec {
254254 tests.fleet = scrubDrv (import tests/fleet.nix { system = "x86_64-linux"; });
255255 #tests.gitlab = callTest tests/gitlab.nix {};
256256 tests.gnome3 = callTest tests/gnome3.nix {};
257+ tests.i3wm = callTest tests/i3wm.nix {};
257258 tests.installer.grub1 = forAllSystems (system: scrubDrv (import tests/installer.nix { inherit system; }).grub1.test);
258259 tests.installer.lvm = forAllSystems (system: scrubDrv (import tests/installer.nix { inherit system; }).lvm.test);
259260 tests.installer.rebuildCD = forAllSystems (system: scrubDrv (import tests/installer.nix { inherit system; }).rebuildCD.test);
nixos/tests/i3wm.nixnew file+28
@@ -0,0 +1,28 @@
1+import ./make-test.nix {
2+ name = "i3wm";
3+
4+ machine = { lib, pkgs, ... }: {
5+ imports = [ ./common/x11.nix ./common/user-account.nix ];
6+ services.xserver.displayManager.auto.user = "alice";
7+ services.xserver.windowManager.default = lib.mkForce "i3";
8+ services.xserver.windowManager.i3.enable = true;
9+ };
10+
11+ testScript = { nodes, ... }: ''
12+ $machine->waitForX;
13+ $machine->waitForWindow(qr/first configuration/);
14+ $machine->sleep(1);
15+ $machine->screenshot("started");
16+ $machine->sendKeys("ret");
17+ $machine->sleep(1);
18+ $machine->sendKeys("alt");
19+ $machine->sleep(1);
20+ $machine->screenshot("configured");
21+ $machine->sendKeys("ret");
22+ $machine->sleep(2);
23+ $machine->sendKeys("alt-ret");
24+ $machine->waitForWindow(qr/machine.*alice/);
25+ $machine->sleep(1);
26+ $machine->screenshot("terminal");
27+ '';
28+}