diff options
author | Jonathan Ringer <jonringer117@gmail.com> | 2019-11-27 22:57:50 -0800 |
---|---|---|
committer | Jonathan Ringer <jonringer117@gmail.com> | 2019-11-27 22:57:50 -0800 |
commit | 0c1c18ca4416baa46c940960aa5e619873a2318e (patch) | |
tree | 78d7fd3eb63e91fa99267e2d91a2a891ee29f567 /nixos/tests/xss-lock.nix | |
parent | 4cc592761db580855b47fb84776e68b1d936521c (diff) | |
parent | f4f816902112778172565baf91c2483186027c3b (diff) | |
download | nixpkgs-0c1c18ca4416baa46c940960aa5e619873a2318e.tar nixpkgs-0c1c18ca4416baa46c940960aa5e619873a2318e.tar.gz nixpkgs-0c1c18ca4416baa46c940960aa5e619873a2318e.tar.bz2 nixpkgs-0c1c18ca4416baa46c940960aa5e619873a2318e.tar.lz nixpkgs-0c1c18ca4416baa46c940960aa5e619873a2318e.tar.xz nixpkgs-0c1c18ca4416baa46c940960aa5e619873a2318e.tar.zst nixpkgs-0c1c18ca4416baa46c940960aa5e619873a2318e.zip |
Merge branch 'master' into staging-next
Diffstat (limited to 'nixos/tests/xss-lock.nix')
-rw-r--r-- | nixos/tests/xss-lock.nix | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/nixos/tests/xss-lock.nix b/nixos/tests/xss-lock.nix index 0d757e8cef3..3a7dea07d53 100644 --- a/nixos/tests/xss-lock.nix +++ b/nixos/tests/xss-lock.nix @@ -1,4 +1,4 @@ -import ./make-test.nix ({ pkgs, lib, ... }: +import ./make-test-python.nix ({ pkgs, lib, ... }: with lib; @@ -26,15 +26,19 @@ with lib; }; testScript = '' - startAll; - - ${concatStringsSep "\n" (mapAttrsToList (name: lockCmd: '' - ${"$"+name}->start; - ${"$"+name}->waitForX; - ${"$"+name}->waitForUnit("xss-lock.service", "alice"); - ${"$"+name}->fail("pgrep ${lockCmd}"); - ${"$"+name}->succeed("su -l alice -c 'xset dpms force standby'"); - ${"$"+name}->waitUntilSucceeds("pgrep ${lockCmd}"); - '') { simple = "i3lock"; custom_lockcmd = "xlock"; })} + def perform_xsslock_test(machine, lockCmd): + machine.start() + machine.wait_for_x() + machine.wait_for_unit("xss-lock.service", "alice") + machine.fail(f"pgrep {lockCmd}") + machine.succeed("su -l alice -c 'xset dpms force standby'") + machine.wait_until_succeeds(f"pgrep {lockCmd}") + + + with subtest("simple"): + perform_xsslock_test(simple, "i3lock") + + with subtest("custom_cmd"): + perform_xsslock_test(custom_lockcmd, "xlock") ''; }) |