···
1
-
import ./make-test-python.nix (
5
-
meta.maintainers = lib.teams.gnome.members;
4
+
meta.maintainers = lib.teams.gnome.members;
11
-
imports = [ ./common/user-account.nix ];
10
+
imports = [ ./common/user-account.nix ];
13
-
services.xserver.enable = true;
12
+
services.xserver.enable = true;
15
-
services.xserver.displayManager = {
14
+
services.xserver.displayManager = {
20
-
services.displayManager.autoLogin = {
19
+
services.displayManager.autoLogin = {
25
-
services.xserver.desktopManager.gnome.enable = true;
26
-
services.xserver.desktopManager.gnome.debug = true;
24
+
services.xserver.desktopManager.gnome.enable = true;
25
+
services.xserver.desktopManager.gnome.debug = true;
28
-
systemd.user.services = {
29
-
"org.gnome.Shell@wayland" = {
32
-
# Clear the list before overriding it.
34
-
# Eval API is now internal so Shell needs to run in unsafe mode.
35
-
# TODO: improve test driver so that it supports openqa-like manipulation
36
-
# that would allow us to drop this mess.
37
-
"${pkgs.gnome-shell}/bin/gnome-shell --unsafe-mode"
27
+
systemd.user.services = {
28
+
"org.gnome.Shell@wayland" = {
31
+
# Clear the list before overriding it.
33
+
# Eval API is now internal so Shell needs to run in unsafe mode.
34
+
# TODO: improve test driver so that it supports openqa-like manipulation
35
+
# that would allow us to drop this mess.
36
+
"${pkgs.gnome-shell}/bin/gnome-shell --unsafe-mode"
48
-
# Keep line widths somewhat manageable
49
-
user = nodes.machine.users.users.alice;
50
-
uid = toString user.uid;
51
-
bus = "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/${uid}/bus";
52
-
# Run a command in the appropriate user environment
53
-
run = command: "su - ${user.name} -c '${bus} ${command}'";
55
-
# Call javascript in gnome shell, returns a tuple (success, output), where
56
-
# `success` is true if the dbus call was successful and output is what the
57
-
# javascript evaluates to.
60
-
run "gdbus call --session -d org.gnome.Shell -o /org/gnome/Shell -m org.gnome.Shell.Eval ${command}";
47
+
# Keep line widths somewhat manageable
48
+
user = nodes.machine.users.users.alice;
49
+
uid = toString user.uid;
50
+
bus = "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/${uid}/bus";
51
+
# Run a command in the appropriate user environment
52
+
run = command: "su - ${user.name} -c '${bus} ${command}'";
62
-
# False when startup is done
63
-
startingUp = eval "Main.layoutManager._startingUp";
54
+
# Call javascript in gnome shell, returns a tuple (success, output), where
55
+
# `success` is true if the dbus call was successful and output is what the
56
+
# javascript evaluates to.
59
+
run "gdbus call --session -d org.gnome.Shell -o /org/gnome/Shell -m org.gnome.Shell.Eval ${command}";
66
-
launchConsole = run "gapplication launch org.gnome.Console";
61
+
# False when startup is done
62
+
startingUp = eval "Main.layoutManager._startingUp";
68
-
# Hopefully Console's wm class
69
-
wmClass = eval "global.display.focus_window.wm_class";
72
-
with subtest("Login to GNOME with GDM"):
73
-
# wait for gdm to start
74
-
machine.wait_for_unit("display-manager.service")
75
-
# wait for the wayland server
76
-
machine.wait_for_file("/run/user/${uid}/wayland-0")
77
-
# wait for alice to be logged in
78
-
machine.wait_for_unit("default.target", "${user.name}")
79
-
# check that logging in has given the user ownership of devices
80
-
assert "alice" in machine.succeed("getfacl -p /dev/snd/timer")
65
+
launchConsole = run "gapplication launch org.gnome.Console";
82
-
with subtest("Wait for GNOME Shell"):
83
-
# correct output should be (true, 'false')
84
-
machine.wait_until_succeeds(
85
-
"${startingUp} | grep -q 'true,..false'"
67
+
# Hopefully Console's wm class
68
+
wmClass = eval "global.display.focus_window.wm_class";
71
+
with subtest("Login to GNOME with GDM"):
72
+
# wait for gdm to start
73
+
machine.wait_for_unit("display-manager.service")
74
+
# wait for the wayland server
75
+
machine.wait_for_file("/run/user/${uid}/wayland-0")
76
+
# wait for alice to be logged in
77
+
machine.wait_for_unit("default.target", "${user.name}")
78
+
# check that logging in has given the user ownership of devices
79
+
assert "alice" in machine.succeed("getfacl -p /dev/snd/timer")
88
-
with subtest("Open Console"):
89
-
# Close the Activities view so that Shell can correctly track the focused window.
90
-
machine.send_key("esc")
81
+
with subtest("Wait for GNOME Shell"):
82
+
# correct output should be (true, 'false')
83
+
machine.wait_until_succeeds(
84
+
"${startingUp} | grep -q 'true,..false'"
95
-
# correct output should be (true, '"org.gnome.Console"')
96
-
machine.wait_until_succeeds(
97
-
"${wmClass} | grep -q 'true,...org.gnome.Console'"
100
-
machine.screenshot("screen")
87
+
with subtest("Open Console"):
88
+
# Close the Activities view so that Shell can correctly track the focused window.
89
+
machine.send_key("esc")
94
+
# correct output should be (true, '"org.gnome.Console"')
95
+
machine.wait_until_succeeds(
96
+
"${wmClass} | grep -q 'true,...org.gnome.Console'"
99
+
machine.screenshot("screen")