[PATCH] test: use relative paths in test-cli-permission tests
authorsendoru <sendol39@gmail.com>
Wed, 14 Aug 2024 03:49:39 +0000 (12:49 +0900)
committerJérémy Lal <kapouer@melix.org>
Thu, 29 Aug 2024 08:25:23 +0000 (10:25 +0200)
commit6f8b377ad4895ea7e26f9d9e1602f1e02b05a34b
treee4bbaaaa43ff2b37aa717adb740e190184319b9b
parentf6697e4becda0aec2240f54ca2d4e30b37fe7a40
[PATCH] test: use relative paths in test-cli-permission tests

`process.permission.has("fs")` checks if the process has permission
for all files under `cwd`. Granting permission for `/tmp` and running
tests with `cwd` containing `/tmp` will make the funtion return
`true`, differing from expected results. Using relative paths ensures
test paths are not `cwd` itself.

Fixes: https://github.com/nodejs/node/issues/54021
PR-URL: https://github.com/nodejs/node/pull/54188
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Gbp-Pq: Topic build
Gbp-Pq: Name fix_permission_test_env.patch
test/parallel/test-cli-permission-deny-fs.js
test/parallel/test-cli-permission-multiple-allow.js