summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2012-01-17 15:19:57 +1100
committerRobert Ancell <robert.ancell@canonical.com>2012-01-17 15:19:57 +1100
commitfdd56905837913ab6467605ffa5042249da69da3 (patch)
tree82f27c1679ead59f00a8ea1868f5def982e9f800 /tests
parentfd924963d0e527bce02147f8ff5ac43a98df422b (diff)
downloadlightdm-fdd56905837913ab6467605ffa5042249da69da3.tar.gz
Add regression test that checks it works when console kit is not avaiable
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am4
-rw-r--r--tests/scripts/no-console-kit.conf33
-rw-r--r--tests/src/test-runner.c11
-rwxr-xr-xtests/test-no-console-kit2
4 files changed, 45 insertions, 5 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 89f3df6d..ffb925ed 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -47,7 +47,8 @@ TESTS = \
test-switch-to-user-existing-session \
test-switch-to-user-no-password \
test-vnc-login \
- test-xdmcp-login
+ test-xdmcp-login \
+ test-no-console-kit
# test-session-exit-error
# test-greeter-no-exit
@@ -112,6 +113,7 @@ EXTRA_DIST = \
scripts/login-wrong-password.conf \
scripts/login-xserver-crash.conf \
scripts/no-config.conf \
+ scripts/no-console-kit.conf \
scripts/plymouth-active-vt.conf \
scripts/plymouth-inactive-vt.conf \
scripts/plymouth-no-seat.conf \
diff --git a/tests/scripts/no-console-kit.conf b/tests/scripts/no-console-kit.conf
new file mode 100644
index 00000000..0b18cfb9
--- /dev/null
+++ b/tests/scripts/no-console-kit.conf
@@ -0,0 +1,33 @@
+#
+# Check still works when ConsoleKit is not available
+#
+
+[test-runner-config]
+disable-console-kit=true
+
+[LightDM]
+minimum-display-number=50
+
+[SeatDefaults]
+autologin-user=alice
+
+#?RUNNER DAEMON-START
+
+# X server starts
+#?XSERVER :50 START
+#?XSERVER :50 INDICATE-READY
+
+# LightDM connects to X server
+#?XSERVER :50 ACCEPT-CONNECT
+
+# Session starts
+#?SESSION START USER=alice
+#?XSERVER :50 ACCEPT-CONNECT
+#?SESSION CONNECT-XSERVER
+
+# Cleanup
+#?*STOP-DAEMON
+# Don't know what order they will terminate
+#?(SESSION TERMINATE SIGNAL=15|XSERVER :50 TERMINATE SIGNAL=15)
+#?(SESSION TERMINATE SIGNAL=15|XSERVER :50 TERMINATE SIGNAL=15)
+#?RUNNER DAEMON-EXIT STATUS=0
diff --git a/tests/src/test-runner.c b/tests/src/test-runner.c
index 39fcf256..b0b055dc 100644
--- a/tests/src/test-runner.c
+++ b/tests/src/test-runner.c
@@ -651,7 +651,8 @@ ck_name_acquired_cb (GDBusConnection *connection,
static void
start_console_kit_daemon ()
-{
+{
+ service_count++;
g_bus_own_name (G_BUS_TYPE_SYSTEM,
"org.freedesktop.ConsoleKit",
G_BUS_NAME_OWNER_FLAGS_NONE,
@@ -861,6 +862,7 @@ accounts_name_acquired_cb (GDBusConnection *connection,
static void
start_accounts_service_daemon ()
{
+ service_count++;
g_bus_own_name (G_BUS_TYPE_SYSTEM,
"org.freedesktop.Accounts",
G_BUS_NAME_OWNER_FLAGS_NONE,
@@ -1064,9 +1066,10 @@ main (int argc, char **argv)
g_string_free (passwd_data, TRUE);
/* Start D-Bus services */
- service_count = 2;
- start_console_kit_daemon ();
- start_accounts_service_daemon ();
+ if (!g_key_file_get_boolean (config, "test-runner-config", "disable-console-kit", NULL))
+ start_console_kit_daemon ();
+ if (!g_key_file_get_boolean (config, "test-runner-config", "disable-accounts-service", NULL))
+ start_accounts_service_daemon ();
g_main_loop_run (loop);
diff --git a/tests/test-no-console-kit b/tests/test-no-console-kit
new file mode 100755
index 00000000..6d1fd506
--- /dev/null
+++ b/tests/test-no-console-kit
@@ -0,0 +1,2 @@
+#!/bin/sh
+./src/dbus-env ./src/test-runner no-console-kit test-gobject-greeter