Skip to content

daemon_test tries to reboot my workstation #760

Closed

Description

@stbenjam

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.):

Activity

  1. cgwalters commented on May 16, 2019

    @cgwalters
    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?

  2. cgwalters commented on May 16, 2019

    @cgwalters
    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.

  3. cgwalters commented on May 22, 2019

    @cgwalters
    Member

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

  4. stbenjam commented on May 22, 2019

    @stbenjam
    ContributorAuthor

    Looks like it's fixed, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions