summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-07-14 14:50:48 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-07-16 13:21:35 +0100
commit6b219f64c403361926a464925f0a32b2b3d27ffc (patch)
tree535e1d443737f3fc94cbbd1ec0c48806d3e23c5f
parenteacc12c2ec6d778c70f91f8c754f64c6c097f35a (diff)
downloadpoky-6b219f64c403361926a464925f0a32b2b3d27ffc.tar.gz
oeqa: Default to buffer mode for tests
Currently some tests run in buffer mode and some don't. Those that don't can corrupt stdout/stderr. Switch to using buffer mode everywhere so we're consistent. If there is useful output on stdout/stderr, it will be displayed if the test fails. (From OE-Core rev: 978548c0abde2cb94c2782538552f39bdf2bf630) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/core/context.py2
-rw-r--r--meta/lib/oeqa/core/runner.py5
-rw-r--r--meta/lib/oeqa/selftest/cases/devtool.py2
-rw-r--r--meta/lib/oeqa/selftest/cases/efibootpartition.py1
-rw-r--r--meta/lib/oeqa/selftest/cases/imagefeatures.py2
-rw-r--r--meta/lib/oeqa/selftest/cases/runqemu.py2
6 files changed, 1 insertions, 13 deletions
diff --git a/meta/lib/oeqa/core/context.py b/meta/lib/oeqa/core/context.py
index acd547416f..10481b44b6 100644
--- a/meta/lib/oeqa/core/context.py
+++ b/meta/lib/oeqa/core/context.py
@@ -59,7 +59,7 @@ class OETestContext(object):
59 self.suites = self.loader.discover() 59 self.suites = self.loader.discover()
60 60
61 def runTests(self, skips=[]): 61 def runTests(self, skips=[]):
62 self.runner = self.runnerClass(self, descriptions=False, verbosity=2) 62 self.runner = self.runnerClass(self, descriptions=False, verbosity=2, buffer=True)
63 63
64 # Dinamically skip those tests specified though arguments 64 # Dinamically skip those tests specified though arguments
65 self.skipTests(skips) 65 self.skipTests(skips)
diff --git a/meta/lib/oeqa/core/runner.py b/meta/lib/oeqa/core/runner.py
index 374d30cc38..219102c6b0 100644
--- a/meta/lib/oeqa/core/runner.py
+++ b/meta/lib/oeqa/core/runner.py
@@ -48,11 +48,6 @@ class OETestResult(_TestResult):
48 self._tc_map_results() 48 self._tc_map_results()
49 49
50 def startTest(self, test): 50 def startTest(self, test):
51 # Allow us to trigger the testcase buffer mode on a per test basis
52 # so stdout/stderr are only printed upon failure. Enables debugging
53 # but clean output
54 if hasattr(test, "buffer"):
55 self.buffer = test.buffer
56 super(OETestResult, self).startTest(test) 51 super(OETestResult, self).startTest(test)
57 52
58 def _tc_map_results(self): 53 def _tc_map_results(self):
diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py
index 723d8e19cf..f2b0f59677 100644
--- a/meta/lib/oeqa/selftest/cases/devtool.py
+++ b/meta/lib/oeqa/selftest/cases/devtool.py
@@ -13,8 +13,6 @@ from oeqa.core.decorator.oeid import OETestID
13 13
14class DevtoolBase(OESelftestTestCase): 14class DevtoolBase(OESelftestTestCase):
15 15
16 buffer = True
17
18 def _test_recipe_contents(self, recipefile, checkvars, checkinherits): 16 def _test_recipe_contents(self, recipefile, checkvars, checkinherits):
19 with open(recipefile, 'r') as f: 17 with open(recipefile, 'r') as f:
20 invar = None 18 invar = None
diff --git a/meta/lib/oeqa/selftest/cases/efibootpartition.py b/meta/lib/oeqa/selftest/cases/efibootpartition.py
index 0c83256696..c6f39d5b16 100644
--- a/meta/lib/oeqa/selftest/cases/efibootpartition.py
+++ b/meta/lib/oeqa/selftest/cases/efibootpartition.py
@@ -11,7 +11,6 @@ from oeqa.utils.commands import bitbake, runqemu, get_bb_var
11class GenericEFITest(OESelftestTestCase): 11class GenericEFITest(OESelftestTestCase):
12 """EFI booting test class""" 12 """EFI booting test class"""
13 13
14 buffer = True
15 cmd_common = "runqemu nographic serial wic ovmf" 14 cmd_common = "runqemu nographic serial wic ovmf"
16 efi_provider = "systemd-boot" 15 efi_provider = "systemd-boot"
17 image = "core-image-minimal" 16 image = "core-image-minimal"
diff --git a/meta/lib/oeqa/selftest/cases/imagefeatures.py b/meta/lib/oeqa/selftest/cases/imagefeatures.py
index b60ab8ae7e..8c95432e00 100644
--- a/meta/lib/oeqa/selftest/cases/imagefeatures.py
+++ b/meta/lib/oeqa/selftest/cases/imagefeatures.py
@@ -10,8 +10,6 @@ class ImageFeatures(OESelftestTestCase):
10 test_user = 'tester' 10 test_user = 'tester'
11 root_user = 'root' 11 root_user = 'root'
12 12
13 buffer = True
14
15 @OETestID(1107) 13 @OETestID(1107)
16 def test_non_root_user_can_connect_via_ssh_without_password(self): 14 def test_non_root_user_can_connect_via_ssh_without_password(self):
17 """ 15 """
diff --git a/meta/lib/oeqa/selftest/cases/runqemu.py b/meta/lib/oeqa/selftest/cases/runqemu.py
index 5ebdd57a41..e57f503a57 100644
--- a/meta/lib/oeqa/selftest/cases/runqemu.py
+++ b/meta/lib/oeqa/selftest/cases/runqemu.py
@@ -14,8 +14,6 @@ class RunqemuTests(OESelftestTestCase):
14 14
15 image_is_ready = False 15 image_is_ready = False
16 deploy_dir_image = '' 16 deploy_dir_image = ''
17 # We only want to print runqemu stdout/stderr if there is a test case failure
18 buffer = True
19 17
20 def setUpLocal(self): 18 def setUpLocal(self):
21 super(RunqemuTests, self).setUpLocal() 19 super(RunqemuTests, self).setUpLocal()