nixosTests.plasma5: port to python

This commit is contained in:
worldofpeace 2019-11-06 20:46:44 -05:00
parent e4962aa6a7
commit 87f3224765

View File

@ -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")
'';
})