diff options
author | Robert Ancell <robert.ancell@canonical.com> | 2015-10-14 17:39:04 +0100 |
---|---|---|
committer | Robert Ancell <robert.ancell@canonical.com> | 2015-10-14 17:39:04 +0100 |
commit | 8acc8b95e192ce01b44c50a8e466300f261083da (patch) | |
tree | 718fc9ee6f537707a899639fffb187f20dde2d6b | |
parent | 2bd4dab1a29df610e4cd07c9d89cdc8d6cd43fc9 (diff) | |
download | lightdm-8acc8b95e192ce01b44c50a8e466300f261083da.tar.gz |
Add a regression test for xserver-layout option.
This is probably a bit useless now we have modern multi-seat support and you can set this in the xserver-command anyway.
-rw-r--r-- | tests/Makefile.am | 2 | ||||
-rw-r--r-- | tests/scripts/xserver-config-layout.conf | 31 | ||||
-rw-r--r-- | tests/src/X.c | 11 |
3 files changed, 44 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index 9c2241d0..56ac90e9 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -34,6 +34,7 @@ TESTS = \ test-autologin-new-authtok \ test-autologin-timeout-gobject \ test-autologin-guest-timeout-gobject \ + test-xserver-config-layout \ test-allow-tcp-xorg-1.16 \ test-allow-tcp-xorg-1.17 \ test-change-authentication \ @@ -590,6 +591,7 @@ EXTRA_DIST = \ scripts/xdmcp-server-guest.conf \ scripts/xdmcp-server-login.conf \ scripts/xdmcp-server-open-file-descriptors.conf \ + scripts/xserver-config-layout.conf \ scripts/xserver-fail-start.conf \ scripts/xserver-no-share.conf \ scripts/seatdefaults-still-supported.conf diff --git a/tests/scripts/xserver-config-layout.conf b/tests/scripts/xserver-config-layout.conf new file mode 100644 index 00000000..fb3b9ad2 --- /dev/null +++ b/tests/scripts/xserver-config-layout.conf @@ -0,0 +1,31 @@ +# +# Check xserver-layout option works +# + +[Seat:*] +autologin-user=have-password1 +user-session=default +xserver-layout=custom + +#?*START-DAEMON +#?RUNNER DAEMON-START + +# X server starts +#?XSERVER-0 START LAYOUT=custom VT=7 SEAT=seat0 + +# Daemon connects when X server is ready +#?*XSERVER-0 INDICATE-READY +#?XSERVER-0 INDICATE-READY +#?XSERVER-0 ACCEPT-CONNECT + +# Session starts +#?SESSION-X-0 START XDG_SEAT=seat0 XDG_VTNR=7 XDG_GREETER_DATA_DIR=.*/have-password1 XDG_SESSION_TYPE=x11 XDG_SESSION_DESKTOP=default USER=have-password1 +#?LOGIN1 ACTIVATE-SESSION SESSION=c0 +#?XSERVER-0 ACCEPT-CONNECT +#?SESSION-X-0 CONNECT-XSERVER + +# Cleanup +#?*STOP-DAEMON +#?SESSION-X-0 TERMINATE SIGNAL=15 +#?XSERVER-0 TERMINATE SIGNAL=15 +#?RUNNER DAEMON-EXIT STATUS=0 diff --git a/tests/src/X.c b/tests/src/X.c index 105fafb6..937d7979 100644 --- a/tests/src/X.c +++ b/tests/src/X.c @@ -31,6 +31,9 @@ static gboolean listen_tcp = TRUE; /* TRUE if we allow Unix connections */ static gboolean listen_unix = TRUE; +/* Configuration layout to use */ +static gchar *layout = NULL; + /* Path to authority database to use */ static gchar *auth_path = NULL; @@ -260,6 +263,11 @@ main (int argc, char **argv) { display_number = atoi (arg + 1); } + else if (strcmp (arg, "-layout") == 0) + { + layout = argv[i+1]; + i++; + } else if (strcmp (arg, "-auth") == 0) { auth_path = argv[i+1]; @@ -340,6 +348,7 @@ main (int argc, char **argv) { g_printerr ("Unrecognized option: %s\n" "Use: %s [:<display>] [option]\n" + "-layout name Specify the ServerLayout section name\n" "-auth file Select authorization file\n" "-nolisten protocol Don't listen on protocol\n" "-listen protocol Listen on protocol\n" @@ -368,6 +377,8 @@ main (int argc, char **argv) status_text = g_string_new (""); g_string_printf (status_text, "%s START", id); + if (layout) + g_string_append_printf (status_text, " LAYOUT=%s", layout); if (vt_number >= 0) g_string_append_printf (status_text, " VT=%d", vt_number); if (listen_tcp) |