diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2015-02-03 19:35:39 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2015-02-03 19:35:39 +0000 |
commit | 3cf71c2707f861c929054e31ec83fab6021109dc (patch) | |
tree | 563323f272d54b397a103beb8559bdc6e1ebfc2a /test | |
parent | b1c54b5a75824e765ecc27b5820c8e9fa0cbaaed (diff) | |
download | dbus-3cf71c2707f861c929054e31ec83fab6021109dc.tar.gz |
Treat root as a valid candidate for TEST_USER_ME
If spawn_dbus_daemon() can fail for TEST_USER_ME, then we'd have to
go through all the tests adding the ability to skip tests after
it fails, which is a fairly extensive change.
The tests have historically all run as whatever uid is supplied, and
if the tests are being run as root for some reason - perhaps in a CI
framework for an embedded platform that doesn't have non-root users,
or in an environment where you can be root or non-root but not both -
there is no particular reason to skip them.
Diffstat (limited to 'test')
-rw-r--r-- | test/test-utils-glib.c | 12 | ||||
-rw-r--r-- | test/test-utils-glib.h | 7 |
2 files changed, 4 insertions, 15 deletions
diff --git a/test/test-utils-glib.c b/test/test-utils-glib.c index c9fb5c8a..286e7a54 100644 --- a/test/test-utils-glib.c +++ b/test/test-utils-glib.c @@ -109,17 +109,7 @@ spawn_dbus_daemon (const gchar *binary, const struct passwd *pwd = NULL; #endif - if (user == TEST_USER_ME) - { -#ifdef DBUS_UNIX - if (getuid () == 0) - { - g_message ("SKIP: this test is not designed to run as root"); - return NULL; - } -#endif - } - else + if (user != TEST_USER_ME) { #ifdef DBUS_UNIX if (getuid () != 0) diff --git a/test/test-utils-glib.h b/test/test-utils-glib.h index 7b6eb743..80a7c8d4 100644 --- a/test/test-utils-glib.h +++ b/test/test-utils-glib.h @@ -44,12 +44,11 @@ * be run as an arbitrary non-root user, as above. * * Certain tests can usefully be run again, as root. When this is done, - * tests using TEST_USER_ME will be skipped, and tests using TEST_USER_ROOT, - * TEST_USER_MESSAGEBUS and/or TEST_USER_OTHER can exercise situations - * that only arise when there's more than one uid. + * tests using TEST_USER_ROOT, TEST_USER_MESSAGEBUS and/or TEST_USER_OTHER + * can exercise situations that only arise when there's more than one uid. */ typedef enum { - /* Whatever non-root user happens to be running the regression test; + /* Whatever user happens to be running the regression test; * such tests also work on Windows */ TEST_USER_ME, /* Must be uid 0 on Unix; the test is skipped on Windows */ |