nixosTests.xfce: port to python

This commit is contained in:
worldofpeace 2019-11-09 15:34:51 -05:00
parent a80f1c4151
commit a72f8a36de
1 changed files with 14 additions and 13 deletions

View File

@ -1,4 +1,4 @@
import ./make-test.nix ({ pkgs, ...} : { import ./make-test-python.nix ({ pkgs, ...} : {
name = "xfce"; name = "xfce";
machine = machine =
@ -18,20 +18,21 @@ import ./make-test.nix ({ pkgs, ...} : {
virtualisation.memorySize = 1024; virtualisation.memorySize = 1024;
}; };
testScript = testScript = { nodes, ... }: let
'' user = nodes.machine.config.users.users.alice;
$machine->waitForX; in ''
$machine->waitForFile("/home/alice/.Xauthority"); machine.wait_for_x()
$machine->succeed("xauth merge ~alice/.Xauthority"); machine.wait_for_file("${user.home}/.Xauthority")
$machine->waitForWindow(qr/xfce4-panel/); machine.succeed("xauth merge ${user.home}/.Xauthority")
$machine->sleep(10); machine.wait_for_window("xfce4-panel")
machine.sleep(10)
# Check that logging in has given the user ownership of devices. # Check that logging in has given the user ownership of devices.
$machine->succeed("getfacl -p /dev/snd/timer | grep -q alice"); machine.succeed("getfacl -p /dev/snd/timer | grep -q ${user.name}")
$machine->succeed("su - alice -c 'DISPLAY=:0.0 xfce4-terminal &'"); machine.succeed("su - ${user.name} -c 'DISPLAY=:0.0 xfce4-terminal &'")
$machine->waitForWindow(qr/Terminal/); machine.wait_for_window("Terminal")
$machine->sleep(10); machine.sleep(10)
$machine->screenshot("screen"); machine.screenshot("screen")
''; '';
}) })