]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
oeqa: Default to buffer mode for tests
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 14 Jul 2018 14:50:48 +0000 (14:50 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 15 Jul 2018 15:34:12 +0000 (16:34 +0100)
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.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/core/context.py
meta/lib/oeqa/core/runner.py
meta/lib/oeqa/selftest/cases/devtool.py
meta/lib/oeqa/selftest/cases/efibootpartition.py
meta/lib/oeqa/selftest/cases/imagefeatures.py
meta/lib/oeqa/selftest/cases/runqemu.py

index acd547416f914097231580631174af583272e566..10481b44b61da92399f9418faf50a13c80343ffc 100644 (file)
@@ -59,7 +59,7 @@ class OETestContext(object):
         self.suites = self.loader.discover()
 
     def runTests(self, skips=[]):
-        self.runner = self.runnerClass(self, descriptions=False, verbosity=2)
+        self.runner = self.runnerClass(self, descriptions=False, verbosity=2, buffer=True)
 
         # Dinamically skip those tests specified though arguments
         self.skipTests(skips)
index 374d30cc38d9b11cacfca0aa0c7333f3975f53f5..219102c6b0facd509ef4bc7dfce3c49bbffbf238 100644 (file)
@@ -48,11 +48,6 @@ class OETestResult(_TestResult):
         self._tc_map_results()
 
     def startTest(self, test):
-        # Allow us to trigger the testcase buffer mode on a per test basis
-        # so stdout/stderr are only printed upon failure. Enables debugging
-        # but clean output
-        if hasattr(test, "buffer"):
-            self.buffer = test.buffer
         super(OETestResult, self).startTest(test)
 
     def _tc_map_results(self):
index 723d8e19cfd35904b35d8f76d45aa2082e8caafd..f2b0f59677153b5a501ab2f5b0b635846515aef8 100644 (file)
@@ -13,8 +13,6 @@ from oeqa.core.decorator.oeid import OETestID
 
 class DevtoolBase(OESelftestTestCase):
 
-    buffer = True
-
     def _test_recipe_contents(self, recipefile, checkvars, checkinherits):
         with open(recipefile, 'r') as f:
             invar = None
index 0c832566965fcc1306b6b5cf2d9167cc15f30fc7..c6f39d5b1627a2445fb9a86a62a84028897545f8 100644 (file)
@@ -11,7 +11,6 @@ from oeqa.utils.commands import bitbake, runqemu, get_bb_var
 class GenericEFITest(OESelftestTestCase):
     """EFI booting test class"""
 
-    buffer = True
     cmd_common = "runqemu nographic serial wic ovmf"
     efi_provider = "systemd-boot"
     image = "core-image-minimal"
index b60ab8ae7e143a3d6f3326b31597ebc5d9b18501..8c95432e00b3cb58bb4efe6a341c273b24896f96 100644 (file)
@@ -10,8 +10,6 @@ class ImageFeatures(OESelftestTestCase):
     test_user = 'tester'
     root_user = 'root'
 
-    buffer = True
-
     @OETestID(1107)
     def test_non_root_user_can_connect_via_ssh_without_password(self):
         """
index 5ebdd57a41e8f755df76ea25187b07e903fe5d3d..e57f503a57745e4f458237bf6674f813306a9f97 100644 (file)
@@ -14,8 +14,6 @@ class RunqemuTests(OESelftestTestCase):
 
     image_is_ready = False
     deploy_dir_image = ''
-    # We only want to print runqemu stdout/stderr if there is a test case failure
-    buffer = True
 
     def setUpLocal(self):
         super(RunqemuTests, self).setUpLocal()