at master 2.6 kB view raw
1{ lib, ... }: 2{ 3 name = "pass-secret-service"; 4 meta.maintainers = with lib.maintainers; [ 5 vancluever 6 ]; 7 8 node.pkgsReadOnly = false; 9 10 nodes = { 11 ok = 12 { nodes, pkgs, ... }: 13 { 14 imports = [ 15 ./common/x11.nix 16 ./common/user-account.nix 17 ]; 18 test-support.displayManager.auto.user = "alice"; 19 services.xscreensaver.enable = true; 20 }; 21 22 empty_wrapperPrefix = 23 { nodes, pkgs, ... }: 24 { 25 imports = [ 26 ./common/x11.nix 27 ./common/user-account.nix 28 ]; 29 test-support.displayManager.auto.user = "alice"; 30 services.xscreensaver.enable = true; 31 nixpkgs.overlays = [ 32 (self: super: { 33 xscreensaver = super.xscreensaver.override { 34 wrapperPrefix = ""; 35 }; 36 }) 37 ]; 38 }; 39 40 bad_wrapperPrefix = 41 { nodes, pkgs, ... }: 42 { 43 imports = [ 44 ./common/x11.nix 45 ./common/user-account.nix 46 ]; 47 test-support.displayManager.auto.user = "alice"; 48 services.xscreensaver.enable = true; 49 nixpkgs.overlays = [ 50 (self: super: { 51 xscreensaver = super.xscreensaver.override { 52 wrapperPrefix = "/a/bad/path"; 53 }; 54 }) 55 ]; 56 }; 57 }; 58 59 testScript = '' 60 ok.wait_for_x() 61 ok.wait_for_unit("xscreensaver", "alice") 62 _, output_ok = ok.systemctl("status xscreensaver", "alice") 63 assert 'To prevent the kernel from randomly unlocking' not in output_ok 64 assert 'your screen via the out-of-memory killer' not in output_ok 65 assert '"xscreensaver-auth" must be setuid root' not in output_ok 66 67 empty_wrapperPrefix.wait_for_x() 68 empty_wrapperPrefix.wait_for_unit("xscreensaver", "alice") 69 _, output_empty_wrapperPrefix = empty_wrapperPrefix.systemctl("status xscreensaver", "alice") 70 assert 'To prevent the kernel from randomly unlocking' in output_empty_wrapperPrefix 71 assert 'your screen via the out-of-memory killer' in output_empty_wrapperPrefix 72 assert '"xscreensaver-auth" must be setuid root' in output_empty_wrapperPrefix 73 74 bad_wrapperPrefix.wait_for_x() 75 bad_wrapperPrefix.wait_for_unit("xscreensaver", "alice") 76 _, output_bad_wrapperPrefix = bad_wrapperPrefix.systemctl("status xscreensaver", "alice") 77 assert 'To prevent the kernel from randomly unlocking' in output_bad_wrapperPrefix 78 assert 'your screen via the out-of-memory killer' in output_bad_wrapperPrefix 79 assert '"xscreensaver-auth" must be setuid root' in output_bad_wrapperPrefix 80 ''; 81}