diff options
author | Florian Klink <flokli@flokli.de> | 2019-11-25 21:08:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-25 21:08:25 +0100 |
commit | b16ddb977d3fd4ea4065d7f48281bd415853da0f (patch) | |
tree | ba30e5844fd212f45b7da7b7ad565961384ab07c /nixos | |
parent | e0734891f891ea7c59655d668eea1d4bd20acbac (diff) | |
parent | c16df6bbac6a36a029a622fc45f93f736ec9b340 (diff) | |
download | nixpkgs-b16ddb977d3fd4ea4065d7f48281bd415853da0f.tar nixpkgs-b16ddb977d3fd4ea4065d7f48281bd415853da0f.tar.gz nixpkgs-b16ddb977d3fd4ea4065d7f48281bd415853da0f.tar.bz2 nixpkgs-b16ddb977d3fd4ea4065d7f48281bd415853da0f.tar.lz nixpkgs-b16ddb977d3fd4ea4065d7f48281bd415853da0f.tar.xz nixpkgs-b16ddb977d3fd4ea4065d7f48281bd415853da0f.tar.zst nixpkgs-b16ddb977d3fd4ea4065d7f48281bd415853da0f.zip |
Merge pull request #73140 from worldofpeace/port-pantheon-test
nixosTests.pantheon: port to python
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/tests/pantheon.nix | 65 |
1 files changed, 34 insertions, 31 deletions
diff --git a/nixos/tests/pantheon.nix b/nixos/tests/pantheon.nix index 9888887ee8b..6ff19be1bb9 100644 --- a/nixos/tests/pantheon.nix +++ b/nixos/tests/pantheon.nix @@ -1,9 +1,10 @@ -import ./make-test.nix ({ pkgs, ...} : +import ./make-test-python.nix ({ pkgs, ...} : { name = "pantheon"; + meta = with pkgs.stdenv.lib.maintainers; { - maintainers = [ worldofpeace ]; + maintainers = pkgs.pantheon.maintainers; }; machine = { ... }: @@ -21,35 +22,37 @@ import ./make-test.nix ({ pkgs, ...} : testScript = { nodes, ... }: let user = nodes.machine.config.users.users.alice; + bob = nodes.machine.config.users.users.bob; in '' - startAll; - - # Wait for display manager to start - $machine->waitForText(qr/${user.description}/); - $machine->screenshot("lightdm"); - - # Log in - $machine->sendChars("${user.password}\n"); - $machine->waitForFile("/home/alice/.Xauthority"); - $machine->succeed("xauth merge ~alice/.Xauthority"); - - # Check if "pantheon-shell" components actually start - $machine->waitUntilSucceeds("pgrep gala"); - $machine->waitForWindow(qr/gala/); - $machine->waitUntilSucceeds("pgrep wingpanel"); - $machine->waitForWindow("wingpanel"); - $machine->waitUntilSucceeds("pgrep plank"); - $machine->waitForWindow(qr/plank/); - - # Check that logging in has given the user ownership of devices. - $machine->succeed("getfacl -p /dev/snd/timer | grep -q alice"); - - # Open elementary terminal - $machine->execute("su - alice -c 'DISPLAY=:0.0 io.elementary.terminal &'"); - $machine->waitForWindow(qr/io.elementary.terminal/); - - # Take a screenshot of the desktop - $machine->sleep(20); - $machine->screenshot("screen"); + machine.wait_for_unit("display-manager.service") + + with subtest("Test we can see usernames in elementary-greeter"): + machine.wait_for_text("${user.description}") + machine.wait_for_text("${bob.description}") + machine.screenshot("elementary_greeter_lightdm") + + with subtest("Login with elementary-greeter"): + machine.send_chars("${user.password}\n") + machine.wait_for_x() + machine.wait_for_file("${user.home}/.Xauthority") + machine.succeed("xauth merge ${user.home}/.Xauthority") + + with subtest("Check that logging in has given the user ownership of devices"): + machine.succeed("getfacl -p /dev/snd/timer | grep -q ${user.name}") + + # TODO: DBus API could eliminate this? Pantheon uses Bamf. + with subtest("Check if pantheon session components actually start"): + machine.wait_until_succeeds("pgrep gala") + machine.wait_for_window("gala") + machine.wait_until_succeeds("pgrep wingpanel") + machine.wait_for_window("wingpanel") + machine.wait_until_succeeds("pgrep plank") + machine.wait_for_window("plank") + + with subtest("Open elementary terminal"): + machine.execute("su - ${user.name} -c 'DISPLAY=:0 io.elementary.terminal &'") + machine.wait_for_window("io.elementary.terminal") + machine.sleep(20) + machine.screenshot("screen") ''; }) |