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