Skip to content
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: disallow running the test suite as root #2585

Merged
merged 1 commit into from
Dec 26, 2019

Conversation

cjihrig
Copy link
Contributor

@cjihrig cjihrig commented Dec 23, 2019

The test suite is known to have issues when run as root. This commit prevents the test suite from running when the euid is 0.

I'm not sure how the other maintainers will feel about this change, but people clearly don't read the GitHub issue template, so I thought this was worth a shot to prevent issues like #2549 (and many more).

CI: https://ci.nodejs.org/view/libuv/job/libuv-test-commit/1666/ (looks like a normal libuv CI run)

Copy link
Member

@bnoordhuis bnoordhuis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but for historic background:

At least for the dtrace/dtruss case it's helpful to be able to circumvent the check. On the other hand, it's easy enough to compile it out. No strong opinion from me.

@saghul
Copy link
Member

saghul commented Dec 24, 2019

I’d merge and if there is a need we can add the escape hatch back maybe?

@bnoordhuis
Copy link
Member

Yes, that seems fine.

@bnoordhuis bnoordhuis closed this Dec 24, 2019
@bnoordhuis bnoordhuis reopened this Dec 24, 2019
@cjihrig
Copy link
Contributor Author

cjihrig commented Dec 24, 2019

I added back the escape hatch. If UV_RUN_AS_ROOT is set with any value, then the test suite can still run.

@cjihrig
Copy link
Contributor Author

cjihrig commented Dec 24, 2019

Copy link
Contributor

@richardlau richardlau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm with the escape hatch.

The test suite is known to have issues when run as root. This
commit prevents the test suite from running when the euid is 0.

Fixes: libuv#2549
PR-URL: libuv#2585
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants