3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #36706 from Ma27/xautolock-testcase

xautolock: implement basic test to confirm functionality
This commit is contained in:
Graham Christensen 2018-03-13 18:55:04 -04:00 committed by GitHub
commit 1a1abb383a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 0 deletions

View file

@ -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 {};

24
nixos/tests/xautolock.nix Normal file
View file

@ -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");
'';
})