Merge lp://staging/~jtv/maas-test/require-sudo into lp://staging/maas-test
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 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Raphaël Badin (community) | Approve | ||
Review via email:
|
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
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.