Merge pull request #73138 from worldofpeace/port-xfce-tests

Port xfce test to python
This commit is contained in:
worldofpeace 2019-11-20 04:57:26 +00:00 committed by GitHub
commit 4414a3bc7c
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 = "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")
''; '';
}) })