test: skip spawn_setuid_setgid if we get EACCES

More often than not, users run the test suite from /root, which means
the 'nobody' user won't be able to access the test runner and the test
will fail because we drop privileges to that user. Just skip it then.

PR-URL: https://github.com/libuv/libuv/pull/66
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
Saúl Ibarra Corretgé 2014-12-12 13:44:01 +01:00
parent 460907279e
commit 86fcc20f96

View File

@ -1051,6 +1051,9 @@ TEST_IMPL(spawn_setuid_setgid) {
options.flags = UV_PROCESS_SETUID | UV_PROCESS_SETGID;
r = uv_spawn(uv_default_loop(), &process, &options);
if (r == UV_EACCES)
RETURN_SKIP("user 'nobody' cannot access the test runner");
ASSERT(r == 0);
r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);