From fcedadcacb73a4897fda600d517e6dbc44878416 Mon Sep 17 00:00:00 2001 From: Xu Meng Date: Fri, 15 May 2020 23:38:58 -0500 Subject: [PATCH] test: support common user profile on IBMi Previously libuv was tested under the user class QSECOFR on IBM i. But most IBM i users does not have that authority. Refine some assertions to support common user profiles on IBM i. Fixes: https://github.com/libuv/libuv/issues/2851 PR-URL: https://github.com/libuv/libuv/pull/2852 Reviewed-By: Richard Lau Reviewed-By: Colin Ihrig --- test/test-fs.c | 2 +- test/test-spawn.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/test-fs.c b/test/test-fs.c index 7edd6ee4..ae9923a9 100644 --- a/test/test-fs.c +++ b/test/test-fs.c @@ -315,7 +315,7 @@ static void chown_root_cb(uv_fs_t* req) { * User may grant qsecofr's privileges, including changing * the file's ownership to uid 0. */ - ASSERT(req->result == 0); + ASSERT(req->result == 0 || req->result == UV_EPERM); # else ASSERT(req->result == UV_EPERM); # endif diff --git a/test/test-spawn.c b/test/test-spawn.c index 314a3562..5e1c6d61 100644 --- a/test/test-spawn.c +++ b/test/test-spawn.c @@ -1452,7 +1452,7 @@ TEST_IMPL(spawn_setuid_fails) { options.flags |= UV_PROCESS_WINDOWS_VERBATIM_ARGUMENTS; r = uv_spawn(uv_default_loop(), &process, &options); -#if defined(__CYGWIN__) || defined(__PASE__) +#if defined(__CYGWIN__) ASSERT(r == UV_EINVAL); #else ASSERT(r == UV_EPERM); @@ -1497,7 +1497,7 @@ TEST_IMPL(spawn_setgid_fails) { #endif r = uv_spawn(uv_default_loop(), &process, &options); -#if defined(__CYGWIN__) || defined(__MVS__) || defined(__PASE__) +#if defined(__CYGWIN__) || defined(__MVS__) ASSERT(r == UV_EINVAL); #else ASSERT(r == UV_EPERM); @@ -1689,7 +1689,7 @@ TEST_IMPL(spawn_reads_child_path) { */ #if defined(__APPLE__) static const char dyld_path_var[] = "DYLD_LIBRARY_PATH"; -#elif defined __MVS__ +#elif defined(__MVS__) || defined(__PASE__) static const char dyld_path_var[] = "LIBPATH"; #else static const char dyld_path_var[] = "LD_LIBRARY_PATH";