diff --git a/test/wasi/test-wasi-symlinks.js b/test/wasi/test-wasi-symlinks.js index 8949ad21cd5c42..16acca16f38564 100644 --- a/test/wasi/test-wasi-symlinks.js +++ b/test/wasi/test-wasi-symlinks.js @@ -14,7 +14,8 @@ if (process.argv[2] === 'wasi-child') { args: [], env: process.env, preopens: { - '/sandbox': process.argv[4] + '/sandbox': process.argv[4], + '/tmp': process.argv[5] } }); const importObject = { wasi_snapshot_preview1: wasi.wasiImport }; @@ -45,9 +46,11 @@ if (process.argv[2] === 'wasi-child') { const escapingSymlink = path.join(sandboxedDir, 'outside.txt'); const loopSymlink1 = path.join(sandboxedDir, 'loop1'); const loopSymlink2 = path.join(sandboxedDir, 'loop2'); + const sandboxedTmp = path.join(tmpdir.path, 'tmp'); fs.mkdirSync(sandbox); fs.mkdirSync(sandboxedDir); + fs.mkdirSync(sandboxedTmp); fs.writeFileSync(sandboxedFile, 'hello from input.txt', 'utf8'); fs.writeFileSync(externalFile, 'this should be inaccessible', 'utf8'); fs.symlinkSync(path.join('.', 'input.txt'), sandboxedSymlink, 'file'); @@ -67,6 +70,7 @@ if (process.argv[2] === 'wasi-child') { 'wasi-child', options.test, sandbox, + sandboxedTmp, ], opts); console.log(child.stderr.toString()); assert.strictEqual(child.status, 0); @@ -76,6 +80,7 @@ if (process.argv[2] === 'wasi-child') { runWASI({ test: 'create_symlink', stdout: 'hello from input.txt' }); runWASI({ test: 'follow_symlink', stdout: 'hello from input.txt' }); + runWASI({ test: 'link' }); runWASI({ test: 'symlink_escape' }); runWASI({ test: 'symlink_loop' }); } diff --git a/test/wasi/test-wasi.js b/test/wasi/test-wasi.js index 84603e134a58b8..bb89c51441a851 100644 --- a/test/wasi/test-wasi.js +++ b/test/wasi/test-wasi.js @@ -79,7 +79,6 @@ if (process.argv[2] === 'wasi-child') { runWASI({ test: 'getrusage' }); } runWASI({ test: 'gettimeofday' }); - runWASI({ test: 'link' }); runWASI({ test: 'main_args' }); runWASI({ test: 'notdir' }); runWASI({ test: 'poll' });