benchmark: fix api restriction for the permission category

give appropriate permissions to the following scripts:

* permission-processhas-fs-read.js: 'ChildProcess' permission
* permission-startup.js: 'FileSystemRead' permission
  > Paths delimited by comma (,) are no longer allowed.

Refs: https://github.com/nodejs/node/blob/main/doc/api/cli.md#--allow-fs-read
Signed-off-by: Ryan Qian <i@bitbili.net>
PR-URL: https://github.com/nodejs/node/pull/51528
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This commit is contained in:
Ryan Tsien 2024-05-19 04:37:31 +08:00 committed by GitHub
parent 7380252ae5
commit 8216cc964e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -13,6 +13,7 @@ const options = {
flags: [
'--experimental-permission',
`--allow-fs-read=${rootPath}`,
'--allow-child-process',
],
};

View File

@ -47,10 +47,10 @@ function spawnProcess(script, bench, state) {
function main({ count, script, nFiles, prefixPath }) {
script = path.resolve(__dirname, '../../', `${script}.js`);
const files = mockFiles(nFiles, prefixPath).join(',');
const optionsWithScript = [
'--experimental-permission',
`--allow-fs-read=${files},${script}`,
`--allow-fs-read=${script}`,
...mockFiles(nFiles, prefixPath).map((file) => '--allow-fs-read=' + file),
script,
];
const warmup = 3;