1 import ./make-test-python.nix ({ pkgs, lib, ... }: {
2 name = "pass-secret-service";
3 meta.maintainers = with lib.maintainers; [ vancluever AndersonTorres ];
6 ok = { nodes, pkgs, ... }:
8 imports = [ ./common/x11.nix ./common/user-account.nix ];
9 test-support.displayManager.auto.user = "alice";
10 services.xscreensaver.enable = true;
13 empty_wrapperPrefix = { nodes, pkgs, ... }:
15 imports = [ ./common/x11.nix ./common/user-account.nix ];
16 test-support.displayManager.auto.user = "alice";
17 services.xscreensaver.enable = true;
20 xscreensaver = super.xscreensaver.override {
27 bad_wrapperPrefix = { nodes, pkgs, ... }:
29 imports = [ ./common/x11.nix ./common/user-account.nix ];
30 test-support.displayManager.auto.user = "alice";
31 services.xscreensaver.enable = true;
34 xscreensaver = super.xscreensaver.override {
35 wrapperPrefix = "/a/bad/path";
44 ok.wait_for_unit("xscreensaver", "alice")
45 _, output_ok = ok.systemctl("status xscreensaver", "alice")
46 assert 'To prevent the kernel from randomly unlocking' not in output_ok
47 assert 'your screen via the out-of-memory killer' not in output_ok
48 assert '"xscreensaver-auth" must be setuid root' not in output_ok
50 empty_wrapperPrefix.wait_for_x()
51 empty_wrapperPrefix.wait_for_unit("xscreensaver", "alice")
52 _, output_empty_wrapperPrefix = empty_wrapperPrefix.systemctl("status xscreensaver", "alice")
53 assert 'To prevent the kernel from randomly unlocking' in output_empty_wrapperPrefix
54 assert 'your screen via the out-of-memory killer' in output_empty_wrapperPrefix
55 assert '"xscreensaver-auth" must be setuid root' in output_empty_wrapperPrefix
57 bad_wrapperPrefix.wait_for_x()
58 bad_wrapperPrefix.wait_for_unit("xscreensaver", "alice")
59 _, output_bad_wrapperPrefix = bad_wrapperPrefix.systemctl("status xscreensaver", "alice")
60 assert 'To prevent the kernel from randomly unlocking' in output_bad_wrapperPrefix
61 assert 'your screen via the out-of-memory killer' in output_bad_wrapperPrefix
62 assert '"xscreensaver-auth" must be setuid root' in output_bad_wrapperPrefix