From 4f225f96d5a379e9955652e8867541ad04c297f6 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sat, 10 Mar 2018 00:08:27 +0100 Subject: [PATCH] xautolock: implement basic test to confirm functionality --- nixos/release.nix | 1 + nixos/tests/xautolock.nix | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 nixos/tests/xautolock.nix diff --git a/nixos/release.nix b/nixos/release.nix index a1310a409a1e..6a3fcea17683 100644 --- a/nixos/release.nix +++ b/nixos/release.nix @@ -368,6 +368,7 @@ in rec { tests.vault = callTest tests/vault.nix {}; tests.virtualbox = callSubTestsOnTheseSystems ["x86_64-linux"] tests/virtualbox.nix {}; tests.wordpress = callTest tests/wordpress.nix {}; + tests.xautolock = callTest tests/xautolock.nix {}; tests.xfce = callTest tests/xfce.nix {}; tests.xmonad = callTest tests/xmonad.nix {}; tests.xrdp = callTest tests/xrdp.nix {}; diff --git a/nixos/tests/xautolock.nix b/nixos/tests/xautolock.nix new file mode 100644 index 000000000000..ee46d9e05b06 --- /dev/null +++ b/nixos/tests/xautolock.nix @@ -0,0 +1,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"); + ''; +})