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; user = nodes.machine.config.users.users.alice;
xdo = "${pkgs.xdotool}/bin/xdotool"; xdo = "${pkgs.xdotool}/bin/xdotool";
in '' in ''
startAll; with subtest("Wait for login"):
# wait for log in start_all()
$machine->waitForFile("/home/alice/.Xauthority"); machine.wait_for_file("${user.home}/.Xauthority")
$machine->succeed("xauth merge ~alice/.Xauthority"); machine.succeed("xauth merge ${user.home}/.Xauthority")
$machine->waitUntilSucceeds("pgrep plasmashell"); with subtest("Check plasmashell started"):
$machine->waitForWindow("^Desktop "); machine.wait_until_succeeds("pgrep plasmashell")
machine.wait_for_window("^Desktop ")
# Check that logging in has given the user ownership of devices. with subtest("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->execute("su - alice -c 'DISPLAY=:0.0 dolphin &'"); with subtest("Run Dolphin"):
$machine->waitForWindow(" 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 &'"); with subtest("Run Konsole"):
$machine->waitForWindow("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 &'"); with subtest("Run systemsettings"):
$machine->waitForWindow("Settings"); machine.execute("su - ${user.name} -c 'DISPLAY=:0.0 systemsettings5 &'")
machine.wait_for_window("Settings")
$machine->execute("${xdo} key Alt+F1 sleep 10"); with subtest("Wait to get a screenshot"):
$machine->screenshot("screen"); machine.execute(
"${xdo} key Alt+F1 sleep 10"
)
machine.screenshot("screen")
''; '';
}) })