Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6ce26c8

Browse filesBrowse files
Trottevanlucas
authored andcommitted
test: add test for uid/gid setting in spawn
Remove a disabled test in favor of one that expects an error. This validates (somewhat) that the underlying code is calling the correct system call for setting UID and GID. Unlike the formerly disabled test, it does not try to validate that the system UID/GID setting works. PR-URL: #7084 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 40604b5 commit 6ce26c8
Copy full SHA for 6ce26c8

File tree

Expand file treeCollapse file tree

2 files changed

+14
-60
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+14
-60
lines changed
Open diff view settings
Collapse file

‎test/disabled/test-child-process-uid-gid.js‎

Copy file name to clipboardExpand all lines: test/disabled/test-child-process-uid-gid.js
-60Lines changed: 0 additions & 60 deletions
This file was deleted.
Collapse file
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
'use strict';
2+
const common = require('../common');
3+
const assert = require('assert');
4+
const spawn = require('child_process').spawn;
5+
6+
const expectedError = common.isWindows ? /\bENOTSUP\b/ : /\bEPERM\b/;
7+
8+
assert.throws(() => {
9+
spawn('echo', ['fhqwhgads'], {uid: 0});
10+
}, expectedError);
11+
12+
assert.throws(() => {
13+
spawn('echo', ['fhqwhgads'], {gid: 0});
14+
}, expectedError);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.