Merge pull request #73137 from worldofpeace/port-xmonad-test

nixosTests.xmonad: port to python
This commit is contained in:
worldofpeace 2019-11-11 20:23:41 +00:00 committed by GitHub
commit deb125271c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
import ./make-test.nix ({ pkgs, ...} : {
import ./make-test-python.nix ({ pkgs, ...} : {
name = "xmonad";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ nequissimus ];
@ -21,19 +21,21 @@ import ./make-test.nix ({ pkgs, ...} : {
};
};
testScript = { ... }: ''
$machine->waitForX;
$machine->waitForFile("/home/alice/.Xauthority");
$machine->succeed("xauth merge ~alice/.Xauthority");
$machine->sendKeys("alt-ctrl-x");
$machine->waitForWindow(qr/alice.*machine/);
$machine->sleep(1);
$machine->screenshot("terminal");
$machine->waitUntilSucceeds("xmonad --restart");
$machine->sleep(3);
$machine->sendKeys("alt-shift-ret");
$machine->waitForWindow(qr/alice.*machine/);
$machine->sleep(1);
$machine->screenshot("terminal");
testScript = { nodes, ... }: let
user = nodes.machine.config.users.users.alice;
in ''
machine.wait_for_x()
machine.wait_for_file("${user.home}/.Xauthority")
machine.succeed("xauth merge ${user.home}/.Xauthority")
machine.send_chars("alt-ctrl-x")
machine.wait_for_window("${user.name}.*machine")
machine.sleep(1)
machine.screenshot("terminal")
machine.wait_until_succeeds("xmonad --restart")
machine.sleep(3)
machine.send_chars("alt-shift-ret")
machine.wait_for_window("${user.name}.*machine")
machine.sleep(1)
machine.screenshot("terminal")
'';
})