diff options
Diffstat (limited to 'scripts/lib/compatlayer/cases/common.py')
-rw-r--r-- | scripts/lib/compatlayer/cases/common.py | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/scripts/lib/compatlayer/cases/common.py b/scripts/lib/compatlayer/cases/common.py index 4d328ec1f1..9cc682e2c1 100644 --- a/scripts/lib/compatlayer/cases/common.py +++ b/scripts/lib/compatlayer/cases/common.py | |||
@@ -2,9 +2,8 @@ | |||
2 | # Released under the MIT license (see COPYING.MIT) | 2 | # Released under the MIT license (see COPYING.MIT) |
3 | 3 | ||
4 | import os | 4 | import os |
5 | import subprocess | ||
6 | import unittest | 5 | import unittest |
7 | from compatlayer import get_signatures, LayerType | 6 | from compatlayer import get_signatures, LayerType, check_command |
8 | from compatlayer.case import OECompatLayerTestCase | 7 | from compatlayer.case import OECompatLayerTestCase |
9 | 8 | ||
10 | class CommonCompatLayer(OECompatLayerTestCase): | 9 | class CommonCompatLayer(OECompatLayerTestCase): |
@@ -20,26 +19,12 @@ class CommonCompatLayer(OECompatLayerTestCase): | |||
20 | msg="Layer contains README file but is empty.") | 19 | msg="Layer contains README file but is empty.") |
21 | 20 | ||
22 | def test_parse(self): | 21 | def test_parse(self): |
23 | try: | 22 | check_command('Layer %s failed to parse.' % self.tc.layer['name'], |
24 | output = subprocess.check_output('bitbake -p', shell=True, | 23 | 'bitbake -p') |
25 | stderr=subprocess.PIPE) | ||
26 | except subprocess.CalledProcessError as e: | ||
27 | import traceback | ||
28 | exc = traceback.format_exc() | ||
29 | msg = 'Layer %s failed to parse.\n%s\n%s\n' % (self.tc.layer['name'], | ||
30 | exc, e.output.decode('utf-8')) | ||
31 | raise RuntimeError(msg) | ||
32 | 24 | ||
33 | def test_show_environment(self): | 25 | def test_show_environment(self): |
34 | try: | 26 | check_command('Layer %s failed to show environment.' % self.tc.layer['name'], |
35 | output = subprocess.check_output('bitbake -e', shell=True, | 27 | 'bitbake -e') |
36 | stderr=subprocess.PIPE) | ||
37 | except subprocess.CalledProcessError as e: | ||
38 | import traceback | ||
39 | exc = traceback.format_exc() | ||
40 | msg = 'Layer %s failed to show environment.\n%s\n%s\n' % \ | ||
41 | (self.tc.layer['name'], exc, e.output.decode('utf-8')) | ||
42 | raise RuntimeError(msg) | ||
43 | 28 | ||
44 | def test_signatures(self): | 29 | def test_signatures(self): |
45 | if self.tc.layer['type'] == LayerType.SOFTWARE: | 30 | if self.tc.layer['type'] == LayerType.SOFTWARE: |