From: Robert Ancell Date: Wed, 14 Oct 2015 16:39:04 +0000 (+0100) Subject: Add a regression test for xserver-layout option. X-Git-Url: http://rtime.felk.cvut.cz/gitweb/sojka/lightdm.git/commitdiff_plain/f291986f90955117fe8ece1d51e8f15bb5ca4d4c 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. --- 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 [:] [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)