"""Test case that manages Zephyr IUT"""
from ptsprojects.testcase import TestCaseLT1, TestCaseLT2, TestFunc, \
TestFuncCleanUp
from ptsprojects.stack import get_stack
from ptsprojects.zephyr.iutctl import get_iut
class ZTestCase(TestCaseLT1):
"""A Zephyr test case that uses QEMU or HW as DUT"""
def __init__(self, *args, **kwargs):
"""Refer to TestCase.__init__ for parameters and their documentation"""
super(ZTestCase, self).__init__(*args, ptsproject_name="zephyr",
**kwargs)
self.stack = get_stack()
self.zephyrctl = get_iut()
self.cmds.insert(0, TestFunc(self.zephyrctl.start))
self.cmds.insert(1, TestFunc(self.zephyrctl.wait_iut_ready_event))
self.cmds.append(TestFuncCleanUp(self.stack.cleanup))
self.cmds.append(TestFuncCleanUp(self.zephyrctl.stop))
class ZTestCaseSlave(TestCaseLT2):
"""A Zephyr helper test case that uses QEMU or HW as DUT"""
def __init__(self, *args, **kwargs):
"""Refer to TestCase.__init__ for parameters and their documentation"""
super(ZTestCaseSlave, self).__init__(*args, ptsproject_name="zephyr",
**kwargs)