diff options
author | Robert Ancell <robert.ancell@canonical.com> | 2013-04-12 15:38:56 +1200 |
---|---|---|
committer | Robert Ancell <robert.ancell@canonical.com> | 2013-04-12 15:38:56 +1200 |
commit | 10a8215a921f677603a09a044c8705fda37172f9 (patch) | |
tree | 715b9e51e02edac79d40623e4de45bbbd4a76174 | |
parent | 8c860ce6f5d9d0f51c7ec5287701fec9d7985a7f (diff) | |
download | lightdm-git-10a8215a921f677603a09a044c8705fda37172f9.tar.gz |
Correctly read command from config and fix test case
-rw-r--r-- | src/seat-xvnc.c | 2 | ||||
-rw-r--r-- | tests/Makefile.am | 4 | ||||
-rw-r--r-- | tests/scripts/vnc-command.conf | 4 | ||||
-rw-r--r-- | tests/scripts/vnc-login.conf | 2 | ||||
-rw-r--r-- | tests/scripts/vnc-open-file-descriptors.conf | 2 | ||||
-rw-r--r-- | tests/src/Xvnc.c | 7 | ||||
-rw-r--r-- | tests/src/vnc-client.c | 2 | ||||
-rwxr-xr-x | tests/test-vnc-command | 2 |
8 files changed, 17 insertions, 8 deletions
diff --git a/src/seat-xvnc.c b/src/seat-xvnc.c index 8b936537..0053bb3f 100644 --- a/src/seat-xvnc.c +++ b/src/seat-xvnc.c @@ -41,7 +41,7 @@ seat_xvnc_create_display_server (Seat *seat) xserver = xserver_xvnc_new (); xserver_xvnc_set_socket (xserver, g_socket_get_fd (SEAT_XVNC (seat)->priv->connection)); - command = config_get_string (config_get_instance (), "VNCServer", "xserver-command"); + command = config_get_string (config_get_instance (), "VNCServer", "command"); if (command) xserver_xvnc_set_command (xserver, command); diff --git a/tests/Makefile.am b/tests/Makefile.am index 562e1115..fe9a246f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -128,6 +128,8 @@ TESTS = \ test-switch-to-user-no-password \ test-switch-to-user-logout \ test-vnc-login \ + test-vnc-command \ + test-vnc-open-file-descriptors \ test-xdmcp-login \ test-no-accounts-service \ test-console-kit \ @@ -313,7 +315,9 @@ EXTRA_DIST = \ scripts/util-path.conf \ scripts/user-renamed.conf \ scripts/user-renamed-invalid.conf \ + scripts/vnc-command.conf \ scripts/vnc-login.conf \ + scripts/vnc-open-file-descriptors.conf \ scripts/xauthority.conf \ scripts/xdmcp-login.conf \ scripts/xdmcp-open-file-descriptors.conf \ diff --git a/tests/scripts/vnc-command.conf b/tests/scripts/vnc-command.conf index 6d073606..68c1c6c0 100644 --- a/tests/scripts/vnc-command.conf +++ b/tests/scripts/vnc-command.conf @@ -9,7 +9,7 @@ start-default-seat=false [VNCServer] enabled=true port=9999 -command=Xvnc -depth 16 +command=Xvnc -option #?RUNNER DAEMON-START #?*WAIT 1 @@ -20,7 +20,7 @@ command=Xvnc -depth 16 #?VNC-CLIENT CONNECT SERVER=::9999 # Xvnc server starts -#?XSERVER :50 START GEOMETRY=1024x768 DEPTH=16 +#?XSERVER :50 START GEOMETRY=1024x768 DEPTH=8 OPTION=TRUE # Clean up #?*STOP-DAEMON diff --git a/tests/scripts/vnc-login.conf b/tests/scripts/vnc-login.conf index 0c6199e9..b22104c7 100644 --- a/tests/scripts/vnc-login.conf +++ b/tests/scripts/vnc-login.conf @@ -19,7 +19,7 @@ port=9999 #?VNC-CLIENT CONNECT SERVER=::9999 # Xvnc server starts -#?XSERVER :50 START GEOMETRY=1024x768 DEPTH=8 +#?XSERVER :50 START GEOMETRY=1024x768 DEPTH=8 OPTION=FALSE # Negotiate with Xvnc #?VNC-CLIENT CONNECTED VERSION="RFB 003.007" diff --git a/tests/scripts/vnc-open-file-descriptors.conf b/tests/scripts/vnc-open-file-descriptors.conf index d4daa689..a73f69e7 100644 --- a/tests/scripts/vnc-open-file-descriptors.conf +++ b/tests/scripts/vnc-open-file-descriptors.conf @@ -19,7 +19,7 @@ port=9999 #?VNC-CLIENT CONNECT SERVER=::9999 # Xvnc server starts -#?XSERVER :50 START GEOMETRY=1024x768 DEPTH=8 +#?XSERVER :50 START GEOMETRY=1024x768 DEPTH=8 OPTION=FALSE # Negotiate with Xvnc #?VNC-CLIENT CONNECTED VERSION="RFB 003.007" diff --git a/tests/src/Xvnc.c b/tests/src/Xvnc.c index e684951b..156e121f 100644 --- a/tests/src/Xvnc.c +++ b/tests/src/Xvnc.c @@ -174,6 +174,7 @@ main (int argc, char **argv) gboolean listen_tcp = TRUE; gboolean listen_unix = TRUE; gboolean use_inetd = FALSE; + gboolean has_option = FALSE; gchar *geometry = g_strdup ("640x480"); gint depth = 8; int lock_file; @@ -228,6 +229,10 @@ main (int argc, char **argv) { use_inetd = TRUE; } + else if (strcmp (arg, "-option") == 0) + { + has_option = TRUE; + } else { g_printerr ("Unrecognized option: %s\n" @@ -248,7 +253,7 @@ main (int argc, char **argv) x_server_set_listen_unix (xserver, listen_unix); x_server_set_listen_tcp (xserver, listen_tcp); - status_notify ("XSERVER :%d START GEOMETRY=%s DEPTH=%d", display_number, geometry, depth); + status_notify ("XSERVER :%d START GEOMETRY=%s DEPTH=%d OPTION=%s", display_number, geometry, depth, has_option ? "TRUE" : "FALSE"); config = g_key_file_new (); g_key_file_load_from_file (config, g_build_filename (g_getenv ("LIGHTDM_TEST_ROOT"), "script", NULL), G_KEY_FILE_NONE, NULL); diff --git a/tests/src/vnc-client.c b/tests/src/vnc-client.c index f4f10444..9d033ce1 100644 --- a/tests/src/vnc-client.c +++ b/tests/src/vnc-client.c @@ -81,7 +81,7 @@ main (int argc, char **argv) if (error) g_warning ("Unable to receive on VNC socket: %s", error->message); g_clear_error (&error); - if (n_read < 0) + if (n_read <= 0) return EXIT_FAILURE; buffer[n_read] = '\0'; diff --git a/tests/test-vnc-command b/tests/test-vnc-command index bcdc9815..583469ca 100755 --- a/tests/test-vnc-command +++ b/tests/test-vnc-command @@ -1,2 +1,2 @@ #!/bin/sh -./src/dbus-env ./src/test-runner vnc-login test-gobject-greeter +./src/dbus-env ./src/test-runner vnc-command test-gobject-greeter |