[autotest-client-tests][PATCH 0/2] ubuntu_boot: fix return value for kernel_taint_test.py and format improvement

Po-Hsu Lin po-hsu.lin at canonical.com
Wed Mar 30 10:12:04 UTC 2022


exit takes only integer args in the range 0 - 255
If we return the taint value read from /proc/sys/kernel/tainted,
it might exceed this range and causing unexpected behaviour.

On a system with kernel warning, e.g. Intel node spitfire with 4.4
$ ./kernel_taint_test.py
Kernel taint value is 512
Taint bit value: 9 (kernel issued warning)
$ echo 0
0

Let's just simplify the return logic of report_failures() to return
either 0 or 1.

Luckily we do run this test along with log check test, so even with
this test reporting a false negative result, we can still catch
warnings with the log check test.

Tested on node spitfire with X-4.4 and the kernel_tainted test will
fail as expected.

Po-Hsu Lin (2):
  UBUNTU: SAUCE: ubuntu_boot: fix return value for kernel_taint_test.py
  UBUNTU: SAUCE: ubuntu_boot: move report_failures() to main() and code
    cleanup

 ubuntu_boot/kernel_taint_test.py | 45 ++++++++++++++------------------
 1 file changed, 19 insertions(+), 26 deletions(-)

-- 
2.25.1




More information about the kernel-team mailing list