Merge lp://staging/~jtv/maas-test/require-sudo into lp://staging/maas-test

Proposed by Jeroen T. Vermeulen
Status: Merged
Approved by: Jeroen T. Vermeulen
Approved revision: 86
Merged at revision: 86
Proposed branch: lp://staging/~jtv/maas-test/require-sudo
Merge into: lp://staging/maas-test
Diff against target: 147 lines (+69/-12)
2 files modified
maastest/main.py (+22/-4)
maastest/tests/test_main.py (+47/-8)
To merge this branch: bzr merge lp://staging/~jtv/maas-test/require-sudo
Reviewer Review Type Date Requested Status
Raphaël Badin (community) Approve
Review via email: mp+198039@code.staging.launchpad.net

Commit message

Refuse to run the tests except when running as root.

Description of the change

The DHCP check we just added requires the tests to be run with root privileges. Skipping the test unless running as root seems pointless — the sensible thing for the user to do is to run unprivileged as possible, so the test would basically never run.

I left the numerous “sudo” invocations in place, mostly because we want to get this done quickly but also because in the short term it leaves the door open for changing our minds. (In the longer term, of course, it will bit-rot and we might as well start getting rid of it. But handling of environment variables changes, so it's not a trivial seek-and-destroy change.)

Jeroen

To post a comment you must log in.
Revision history for this message
Raphaël Badin (rvb) wrote :

Nice! Thanks for the RETURN_CODES cleanup.

[0]

> In the longer term, of course, it will bit-rot and we might as well start getting rid of it.

I don't see us changing our minds about this, we might as well get rid of the 'sudo' invocations. But that's a cleanup better done later.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches