nixosTests.pantheon: use subtest
This commit is contained in:
parent
a60daae733
commit
c16df6bbac
|
@ -24,36 +24,35 @@ import ./make-test-python.nix ({ pkgs, ...} :
|
||||||
user = nodes.machine.config.users.users.alice;
|
user = nodes.machine.config.users.users.alice;
|
||||||
bob = nodes.machine.config.users.users.bob;
|
bob = nodes.machine.config.users.users.bob;
|
||||||
in ''
|
in ''
|
||||||
# Wait for display manager to start
|
|
||||||
machine.wait_for_unit("display-manager.service")
|
machine.wait_for_unit("display-manager.service")
|
||||||
|
|
||||||
# Test we can see usernames in elementary-greeter
|
with subtest("Test we can see usernames in elementary-greeter"):
|
||||||
machine.wait_for_text("${user.description}")
|
machine.wait_for_text("${user.description}")
|
||||||
machine.wait_for_text("${bob.description}")
|
machine.wait_for_text("${bob.description}")
|
||||||
machine.screenshot("elementary_greeter_lightdm")
|
machine.screenshot("elementary_greeter_lightdm")
|
||||||
|
|
||||||
# Log in with elementary-greeter
|
with subtest("Login with elementary-greeter"):
|
||||||
machine.send_chars("${user.password}\n")
|
machine.send_chars("${user.password}\n")
|
||||||
machine.wait_for_x()
|
machine.wait_for_x()
|
||||||
machine.wait_for_file("${user.home}/.Xauthority")
|
machine.wait_for_file("${user.home}/.Xauthority")
|
||||||
machine.succeed("xauth merge ${user.home}/.Xauthority")
|
machine.succeed("xauth merge ${user.home}/.Xauthority")
|
||||||
|
|
||||||
# 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 ${user.name}")
|
machine.succeed("getfacl -p /dev/snd/timer | grep -q ${user.name}")
|
||||||
|
|
||||||
# TODO: DBus API could eliminate this?
|
# TODO: DBus API could eliminate this? Pantheon uses Bamf.
|
||||||
# Check if pantheon-shell components actually start
|
with subtest("Check if pantheon session components actually start"):
|
||||||
machine.wait_until_succeeds("pgrep gala")
|
machine.wait_until_succeeds("pgrep gala")
|
||||||
machine.wait_for_window("gala")
|
machine.wait_for_window("gala")
|
||||||
machine.wait_until_succeeds("pgrep wingpanel")
|
machine.wait_until_succeeds("pgrep wingpanel")
|
||||||
machine.wait_for_window("wingpanel")
|
machine.wait_for_window("wingpanel")
|
||||||
machine.wait_until_succeeds("pgrep plank")
|
machine.wait_until_succeeds("pgrep plank")
|
||||||
machine.wait_for_window("plank")
|
machine.wait_for_window("plank")
|
||||||
|
|
||||||
# Open elementary terminal
|
with subtest("Open elementary terminal"):
|
||||||
machine.execute("su - ${user.name} -c 'DISPLAY=:0 io.elementary.terminal &'")
|
machine.execute("su - ${user.name} -c 'DISPLAY=:0 io.elementary.terminal &'")
|
||||||
machine.wait_for_window("io.elementary.terminal")
|
machine.wait_for_window("io.elementary.terminal")
|
||||||
machine.sleep(20)
|
machine.sleep(20)
|
||||||
machine.screenshot("screen")
|
machine.screenshot("screen")
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue