-
Notifications
You must be signed in to change notification settings - Fork 29.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: Errors when running tests as root sudo make test
#19594
Comments
@gireeshpunathil I have resolved errors 3 and 4 both relating to I was thinking to open another issue for Error 2 Or should I submit a single PR for all three? |
I suggest one PR per test file, for the benefit of isolation between changes. |
I ran However, if I run If I run only Should I submit the PR as long as that error is resolved in |
as long as |
Got your point on how to test this PR, thanks :) @gireeshpunathil Need some more help here, I think I messed up my build. After I ran
Is there a way to start clean, but without having to refork and rebuild? I'd prefer not to refork and rebuild as there is another pull request active currently from the forked repo. |
|
I tried |
When the tests are run as root in Ubuntu, process.setegid is called with 'nobody' as an argument. This throws an error in Ubuntu. This is because in Ubuntu the equivalent of 'nobody' group is named as 'nogroup'. This commit sets egid to 'nobody' first and if it throws a `group id does not exist` error, it attempts to set egid to 'nogroup'. If it still causes an error, the error is thrown. Refs: nodejs#19594
When the tests are run as root in Ubuntu, process.setegid is called with 'nobody' as an argument. This throws an error in Ubuntu. This is because in Ubuntu the equivalent of 'nobody' group is named as 'nogroup'. This commit sets egid to 'nobody' first and if it throws a `group id does not exist` error, it attempts to set egid to 'nogroup'. If it still causes an error, the error is thrown. PR-URL: #19757 Refs: #19594 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
When the tests are run as root in Ubuntu, process.setegid is called with 'nobody' as an argument. This throws an error in Ubuntu. This is because in Ubuntu the equivalent of 'nobody' group is named as 'nogroup'. This commit sets egid to 'nobody' first and if it throws a `group id does not exist` error, it attempts to set egid to 'nogroup'. If it still causes an error, the error is thrown. PR-URL: #19757 Refs: #19594 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
When the tests are run as root in Ubuntu, process.setgid is called with 'nobody' as an argument. This throws an error in Ubuntu. This is because in Ubuntu the equivalent of 'nobody' group is named as 'nogroup' This commit sets gid to 'nobody' first and if it throws a `group id does not exist` error, it attempts to set gid to 'nogroup'. If it still causes an error, the error is thrown. Refs: nodejs#19594
Else block removed as the `throw` in the preceding block makes it redundant Refs: nodejs#19594
When the tests are run as root in Ubuntu, process.setegid is called with 'nobody' as an argument. This throws an error in Ubuntu. This is because in Ubuntu the equivalent of 'nobody' group is named as 'nogroup'. This commit sets egid to 'nobody' first and if it throws a `group id does not exist` error, it attempts to set egid to 'nogroup'. If it still causes an error, the error is thrown. PR-URL: #19757 Refs: #19594 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
When the tests are run as root in Ubuntu, process.setgid() is called with 'nobody' as an argument. This throws an error in Ubuntu and is because, in Ubuntu, the equivalent of 'nobody' group is named as 'nogroup'. This commit sets gid to 'nobody' first and if it throws a "group id does not exist" error, it attempts to set gid to 'nogroup'. If it still causes an error, the error is thrown. PR-URL: #19755 Refs: #19594 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
When the tests are run as root in Ubuntu, process.setgid() is called with 'nobody' as an argument. This throws an error in Ubuntu and is because, in Ubuntu, the equivalent of 'nobody' group is named as 'nogroup'. This commit sets gid to 'nobody' first and if it throws a "group id does not exist" error, it attempts to set gid to 'nogroup'. If it still causes an error, the error is thrown. PR-URL: #19755 Refs: #19594 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
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
When the 'nobody' user is missing use .code to detect this, its more robust than than the .message string. Refs: nodejs#19594
When the 'nobody' user is missing use .code to detect this, its more robust than than the .message string. Refs: nodejs#19594 PR-URL: nodejs#28219 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yuta Hiroto <hello@hiroppy.me> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
When the 'nobody' user is missing use .code to detect this, its more robust than than the .message string. Refs: #19594 PR-URL: #28219 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yuta Hiroto <hello@hiroppy.me> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
When running tests as root,
sudo make test
I get the following errorsError 1 -
Error 2
Error 3
Error 4
Error 1 is covered in Issue 19371
Error 3 and Error 4
The lines that throw these errors in the respective files
On reading further, I figured that this is because the standard
nobody
group in UNIX systems is namednogroup
in Ubuntu.When I changed the lines which were throwing errors to the following - which checks if
nobody
group does not exist on the UNIX system it tries to set the group tonogroup
before throwing an errorand
respectively in the two files, Errors 3 and 4 were resolved
I'd like to work on Errors 3 and 4 and if the changes I have made make sense I'd like to submit a PR for it
The text was updated successfully, but these errors were encountered: