Merge ~juergh/+git/autotest-client-tests:juergh/handle-skipped-raspi-tests into ~canonical-kernel-team/+git/autotest-client-tests:master

Proposed by Juerg Haefliger
Status: Merged
Merge reported by: Po-Hsu Lin
Merged at revision: 72a6f8afc82828a1a7e7a99b53774f9b086e467c
Proposed branch: ~juergh/+git/autotest-client-tests:juergh/handle-skipped-raspi-tests
Merge into: ~canonical-kernel-team/+git/autotest-client-tests:master
Diff against target: 32 lines (+11/-2)
1 file modified
ubuntu_raspberry_pi/ubuntu_raspberry_pi.py (+11/-2)
Reviewer Review Type Date Requested Status
Po-Hsu Lin Approve
Canonical Kernel Team Pending
Review via email: mp+448238@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Looks ok to me, another solution is to add an if statement to skip the test directly in ubuntu_raspberry_pi/ubuntu_raspberry_pi.py

Note the return code is defined in https://git.launchpad.net/~canonical-kernel-team/+git/raspi-rt-tests/tree/tests/cgroups#n12

review: Approve
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Applied and pushed. Thanks

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/ubuntu_raspberry_pi/ubuntu_raspberry_pi.py b/ubuntu_raspberry_pi/ubuntu_raspberry_pi.py
2index 5a4ad3f..6cb874a 100644
3--- a/ubuntu_raspberry_pi/ubuntu_raspberry_pi.py
4+++ b/ubuntu_raspberry_pi/ubuntu_raspberry_pi.py
5@@ -1,9 +1,11 @@
6 #
7 #
8-from autotest.client import test, utils
9 import os
10 import shutil
11
12+from autotest.client import test, utils
13+from autotest.client.shared import error
14+
15 TEST_REPOSITORY = 'git://git.launchpad.net/~canonical-kernel-team/+git/raspi-rt-tests'
16
17
18@@ -27,6 +29,13 @@ class ubuntu_raspberry_pi(test.test):
19 return
20
21 cmd = os.path.join(self.srcdir, 'raspi-rt-tests', 'tests', test_name)
22- utils.system_output(cmd, retain_output=True)
23+ try:
24+ utils.system_output(cmd, retain_output=True)
25+ except error.CmdError as e:
26+ if e.result_obj.exit_status != 125:
27+ # Exit status 125 indicates a skipped test which is considered
28+ # a GOOD result. Any other non-0 exit status is a real failure,
29+ # so re-raise the exception.
30+ raise e
31
32 # vi:set ts=4 sw=4 expandtab syntax=python:

Subscribers

People subscribed via source and target branches