From 41b7af0e1b93ae854f577317e6d418d63a2e255c Mon Sep 17 00:00:00 2001 From: Chengwei Yang Date: Sun, 3 Nov 2013 08:18:45 +0800 Subject: [PATCH] TEST: ignore in test environment There is a change which make that a non-empty is now necessary if is configured, this isn't a behaviour change but a fix giving that servicehelper need run activated service into the specific user privileges. However, the test config file and code isn't ready for that change, so this patch fix them. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66728 --- bus/bus.c | 9 +++++++++ .../debug-allow-all-fail.conf.in | 1 + .../debug-allow-all-pass.conf.in | 1 + 3 files changed, 11 insertions(+) diff --git a/bus/bus.c b/bus/bus.c index 307c158..7aeee12 100644 --- a/bus/bus.c +++ b/bus/bus.c @@ -836,8 +836,13 @@ bus_context_new (const DBusString *config_file, goto failed; } +#ifdef DBUS_ENABLE_EMBEDDED_TESTS + /* ignore user verify in test environment */ + if (context->user != NULL && _dbus_getenv ("DBUS_TEST_DAEMON") == NULL) +#else /* check user before we fork */ if (context->user != NULL) +#endif { if (!_dbus_verify_daemon_user (context->user)) { @@ -909,10 +914,14 @@ bus_context_new (const DBusString *config_file, parser = NULL; } +#ifdef DBUS_ENABLE_EMBEDDED_TESTS + if (context->user != NULL && _dbus_getenv ("DBUS_TEST_DAEMON") == NULL) +#else /* Here we change our credentials if required, * as soon as we've set up our sockets and pidfile */ if (context->user != NULL) +#endif { if (!_dbus_change_to_daemon_user (context->user, error)) { diff --git a/test/data/valid-config-files-system/debug-allow-all-fail.conf.in b/test/data/valid-config-files-system/debug-allow-all-fail.conf.in index bab178f..a98cf40 100644 --- a/test/data/valid-config-files-system/debug-allow-all-fail.conf.in +++ b/test/data/valid-config-files-system/debug-allow-all-fail.conf.in @@ -6,6 +6,7 @@ debug-pipe:name=test-server @TEST_LISTEN@ system + mybususer @TEST_LAUNCH_HELPER_BINARY@ @DBUS_TEST_DATA@/invalid-service-files-system diff --git a/test/data/valid-config-files-system/debug-allow-all-pass.conf.in b/test/data/valid-config-files-system/debug-allow-all-pass.conf.in index 3836673..ecacf82 100644 --- a/test/data/valid-config-files-system/debug-allow-all-pass.conf.in +++ b/test/data/valid-config-files-system/debug-allow-all-pass.conf.in @@ -6,6 +6,7 @@ debug-pipe:name=test-server @TEST_LISTEN@ system + mybususer @TEST_LAUNCH_HELPER_BINARY@ @DBUS_TEST_DATA@/valid-service-files-system -- 1.7.9.5