about summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
authorAleksana <me@aleksana.moe>2024-04-27 19:43:22 +0800
committerGitHub <noreply@github.com>2024-04-27 19:43:22 +0800
commitdfe10d3c0748feb1fd5cf6b4558194fbd452a17a (patch)
treef3ad7bbb03fed44c8bd2c7dea9c9945624a3518a /nixos/tests
parent2bec0248837ca57e32894daa74504fbc9df31af7 (diff)
parent1cdb19472c79d7380cf36352d529bde52648dc98 (diff)
Merge pull request #306054 from Sigmanificient/qtile-tests
qtile: add passthru tests
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/all-tests.nix1
-rw-r--r--nixos/tests/qtile.nix34
2 files changed, 35 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index d27e6b8a2b137..7b47fbf5662e3 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -772,6 +772,7 @@ in {
   qgis = handleTest ./qgis.nix { qgisPackage = pkgs.qgis; };
   qgis-ltr = handleTest ./qgis.nix { qgisPackage = pkgs.qgis-ltr; };
   qownnotes = handleTest ./qownnotes.nix {};
+  qtile = handleTest ./qtile.nix {};
   quake3 = handleTest ./quake3.nix {};
   quicktun = handleTest ./quicktun.nix {};
   quorum = handleTest ./quorum.nix {};
diff --git a/nixos/tests/qtile.nix b/nixos/tests/qtile.nix
new file mode 100644
index 0000000000000..b4d8f9d421144
--- /dev/null
+++ b/nixos/tests/qtile.nix
@@ -0,0 +1,34 @@
+import ./make-test-python.nix ({ lib, ...} : {
+  name = "qtile";
+
+  meta = {
+    maintainers = with lib.maintainers; [ sigmanificient ];
+  };
+
+  nodes.machine = { pkgs, lib, ... }: {
+    imports = [ ./common/x11.nix ./common/user-account.nix ];
+    test-support.displayManager.auto.user = "alice";
+
+    services.xserver.windowManager.qtile.enable = true;
+    services.displayManager.defaultSession = lib.mkForce "none+qtile";
+
+    environment.systemPackages = [ pkgs.kitty ];
+  };
+
+  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 client is available"):
+        machine.succeed("qtile --version")
+
+    with subtest("ensure we can open a new terminal"):
+        machine.sleep(2)
+        machine.send_key("meta_l-ret")
+        machine.wait_for_window(r"alice.*?machine")
+        machine.sleep(2)
+        machine.screenshot("terminal")
+  '';
+})