mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
On non-windows supported platforms, fs.access(readOnlyFile, W_OK, ...) is expected to fail, but always succeeds if node runs as the super user, which is often the case for tests running on our continuous integration platform. This change makes the test try to change its process user id to nobody on non-windows platforms so that the above mentioned test can pass and still perform the actual desired test. If changing the process user id to a nobody is not possible, then the test checks that fs.access(readOnlyFile, W_OK, ...) actually succeeds. Fixes #9033. Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>