1 import ./make-test-python.nix ({ pkgs, lib, ... }: {
3 meta.maintainers = [ ];
7 imports = [ ./common/x11.nix ./common/user-account.nix ];
8 programs.xss-lock.enable = true;
9 test-support.displayManager.auto.user = "alice";
12 custom_lockcmd = { pkgs, ... }: {
13 imports = [ ./common/x11.nix ./common/user-account.nix ];
14 test-support.displayManager.auto.user = "alice";
18 extraOptions = [ "-n" "${pkgs.libnotify}/bin/notify-send 'About to sleep!'"];
19 lockerCommand = "${pkgs.xlockmore}/bin/xlock -mode ant";
25 def perform_xsslock_test(machine, lockCmd):
28 machine.wait_for_unit("xss-lock.service", "alice")
29 machine.fail(f"pgrep {lockCmd}")
30 machine.succeed("su -l alice -c 'xset dpms force standby'")
31 machine.wait_until_succeeds(f"pgrep {lockCmd}")
34 with subtest("simple"):
35 perform_xsslock_test(simple, "i3lock")
37 with subtest("custom_cmd"):
38 perform_xsslock_test(custom_lockcmd, "xlock")