mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-10-31 06:31:20 +00:00
nixosTests.plasma5: port to python
This commit is contained in:
parent
e4962aa6a7
commit
87f3224765
@ -26,27 +26,34 @@ import ./make-test-python.nix ({ pkgs, ...} :
|
||||
user = nodes.machine.config.users.users.alice;
|
||||
xdo = "${pkgs.xdotool}/bin/xdotool";
|
||||
in ''
|
||||
startAll;
|
||||
# wait for log in
|
||||
$machine->waitForFile("/home/alice/.Xauthority");
|
||||
$machine->succeed("xauth merge ~alice/.Xauthority");
|
||||
with subtest("Wait for login"):
|
||||
start_all()
|
||||
machine.wait_for_file("${user.home}/.Xauthority")
|
||||
machine.succeed("xauth merge ${user.home}/.Xauthority")
|
||||
|
||||
$machine->waitUntilSucceeds("pgrep plasmashell");
|
||||
$machine->waitForWindow("^Desktop ");
|
||||
with subtest("Check plasmashell started"):
|
||||
machine.wait_until_succeeds("pgrep plasmashell")
|
||||
machine.wait_for_window("^Desktop ")
|
||||
|
||||
# Check that logging in has given the user ownership of devices.
|
||||
$machine->succeed("getfacl -p /dev/snd/timer | grep -q alice");
|
||||
with subtest("Check that logging in has given the user ownership of devices"):
|
||||
machine.succeed("getfacl -p /dev/snd/timer | grep -q ${user.name}")
|
||||
|
||||
$machine->execute("su - alice -c 'DISPLAY=:0.0 dolphin &'");
|
||||
$machine->waitForWindow(" Dolphin");
|
||||
with subtest("Run Dolphin"):
|
||||
machine.execute("su - ${user.name} -c 'DISPLAY=:0.0 dolphin &'")
|
||||
machine.wait_for_window(" Dolphin")
|
||||
|
||||
$machine->execute("su - alice -c 'DISPLAY=:0.0 konsole &'");
|
||||
$machine->waitForWindow("Konsole");
|
||||
with subtest("Run Konsole"):
|
||||
machine.execute("su - ${user.name} -c 'DISPLAY=:0.0 konsole &'")
|
||||
machine.wait_for_window("Konsole")
|
||||
|
||||
$machine->execute("su - alice -c 'DISPLAY=:0.0 systemsettings5 &'");
|
||||
$machine->waitForWindow("Settings");
|
||||
with subtest("Run systemsettings"):
|
||||
machine.execute("su - ${user.name} -c 'DISPLAY=:0.0 systemsettings5 &'")
|
||||
machine.wait_for_window("Settings")
|
||||
|
||||
$machine->execute("${xdo} key Alt+F1 sleep 10");
|
||||
$machine->screenshot("screen");
|
||||
with subtest("Wait to get a screenshot"):
|
||||
machine.execute(
|
||||
"${xdo} key Alt+F1 sleep 10"
|
||||
)
|
||||
machine.screenshot("screen")
|
||||
'';
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user