Skip to content

Commit

Permalink
test: added Ubuntu error code support to test-process-uid-gid.js
Browse files Browse the repository at this point in the history
This change adds coverage for the error code received when
process.setgid('nobody') is called on Ubuntu, where the standard
'nobody' group from UNIX systems is named 'nogroup'.

Refs: nodejs#19594
  • Loading branch information
= committed Jun 14, 2019
1 parent b614840 commit 2e2e93c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/parallel/test-process-uid-gid.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,12 @@ const oldgid = process.getgid();
try {
process.setgid('nobody');
} catch (err) {
if (err.message !== 'setgid group id does not exist') {
<<<<<<< HEAD
if (err.message !== 'setgid group id does not exist' && err.code !== 'ERR_UNKNOWN_CREDENTIAL') {
=======
if (err.message !== 'setgid group id does not exist' &&
err.message !== 'Group identifier does not exist') {
>>>>>>> 0442e60902... Changed error detection from checking code to checking message
throw err;
}
process.setgid('nogroup');
Expand Down

0 comments on commit 2e2e93c

Please sign in to comment.