mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-14 05:29:20 +03:00
nixosTests.mate: Extend the test
It is always nice to have some OCR tests and a coredump check.
This commit is contained in:
parent
167993f3e0
commit
4a31c957c1
1 changed files with 25 additions and 2 deletions
|
@ -27,9 +27,12 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
|
||||||
hardware.pulseaudio.enable = true;
|
hardware.pulseaudio.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enableOCR = true;
|
||||||
|
|
||||||
testScript = { nodes, ... }:
|
testScript = { nodes, ... }:
|
||||||
let
|
let
|
||||||
user = nodes.machine.users.users.alice;
|
user = nodes.machine.users.users.alice;
|
||||||
|
env = "DISPLAY=:0.0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/${toString user.uid}/bus";
|
||||||
in
|
in
|
||||||
''
|
''
|
||||||
with subtest("Wait for login"):
|
with subtest("Wait for login"):
|
||||||
|
@ -48,11 +51,31 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
|
||||||
machine.wait_for_window("Bottom Panel")
|
machine.wait_for_window("Bottom Panel")
|
||||||
machine.wait_until_succeeds("pgrep caja")
|
machine.wait_until_succeeds("pgrep caja")
|
||||||
machine.wait_for_window("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"):
|
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.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")
|
machine.screenshot("screen")
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue