about summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
authorBobby Rong <rjl931189261@126.com>2023-12-28 21:51:33 +0800
committerGitHub <noreply@github.com>2023-12-28 21:51:33 +0800
commitaf9ae66959be3cad1cf40b06a830ffa08caff09e (patch)
tree61126aaada8754681e2ae695425c7c44c36492b7 /nixos/tests
parent2fb49c23d3e2bba265934e6123bf716239719965 (diff)
parentbf4be3573dcf33e56e4dfaa714b7953f4cb5b2cb (diff)
downloadnixlib-af9ae66959be3cad1cf40b06a830ffa08caff09e.tar
nixlib-af9ae66959be3cad1cf40b06a830ffa08caff09e.tar.gz
nixlib-af9ae66959be3cad1cf40b06a830ffa08caff09e.tar.bz2
nixlib-af9ae66959be3cad1cf40b06a830ffa08caff09e.tar.lz
nixlib-af9ae66959be3cad1cf40b06a830ffa08caff09e.tar.xz
nixlib-af9ae66959be3cad1cf40b06a830ffa08caff09e.tar.zst
nixlib-af9ae66959be3cad1cf40b06a830ffa08caff09e.zip
Merge pull request #277127 from bobby285271/upd/nixosTests.mate
nixosTests.mate: Extend the test
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/mate.nix27
1 files changed, 25 insertions, 2 deletions
diff --git a/nixos/tests/mate.nix b/nixos/tests/mate.nix
index 78ba59c5fc20..48582e18d520 100644
--- a/nixos/tests/mate.nix
+++ b/nixos/tests/mate.nix
@@ -27,9 +27,12 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
     hardware.pulseaudio.enable = true;
   };
 
+  enableOCR = true;
+
   testScript = { nodes, ... }:
     let
       user = nodes.machine.users.users.alice;
+      env = "DISPLAY=:0.0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/${toString user.uid}/bus";
     in
     ''
       with subtest("Wait for login"):
@@ -48,11 +51,31 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
           machine.wait_for_window("Bottom Panel")
           machine.wait_until_succeeds("pgrep caja")
           machine.wait_for_window("Caja")
+          machine.wait_for_text('(Applications|Places|System)')
+          machine.wait_for_text('(Computer|Home|Trash)')
+
+      with subtest("Lock the screen"):
+          machine.wait_until_succeeds("su - ${user.name} -c '${env} mate-screensaver-command -q' | grep 'The screensaver is inactive'")
+          machine.succeed("su - ${user.name} -c '${env} mate-screensaver-command -l >&2 &'")
+          machine.wait_until_succeeds("su - ${user.name} -c '${env} mate-screensaver-command -q' | grep 'The screensaver is active'")
+          machine.sleep(2)
+          machine.send_chars("${user.password}", delay=0.2)
+          machine.wait_for_text("${user.description}")
+          machine.screenshot("screensaver")
+          machine.send_chars("\n")
+          machine.wait_until_succeeds("su - ${user.name} -c '${env} mate-screensaver-command -q' | grep 'The screensaver is inactive'")
+
+      with subtest("Open MATE control center"):
+          machine.succeed("su - ${user.name} -c '${env} mate-control-center >&2 &'")
+          machine.wait_for_window("Control Center")
+          machine.wait_for_text('(Groups|Administration|Hardware)')
 
       with subtest("Open MATE terminal"):
-          machine.succeed("su - ${user.name} -c 'DISPLAY=:0.0 mate-terminal >&2 &'")
+          machine.succeed("su - ${user.name} -c '${env} mate-terminal >&2 &'")
           machine.wait_for_window("Terminal")
-          machine.sleep(20)
+
+      with subtest("Check if MATE has ever coredumped"):
+          machine.fail("coredumpctl --json=short | grep -E 'mate|marco|caja'")
           machine.screenshot("screen")
     '';
 })