about summary refs log tree commit diff
path: root/nixos/tests/pantheon.nix
diff options
context:
space:
mode:
authorworldofpeace <worldofpeace@protonmail.ch>2019-11-25 12:03:51 -0500
committerworldofpeace <worldofpeace@protonmail.ch>2019-11-25 12:03:51 -0500
commitc16df6bbac6a36a029a622fc45f93f736ec9b340 (patch)
tree775af8fd11c2439505133c94b8fd54c61fabb080 /nixos/tests/pantheon.nix
parenta60daae73309a8b57df68b272a285643debd711a (diff)
nixosTests.pantheon: use subtest
Diffstat (limited to 'nixos/tests/pantheon.nix')
-rw-r--r--nixos/tests/pantheon.nix57
1 files changed, 28 insertions, 29 deletions
diff --git a/nixos/tests/pantheon.nix b/nixos/tests/pantheon.nix
index ee57200e8a8e5..6ff19be1bb95a 100644
--- a/nixos/tests/pantheon.nix
+++ b/nixos/tests/pantheon.nix
@@ -24,36 +24,35 @@ import ./make-test-python.nix ({ pkgs, ...} :
     user = nodes.machine.config.users.users.alice;
     bob = nodes.machine.config.users.users.bob;
   in ''
-    # Wait for display manager to start
     machine.wait_for_unit("display-manager.service")
 
-    # 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")
-
-    # Log in 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")
-
-    # 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?
-    # Check if pantheon-shell 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")
-
-    # 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")
+    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")
   '';
 })