Merge lp:~lool/linaro-image-tools/missing-sbin into lp:linaro-image-tools/11.11
Status: | Merged |
---|---|
Merged at revision: | 305 |
Proposed branch: | lp:~lool/linaro-image-tools/missing-sbin |
Merge into: | lp:linaro-image-tools/11.11 |
Diff against target: |
117 lines (+41/-5) 4 files modified
linaro_image_tools/cmd_runner.py (+14/-0) linaro_image_tools/hwpack/packages.py (+5/-3) linaro_image_tools/tests/test_cmd_runner.py (+21/-0) linaro_image_tools/utils.py (+1/-2) |
To merge this branch: | bzr merge lp:~lool/linaro-image-tools/missing-sbin |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Guilherme Salgado (community) | Approve | ||
Review via email: mp+54693@code.launchpad.net |
Description of the change
Fixes runs of the testsuite (didn't check actually running linaro-media-create or other helpers) when /sbin isn't in the PATH, or when PATH is empty, or when PATH isn't set; bug #709517.
This is a very crude fix, but it seems safe; please shout if you think this is too ugly and we should go with the other approach I describe in the bug.
I tested this with:
# /sbin missing from PATH
PATH=/usr/
# PATH set but empty
PATH="" /usr/bin/python -m subunit.run linaro_
# PATH unset
env -i testr run
env -u PATH /usr/bin/python -m subunit.run linaro_
I've pushed a quite different approach now; the bad part is that the hwpack testsuite doesn't pass anymore when PATH is broken, this is because the hwpack code uses subprocess.Popen directly.
What I would propose is that we convert the hwpack code to use cmd_runner.
I also need to add tests for sanitize_path, but wouldn't mind some feedback on the overall approach.