mirror of
https://github.com/nodejs/node.git
synced 2025-05-13 10:54:13 +00:00

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: https://github.com/nodejs/node/pull/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>
15 lines
370 B
JavaScript
15 lines
370 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const spawn = require('child_process').spawn;
|
|
|
|
const expectedError = common.isWindows ? /\bENOTSUP\b/ : /\bEPERM\b/;
|
|
|
|
assert.throws(() => {
|
|
spawn('echo', ['fhqwhgads'], {uid: 0});
|
|
}, expectedError);
|
|
|
|
assert.throws(() => {
|
|
spawn('echo', ['fhqwhgads'], {gid: 0});
|
|
}, expectedError);
|