diff --git a/test/parallel/test-cli-permission-deny-fs.js b/test/parallel/test-cli-permission-deny-fs.js index 964a0ad0a0e0c2..d38c4a61adbcfc 100644 --- a/test/parallel/test-cli-permission-deny-fs.js +++ b/test/parallel/test-cli-permission-deny-fs.js @@ -27,7 +27,7 @@ const path = require('path'); } { - const tmpPath = path.resolve('/tmp/'); + const tmpPath = path.resolve('./tmp/'); const { status, stdout } = spawnSync( process.execPath, [ @@ -36,7 +36,7 @@ const path = require('path'); `console.log(process.permission.has("fs")); console.log(process.permission.has("fs.read")); console.log(process.permission.has("fs.write")); - console.log(process.permission.has("fs.write", "/tmp/"));`, + console.log(process.permission.has("fs.write", "./tmp/"));`, ] ); const [fs, fsIn, fsOut, fsOutAllowed] = stdout.toString().split('\n'); @@ -138,6 +138,9 @@ const path = require('path'); if (firstPath.startsWith('/etc')) { common.skip('/etc as firstPath'); } + if (firstPath.startsWith('/tmp')) { + common.skip('/tmp as firstPath'); + } const file = fixtures.path('permission', 'loader', 'index.js'); const { status, stderr } = spawnSync( process.execPath, diff --git a/test/parallel/test-cli-permission-multiple-allow.js b/test/parallel/test-cli-permission-multiple-allow.js index 68e9029b1ddb45..57ce15535300d5 100644 --- a/test/parallel/test-cli-permission-multiple-allow.js +++ b/test/parallel/test-cli-permission-multiple-allow.js @@ -7,8 +7,8 @@ const assert = require('assert'); const path = require('path'); { - const tmpPath = path.resolve('/tmp/'); - const otherPath = path.resolve('/other-path/'); + const tmpPath = path.resolve('./tmp/'); + const otherPath = path.resolve('./other-path/'); const { status, stdout } = spawnSync( process.execPath, [ @@ -17,8 +17,8 @@ const path = require('path'); `console.log(process.permission.has("fs")); console.log(process.permission.has("fs.read")); console.log(process.permission.has("fs.write")); - console.log(process.permission.has("fs.write", "/tmp/")); - console.log(process.permission.has("fs.write", "/other-path/"));`, + console.log(process.permission.has("fs.write", "./tmp/")); + console.log(process.permission.has("fs.write", "./other-path/"));`, ] ); const [fs, fsIn, fsOut, fsOutAllowed1, fsOutAllowed2] = stdout.toString().split('\n'); @@ -31,8 +31,8 @@ const path = require('path'); } { - const tmpPath = path.resolve('/tmp/'); - const pathWithComma = path.resolve('/other,path/'); + const tmpPath = path.resolve('./tmp/'); + const pathWithComma = path.resolve('./other,path/'); const { status, stdout } = spawnSync( process.execPath, [ @@ -45,8 +45,8 @@ const path = require('path'); `console.log(process.permission.has("fs")); console.log(process.permission.has("fs.read")); console.log(process.permission.has("fs.write")); - console.log(process.permission.has("fs.write", "/tmp/")); - console.log(process.permission.has("fs.write", "/other,path/"));`, + console.log(process.permission.has("fs.write", "./tmp/")); + console.log(process.permission.has("fs.write", "./other,path/"));`, ] ); const [fs, fsIn, fsOut, fsOutAllowed1, fsOutAllowed2] = stdout.toString().split('\n'); @@ -59,7 +59,7 @@ const path = require('path'); } { - const filePath = path.resolve('/tmp/file,with,comma.txt'); + const filePath = path.resolve('./tmp/file,with,comma.txt'); const { status, stdout, stderr } = spawnSync( process.execPath, [ @@ -70,7 +70,7 @@ const path = require('path'); `console.log(process.permission.has("fs")); console.log(process.permission.has("fs.read")); console.log(process.permission.has("fs.write")); - console.log(process.permission.has("fs.write", "/tmp/file,with,comma.txt"));`, + console.log(process.permission.has("fs.write", "./tmp/file,with,comma.txt"));`, ] ); const [fs, fsIn, fsOut, fsOutAllowed] = stdout.toString().split('\n');