Skip to content

Commit

Permalink
nixosTests.plasma5: port to python
Browse files Browse the repository at this point in the history
  • Loading branch information
worldofpeace committed Nov 25, 2019
1 parent e4962aa commit 87f3224
Showing 1 changed file with 29 additions and 22 deletions.
51 changes: 29 additions & 22 deletions nixos/tests/plasma5.nix
Expand Up @@ -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");
$machine->waitUntilSucceeds("pgrep plasmashell");
$machine->waitForWindow("^Desktop ");
# Check that logging in has given the user ownership of devices.
$machine->succeed("getfacl -p /dev/snd/timer | grep -q alice");
$machine->execute("su - alice -c 'DISPLAY=:0.0 dolphin &'");
$machine->waitForWindow(" Dolphin");
$machine->execute("su - alice -c 'DISPLAY=:0.0 konsole &'");
$machine->waitForWindow("Konsole");
$machine->execute("su - alice -c 'DISPLAY=:0.0 systemsettings5 &'");
$machine->waitForWindow("Settings");
$machine->execute("${xdo} key Alt+F1 sleep 10");
$machine->screenshot("screen");
with subtest("Wait for login"):
start_all()
machine.wait_for_file("${user.home}/.Xauthority")
machine.succeed("xauth merge ${user.home}/.Xauthority")
with subtest("Check plasmashell started"):
machine.wait_until_succeeds("pgrep plasmashell")
machine.wait_for_window("^Desktop ")
with subtest("Check that logging in has given the user ownership of devices"):
machine.succeed("getfacl -p /dev/snd/timer | grep -q ${user.name}")
with subtest("Run Dolphin"):
machine.execute("su - ${user.name} -c 'DISPLAY=:0.0 dolphin &'")
machine.wait_for_window(" Dolphin")
with subtest("Run Konsole"):
machine.execute("su - ${user.name} -c 'DISPLAY=:0.0 konsole &'")
machine.wait_for_window("Konsole")
with subtest("Run systemsettings"):
machine.execute("su - ${user.name} -c 'DISPLAY=:0.0 systemsettings5 &'")
machine.wait_for_window("Settings")
with subtest("Wait to get a screenshot"):
machine.execute(
"${xdo} key Alt+F1 sleep 10"
)
machine.screenshot("screen")
'';
})

0 comments on commit 87f3224

Please sign in to comment.