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

daemon_test tries to reboot my workstation #760

Closed
stbenjam opened this issue May 15, 2019 · 4 comments
Closed

daemon_test tries to reboot my workstation #760

stbenjam opened this issue May 15, 2019 · 4 comments

Comments

@stbenjam
Copy link
Member

Description

It looks like make test-unit wants to reboot my workstation because of the machine-config-daemon tests.

Steps to reproduce the issue:

  1. Run make test-unit or just go test -v github.com/openshift/machine-config-operator/pkg/daemon on a Fedora workstation

Describe the results you received:

If you are an unprivileged user, gnome may prompt you to enter credentials. If you enter them, it would reboot the host.

Describe the results you expected:

Tests shouldn't affect my development environment. Are most people running these tests in a container? HACKING.md doesn't mention this.

Additional information you deem important (e.g. issue happens only occasionally):

Output of oc adm release info --commits | grep machine-config-operator:

N/A

Additional environment details (platform, options, etc.):

@cgwalters
Copy link
Member

Hm, we removed one of those units recently. I'd probably say we avoid creating a Daemon instance in any of our unit tests at all, and move towards just unit testing "free" functions that aren't methods on Daemon. I just did that in #762

Interested in doing a PR for this?

@cgwalters
Copy link
Member

The other alternative would be to os.Getuid() and skip/bail if it's not 0 in various places in Daemon but eh...ugly.

@cgwalters
Copy link
Member

Yeah I think this was fixed by #762 - please reopen if that wasn't the case.

@stbenjam
Copy link
Member Author

Looks like it's fixed, thanks!

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

No branches or pull requests

2 participants