From f9823e5c12945fbff0c678d9517c403a23478bd9 Mon Sep 17 00:00:00 2001 From: John Barboza Date: Wed, 2 Aug 2017 22:58:45 -0400 Subject: [PATCH] test,zos: use gid=-1 to test spawn_setgid_fails This is because on some platforms like z/OS, setgid(0) is allowed for non-superusers. So instead, use setgid(-1) to get UV_EINVAL to test that spawn failure returns the right return code. PR-URL: https://github.com/libuv/libuv/pull/1456 Reviewed-By: Ben Noordhuis Reviewed-By: Colin Ihrig --- test/test-spawn.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/test-spawn.c b/test/test-spawn.c index d714e045b..91d831e19 100644 --- a/test/test-spawn.c +++ b/test/test-spawn.c @@ -1351,10 +1351,14 @@ TEST_IMPL(spawn_setgid_fails) { init_process_options("spawn_helper1", fail_cb); options.flags |= UV_PROCESS_SETGID; +#if defined(__MVS__) + options.gid = -1; +#else options.gid = 0; +#endif r = uv_spawn(uv_default_loop(), &process, &options); -#if defined(__CYGWIN__) +#if defined(__CYGWIN__) || defined(__MVS__) ASSERT(r == UV_EINVAL); #else ASSERT(r == UV_EPERM);