Merge lp:~kissiel/qa-regression-testing/kernel-sec-py3-friendly into lp:qa-regression-testing
Status: | Merged |
---|---|
Approved by: | Alberto Salvia Novella |
Approved revision: | 2559 |
Merged at revision: | 2556 |
Proposed branch: | lp:~kissiel/qa-regression-testing/kernel-sec-py3-friendly |
Merge into: | lp:qa-regression-testing |
Diff against target: |
270 lines (+42/-34) 5 files modified
scripts/kernel-security/errno-read.py (+8/-5) scripts/kernel-security/proc-leaks/dac-bypass.py (+5/-5) scripts/kernel-security/proc-maps/maps-protection.py (+1/-1) scripts/test-kernel-security.py (+1/-1) scripts/testlib.py (+27/-22) |
To merge this branch: | bzr merge lp:~kissiel/qa-regression-testing/kernel-sec-py3-friendly |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alberto Salvia Novella (community) | Approve | ||
Review via email: mp+302017@code.launchpad.net |
Description of the change
This MR makes all python code in kernel-security suite python3 friendly as well as testlib.py
print conversions were done using 2to3, other issues were done manually.
This helps significantly when porting the security suite to snappy.
It would be even better if I'd be allowed to make all those tests explicitly run python3 (by changing shebangs).
Comments welcome!
Changes made:
* print as a function
* explicitly decoding output from std{out,err}
* s/self.
* explicitly closing open files
* bytes literals instead of strings when used with conjuction with the raw output of std{out,err}
* 0o0000 notation for octal literals
* 'as' syntax for catching exceptions
* string.
* /usr/bin/env python instead of absolute /usr/bin/python in shebangs