test: fix test-fs-access.js
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>
parent
70d04e7f
Please register or sign in to comment