mirror of
https://git.yoctoproject.org/poky
synced 2026-07-27 07:27:12 +00:00
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: 85c1b6fb516aae58240330a0aca659bfafcd3883) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -58,7 +58,7 @@ class OETestContext(object):
|
|||||||
self.suites = self.loader.discover()
|
self.suites = self.loader.discover()
|
||||||
|
|
||||||
def runTests(self, skips=[]):
|
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
|
# Dinamically skip those tests specified though arguments
|
||||||
self.skipTests(skips)
|
self.skipTests(skips)
|
||||||
|
|||||||
@@ -43,11 +43,6 @@ class OETestResult(_TestResult):
|
|||||||
self.tc = tc
|
self.tc = tc
|
||||||
|
|
||||||
def startTest(self, test):
|
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)
|
super(OETestResult, self).startTest(test)
|
||||||
|
|
||||||
def logSummary(self, component, context_msg=''):
|
def logSummary(self, component, context_msg=''):
|
||||||
|
|||||||
@@ -78,8 +78,6 @@ def tearDownModule():
|
|||||||
|
|
||||||
class DevtoolBase(OESelftestTestCase):
|
class DevtoolBase(OESelftestTestCase):
|
||||||
|
|
||||||
buffer = True
|
|
||||||
|
|
||||||
def _test_recipe_contents(self, recipefile, checkvars, checkinherits):
|
def _test_recipe_contents(self, recipefile, checkvars, checkinherits):
|
||||||
with open(recipefile, 'r') as f:
|
with open(recipefile, 'r') as f:
|
||||||
invar = None
|
invar = None
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ from oeqa.utils.commands import bitbake, runqemu, get_bb_var
|
|||||||
class GenericEFITest(OESelftestTestCase):
|
class GenericEFITest(OESelftestTestCase):
|
||||||
"""EFI booting test class"""
|
"""EFI booting test class"""
|
||||||
|
|
||||||
buffer = True
|
|
||||||
cmd_common = "runqemu nographic serial wic ovmf"
|
cmd_common = "runqemu nographic serial wic ovmf"
|
||||||
efi_provider = "systemd-boot"
|
efi_provider = "systemd-boot"
|
||||||
image = "core-image-minimal"
|
image = "core-image-minimal"
|
||||||
|
|||||||
@@ -10,8 +10,6 @@ class ImageFeatures(OESelftestTestCase):
|
|||||||
test_user = 'tester'
|
test_user = 'tester'
|
||||||
root_user = 'root'
|
root_user = 'root'
|
||||||
|
|
||||||
buffer = True
|
|
||||||
|
|
||||||
@OETestID(1107)
|
@OETestID(1107)
|
||||||
def test_non_root_user_can_connect_via_ssh_without_password(self):
|
def test_non_root_user_can_connect_via_ssh_without_password(self):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -15,8 +15,6 @@ class RunqemuTests(OESelftestTestCase):
|
|||||||
|
|
||||||
image_is_ready = False
|
image_is_ready = False
|
||||||
deploy_dir_image = ''
|
deploy_dir_image = ''
|
||||||
# We only want to print runqemu stdout/stderr if there is a test case failure
|
|
||||||
buffer = True
|
|
||||||
|
|
||||||
def setUpLocal(self):
|
def setUpLocal(self):
|
||||||
super(RunqemuTests, self).setUpLocal()
|
super(RunqemuTests, self).setUpLocal()
|
||||||
|
|||||||
Reference in New Issue
Block a user