summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2015-10-14 17:47:21 +0100
committerRobert Ancell <robert.ancell@canonical.com>2015-10-14 17:47:21 +0100
commitc844a41196aa51b098426d102c5c63313e8c638c (patch)
tree165c5ba9c26cd1b8ab2b96562b89d9d86708acc8
parent8acc8b95e192ce01b44c50a8e466300f261083da (diff)
downloadlightdm-c844a41196aa51b098426d102c5c63313e8c638c.tar.gz
Also test xserver-config option
-rw-r--r--data/lightdm.conf4
-rw-r--r--tests/Makefile.am4
-rw-r--r--tests/scripts/xserver-config.conf (renamed from tests/scripts/xserver-config-layout.conf)5
-rw-r--r--tests/src/X.c11
-rwxr-xr-xtests/test-xserver-config2
5 files changed, 20 insertions, 6 deletions
diff --git a/data/lightdm.conf b/data/lightdm.conf
index 735e108a..ef6ba9ee 100644
--- a/data/lightdm.conf
+++ b/data/lightdm.conf
@@ -46,8 +46,8 @@
# pam-greeter-service = PAM service to use for greeters
# xserver-command = X server command to run (can also contain arguments e.g. X -special-option)
# xmir-command = Xmir server command to run (can also contain arguments e.g. Xmir -special-option)
-# xserver-layout = Layout to pass to X server
# xserver-config = Config file to pass to X server
+# xserver-layout = Layout to pass to X server
# xserver-allow-tcp = True if TCP/IP connections are allowed to this X server
# xserver-share = True if the X server is shared for both greeter and session
# xserver-hostname = Hostname of X server (only for type=xremote)
@@ -88,8 +88,8 @@
#pam-greeter-service=lightdm-greeter
#xserver-command=X
#xmir-command=Xmir
-#xserver-layout=
#xserver-config=
+#xserver-layout=
#xserver-allow-tcp=false
#xserver-share=true
#xserver-hostname=
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 56ac90e9..08a15aa2 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -34,7 +34,7 @@ TESTS = \
test-autologin-new-authtok \
test-autologin-timeout-gobject \
test-autologin-guest-timeout-gobject \
- test-xserver-config-layout \
+ test-xserver-config \
test-allow-tcp-xorg-1.16 \
test-allow-tcp-xorg-1.17 \
test-change-authentication \
@@ -591,7 +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-config.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.conf
index fb3b9ad2..673a011f 100644
--- a/tests/scripts/xserver-config-layout.conf
+++ b/tests/scripts/xserver-config.conf
@@ -1,17 +1,18 @@
#
-# Check xserver-layout option works
+# Check can set X server configuration
#
[Seat:*]
autologin-user=have-password1
user-session=default
+xserver-config=custom.conf
xserver-layout=custom
#?*START-DAEMON
#?RUNNER DAEMON-START
# X server starts
-#?XSERVER-0 START LAYOUT=custom VT=7 SEAT=seat0
+#?XSERVER-0 START CONFIG=custom.conf LAYOUT=custom VT=7 SEAT=seat0
# Daemon connects when X server is ready
#?*XSERVER-0 INDICATE-READY
diff --git a/tests/src/X.c b/tests/src/X.c
index 937d7979..cd4511b8 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 to use */
+static gchar *config_file = NULL;
+
/* Configuration layout to use */
static gchar *layout = NULL;
@@ -263,6 +266,11 @@ main (int argc, char **argv)
{
display_number = atoi (arg + 1);
}
+ else if (strcmp (arg, "-config") == 0)
+ {
+ config_file = argv[i+1];
+ i++;
+ }
else if (strcmp (arg, "-layout") == 0)
{
layout = argv[i+1];
@@ -348,6 +356,7 @@ main (int argc, char **argv)
{
g_printerr ("Unrecognized option: %s\n"
"Use: %s [:<display>] [option]\n"
+ "-config file Specify a configuration file\n"
"-layout name Specify the ServerLayout section name\n"
"-auth file Select authorization file\n"
"-nolisten protocol Don't listen on protocol\n"
@@ -377,6 +386,8 @@ main (int argc, char **argv)
status_text = g_string_new ("");
g_string_printf (status_text, "%s START", id);
+ if (config_file)
+ g_string_append_printf (status_text, " CONFIG=%s", config_file);
if (layout)
g_string_append_printf (status_text, " LAYOUT=%s", layout);
if (vt_number >= 0)
diff --git a/tests/test-xserver-config b/tests/test-xserver-config
new file mode 100755
index 00000000..9b531dd2
--- /dev/null
+++ b/tests/test-xserver-config
@@ -0,0 +1,2 @@
+#!/bin/sh
+./src/dbus-env ./src/test-runner xserver-config test-gobject-greeter