mirror of
https://git.yoctoproject.org/poky
synced 2026-09-14 03:49:32 +02:00
oeqa/targetcontrol: make BaseTarget an abstract class
This should make it clear what methods a subclass needs to redefine. (From OE-Core rev: a4e4de4189cec3076a863c32c98e02766187ab48) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
a18cd65908
commit
9744e0fb0a
@@ -12,6 +12,7 @@ import traceback
|
|||||||
from oeqa.utils.sshcontrol import SSHControl
|
from oeqa.utils.sshcontrol import SSHControl
|
||||||
from oeqa.utils.qemurunner import QemuRunner
|
from oeqa.utils.qemurunner import QemuRunner
|
||||||
from oeqa.controllers.testtargetloader import TestTargetLoader
|
from oeqa.controllers.testtargetloader import TestTargetLoader
|
||||||
|
from abc import ABCMeta, abstractmethod
|
||||||
|
|
||||||
def get_target_controller(d):
|
def get_target_controller(d):
|
||||||
testtarget = d.getVar("TEST_TARGET", True)
|
testtarget = d.getVar("TEST_TARGET", True)
|
||||||
@@ -40,6 +41,8 @@ def get_target_controller(d):
|
|||||||
|
|
||||||
class BaseTarget(object):
|
class BaseTarget(object):
|
||||||
|
|
||||||
|
__metaclass__ = ABCMeta
|
||||||
|
|
||||||
def __init__(self, d):
|
def __init__(self, d):
|
||||||
self.connection = None
|
self.connection = None
|
||||||
self.ip = None
|
self.ip = None
|
||||||
@@ -48,6 +51,7 @@ class BaseTarget(object):
|
|||||||
self.testdir = d.getVar("TEST_LOG_DIR", True)
|
self.testdir = d.getVar("TEST_LOG_DIR", True)
|
||||||
self.pn = d.getVar("PN", True)
|
self.pn = d.getVar("PN", True)
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
def deploy(self):
|
def deploy(self):
|
||||||
|
|
||||||
self.sshlog = os.path.join(self.testdir, "ssh_target_log.%s" % self.datetime)
|
self.sshlog = os.path.join(self.testdir, "ssh_target_log.%s" % self.datetime)
|
||||||
@@ -57,6 +61,18 @@ class BaseTarget(object):
|
|||||||
os.symlink(self.sshlog, sshloglink)
|
os.symlink(self.sshlog, sshloglink)
|
||||||
bb.note("SSH log file: %s" % self.sshlog)
|
bb.note("SSH log file: %s" % self.sshlog)
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def start(self, params=None):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def stop(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def restart(self, params=None):
|
||||||
|
pass
|
||||||
|
|
||||||
def run(self, cmd, timeout=None):
|
def run(self, cmd, timeout=None):
|
||||||
return self.connection.run(cmd, timeout)
|
return self.connection.run(cmd, timeout)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user