summary refs log tree commit diff
path: root/nixos/tests/xautolock.nix
blob: ee46d9e05b068a5bc70574675dad5fd48e79aa45 (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
import ./make-test.nix ({ pkgs, lib, ... }:

with lib;

{
  name = "xautolock";
  meta.maintainers = with pkgs.stdenv.lib.maintainers; [ ma27 ];

  nodes.machine = {
    imports = [ ./common/x11.nix ./common/user-account.nix ];

    services.xserver.displayManager.auto.user = "bob";
    services.xserver.xautolock.enable = true;
    services.xserver.xautolock.time = 1;
  };

  testScript = ''
    $machine->start;
    $machine->waitForX;
    $machine->mustFail("pgrep xlock");
    $machine->sleep(120);
    $machine->mustSucceed("pgrep xlock");
  '';
})