mirror of
https://git.yoctoproject.org/meta-zephyr
synced 2026-09-13 03:49:31 +02:00
Fix bug on Image Test, previously the Image Tests was not working due to update on Yocto Image Test Framework. The fix has rewritten and restructured existing Image Tests code to latest Yocto testimage class requirement to make meta-zephyr able to run Image Tests as expected. Signed-off-by: yockgenm <yock.gen.mah@intel.com> Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
39 lines
1.2 KiB
Python
39 lines
1.2 KiB
Python
#
|
|
# SPDX-License-Identifier: MIT
|
|
#
|
|
|
|
from subprocess import Popen, PIPE
|
|
|
|
from oeqa.runtime.case import OERuntimeTestCase
|
|
from oeqa.core.decorator.oetimeout import OETimeout
|
|
|
|
class ZephyrTest(OERuntimeTestCase):
|
|
|
|
@OETimeout(120)
|
|
def test_boot_zephyr(self):
|
|
|
|
success = False
|
|
logfile = self.target.qemurunnerlog
|
|
|
|
while True:
|
|
line = self.target.serial_readline().decode("utf-8")
|
|
|
|
# All good
|
|
if "PROJECT EXECUTION SUCCESSFUL" in line:
|
|
success = True
|
|
break
|
|
|
|
if "PROJECT EXECUTION FAILED" in line:
|
|
success = False
|
|
self.assertTrue(success, msg='PROJECT EXECUTION FAILED in file:///%s' % logfile)
|
|
break
|
|
|
|
# Most likely cause for faults is incorrectly compiled code
|
|
if "***** USAGE FAULT *****" in line:
|
|
success = False
|
|
self.assertTrue(success, msg='***** USAGE FAULT *****" in file:///%s' % logfile)
|
|
break
|
|
|
|
# test program finished, complain if no success message
|
|
self.assertTrue(success, msg='"PROJECT EXECUTION SUCCESSFUL" not in file:///%s' % logfile)
|