unit tests are leaking sudo commands
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ceilometer |
Fix Released
|
Undecided
|
Zhai, Edwin | ||
Juno |
Fix Released
|
Undecided
|
Lianhao Lu |
Bug Description
infra has just recently fixed a bug so that the jenkins user on slaves correctly has no sudo access. Previously, it had mistakenly been granted sudo access. Since then, ceilometer's unit test jobs are periodically failing because of attempts to use sudo:
2015-01-13 10:15:34.499 | + sudo /usr/local/
2015-01-13 10:15:34.501 | sudo: unable to resolve host bare-trusty-
2015-01-13 10:15:34.629 | 1a2,3
2015-01-13 10:15:34.630 | > Jan 13 10:14:05 bare-trusty-
2015-01-13 10:15:34.630 | > Jan 13 10:14:05 bare-trusty-
2015-01-13 10:15:34.630 | + sudoresult=1
2015-01-13 10:15:34.630 | + '[' 1 -ne 0 ']'
2015-01-13 10:15:34.631 | + echo
2015-01-13 10:15:34.631 |
2015-01-13 10:15:34.631 | + echo 'This test has failed because it attempted to execute commands'
2015-01-13 10:15:34.631 | This test has failed because it attempted to execute commands
2015-01-13 10:15:34.631 | + echo 'with sudo. See above for the exact commands used.'
2015-01-13 10:15:34.631 | with sudo. See above for the exact commands used.
2015-01-13 10:15:34.631 | + echo
2015-01-13 10:15:34.631 |
2015-01-13 10:15:34.631 | + exit 1
Note that the unit test run itself succeeds, but the post-job script to check for sudo attempts detects two ipmitool commands were attempted to be run with sudo and the job fails. I assume this is happening because of a missed mock somewhere in the tests. I'm not sure if it is specific to certain devstack slaves that the job is run, or the patch, but I originally hit it on a stable/juno patch:
https:/
But its happening on master as well:
https:/
I've attempted to push a debug patch to raise an exception for anything that actually shells out, but cannot seem to trigger the issue with that:
Changed in neutron: | |
assignee: | nobody → Ihar Hrachyshka (ihar-hrachyshka) |
Changed in ceilometer: | |
assignee: | Zhai, Edwin (edwin-zhai) → Lianhao Lu (lianhao-lu) |
Changed in ceilometer: | |
assignee: | Lianhao Lu (lianhao-lu) → Zhai, Edwin (edwin-zhai) |
Changed in ceilometer: | |
status: | In Progress → Fix Committed |
Changed in ceilometer: | |
milestone: | none → kilo-2 |
status: | Fix Committed → Fix Released |
Changed in ceilometer: | |
milestone: | kilo-2 → 2015.1.0 |
message:"+ echo 'This test has failed because it attempted to execute commands'" AND tags:"console" AND (project: "openstack/ neutron" OR project: "openstack/ ceilometer" )