summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
authorGraham Christensen <graham@grahamc.com>2018-03-13 18:55:04 -0400
committerGitHub <noreply@github.com>2018-03-13 18:55:04 -0400
commit1a1abb383a3c8baf960c1ef903221622104f9232 (patch)
tree6bc036643cad749472bcddde6cc6c76c96dd7d34 /nixos/tests
parent273fd896bc5eb560ad4dc102cde6a1a5ce9e5c8d (diff)
parent4f225f96d5a379e9955652e8867541ad04c297f6 (diff)
downloadnixlib-1a1abb383a3c8baf960c1ef903221622104f9232.tar
nixlib-1a1abb383a3c8baf960c1ef903221622104f9232.tar.gz
nixlib-1a1abb383a3c8baf960c1ef903221622104f9232.tar.bz2
nixlib-1a1abb383a3c8baf960c1ef903221622104f9232.tar.lz
nixlib-1a1abb383a3c8baf960c1ef903221622104f9232.tar.xz
nixlib-1a1abb383a3c8baf960c1ef903221622104f9232.tar.zst
nixlib-1a1abb383a3c8baf960c1ef903221622104f9232.zip
Merge pull request #36706 from Ma27/xautolock-testcase
xautolock: implement basic test to confirm functionality
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/xautolock.nix24
1 files changed, 24 insertions, 0 deletions
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");
+  '';
+})