unit tests fail as non-root on maas deployed system
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Fix Released
|
Medium
|
Unassigned | ||
cloud-init (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Xenial |
Fix Released
|
Low
|
Unassigned | ||
Yakkety |
Fix Released
|
Low
|
Unassigned |
Bug Description
=== Begin SRU Template ===
[Impact]
Running cloud-init's unit test cases on a system deployed by MAAS would
fail. The reason is that the non-root user would not be able to read
files with MAAS node credentials in /etc/cloud/
We want this change SRU so that an attempt to build and run tests on a
system deployed by maas will work rather than fail due to unit test failure.
[Test Case]
Run unit tests on a system deployed by maas, or even just with:
f=/etc/
sh -c 'mkdir -p "${1%/*}" && touch "$1" && chmod ugo-r "$1"' -- "$f"
tox -e py3
[Regression Potential]
This was just to fix a build break or unit tests being run.
Changes are only to unit tests.
=== End SRU Template ===
Observed Behavior:
On a system deployed by MAAS I checked out master and then tried to immediately build it:
> git clone https:/
> cd cloud-init
> ./packages/bddeb
I get a number of errors around permission issues around this file:
PermissionError: [Errno 13] Permission denied: \'/etc/
See: https:/
or formatted better: http://
If I run as root however, it build as expected.
Expected Behavior:
Running bddeb works as a non-root user.
Related branches
- Joshua Powers (community): Approve
- cloud-init Commiters: Pending requested
-
Diff: 181 lines (+23/-30)2 files modifiedtests/unittests/helpers.py (+8/-0)
tests/unittests/test_data.py (+15/-30)
Changed in cloud-init: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
Changed in cloud-init: | |
status: | Confirmed → Fix Committed |
summary: |
- bddeb does not work on a system deployed by maas + unit tests fail on maas deployed system |
summary: |
- unit tests fail on maas deployed system + unit tests fail as non-root on maas deployed system |
Changed in cloud-init (Ubuntu): | |
status: | New → Fix Released |
importance: | Undecided → Medium |
Changed in cloud-init (Ubuntu Xenial): | |
status: | New → Confirmed |
Changed in cloud-init (Ubuntu Yakkety): | |
status: | New → Confirmed |
Changed in cloud-init (Ubuntu Xenial): | |
importance: | Undecided → Low |
Changed in cloud-init (Ubuntu Yakkety): | |
importance: | Undecided → Low |
description: | updated |
description: | updated |
tags: |
added: verification-done removed: verification-needed |
just as a work around, you can actually build with: OPTIONS= nocheck
DEB_BUILD_
and then it wont run the tests.
obviously good reason to run the tests, but you may be able to assume it ran already.