mirror of
https://github.com/nodejs/node.git
synced 2025-05-18 22:53:45 +00:00

Enable linting for the test directory. A number of changes was made so all tests conform the current rules used by lib and src directories. The only exception for tests is that unreachable (dead) code is allowed. test-fs-non-number-arguments-throw had to be excluded from the changes because of a weird issue on Windows CI. PR-URL: https://github.com/nodejs/io.js/pull/1721 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
24 lines
592 B
JavaScript
24 lines
592 B
JavaScript
'use strict';
|
|
// Requires special privileges
|
|
var common = require('../common');
|
|
var assert = require('assert');
|
|
|
|
var oldgid = process.getgid();
|
|
process.setgid('nobody');
|
|
var newgid = process.getgid();
|
|
assert.notEqual(newgid, oldgid, 'gids expected to be different');
|
|
|
|
var olduid = process.getuid();
|
|
process.setuid('nobody');
|
|
var newuid = process.getuid();
|
|
assert.notEqual(newuid, olduid, 'uids expected to be different');
|
|
|
|
try {
|
|
process.setuid('nobody1234');
|
|
} catch (e) {
|
|
assert.equal(e.message,
|
|
'failed to resolve group',
|
|
'unexpected error message'
|
|
);
|
|
}
|