summary refs log tree commit diff
path: root/nixos/tests/xss-lock.nix
blob: 045667bdcdec0fc48eb8e677d7d6f97ad98da0ed (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import ./make-test.nix ({ pkgs, lib, ... }:

with lib;

{
  name = "xss-lock";
  meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ma27 ];

  machine = {
    imports = [ ./common/x11.nix ./common/user-account.nix ];
    programs.xss-lock.enable = true;
    programs.xss-lock.lockerCommand = "${pkgs.xlockmore}/bin/xlock";
    services.xserver.displayManager.auto.user = "alice";
  };

  testScript = ''
    $machine->start;
    $machine->waitForX;
    $machine->waitForUnit("xss-lock.service", "alice");

    $machine->fail("pgrep xlock");
    $machine->succeed("su -l alice -c 'xset dpms force standby'");
    $machine->waitUntilSucceeds("pgrep xlock");
  '';
})