Files
meta-zephyr/lib/oeqa/runtime/cases/zephyr.py
yockgenm 36e7d48141 zephyr: Yocto Image Tests Fix
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>
2020-11-09 12:27:14 +08:00

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)