summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/targetcontrol.py
diff options
context:
space:
mode:
authorStefan Stanacar <stefanx.stanacar@intel.com>2014-02-27 17:46:15 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-02-28 14:01:13 +0000
commit9744e0fb0adc25d5a2c7c376ebfbf42abbe9e9ad (patch)
tree60e209999f8db00e8281d3fa6204e9ffb4f4b8d3 /meta/lib/oeqa/targetcontrol.py
parenta18cd65908ec3d50a0d861fa29c12d7776f921d0 (diff)
downloadpoky-9744e0fb0adc25d5a2c7c376ebfbf42abbe9e9ad.tar.gz
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>
Diffstat (limited to 'meta/lib/oeqa/targetcontrol.py')
-rw-r--r--meta/lib/oeqa/targetcontrol.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/meta/lib/oeqa/targetcontrol.py b/meta/lib/oeqa/targetcontrol.py
index 46e5f7fa6b..d8a6ac03ec 100644
--- a/meta/lib/oeqa/targetcontrol.py
+++ b/meta/lib/oeqa/targetcontrol.py
@@ -12,6 +12,7 @@ import traceback
12from oeqa.utils.sshcontrol import SSHControl 12from oeqa.utils.sshcontrol import SSHControl
13from oeqa.utils.qemurunner import QemuRunner 13from oeqa.utils.qemurunner import QemuRunner
14from oeqa.controllers.testtargetloader import TestTargetLoader 14from oeqa.controllers.testtargetloader import TestTargetLoader
15from abc import ABCMeta, abstractmethod
15 16
16def get_target_controller(d): 17def get_target_controller(d):
17 testtarget = d.getVar("TEST_TARGET", True) 18 testtarget = d.getVar("TEST_TARGET", True)
@@ -40,6 +41,8 @@ def get_target_controller(d):
40 41
41class BaseTarget(object): 42class BaseTarget(object):
42 43
44 __metaclass__ = ABCMeta
45
43 def __init__(self, d): 46 def __init__(self, d):
44 self.connection = None 47 self.connection = None
45 self.ip = None 48 self.ip = None
@@ -48,6 +51,7 @@ class BaseTarget(object):
48 self.testdir = d.getVar("TEST_LOG_DIR", True) 51 self.testdir = d.getVar("TEST_LOG_DIR", True)
49 self.pn = d.getVar("PN", True) 52 self.pn = d.getVar("PN", True)
50 53
54 @abstractmethod
51 def deploy(self): 55 def deploy(self):
52 56
53 self.sshlog = os.path.join(self.testdir, "ssh_target_log.%s" % self.datetime) 57 self.sshlog = os.path.join(self.testdir, "ssh_target_log.%s" % self.datetime)
@@ -57,6 +61,18 @@ class BaseTarget(object):
57 os.symlink(self.sshlog, sshloglink) 61 os.symlink(self.sshlog, sshloglink)
58 bb.note("SSH log file: %s" % self.sshlog) 62 bb.note("SSH log file: %s" % self.sshlog)
59 63
64 @abstractmethod
65 def start(self, params=None):
66 pass
67
68 @abstractmethod
69 def stop(self):
70 pass
71
72 @abstractmethod
73 def restart(self, params=None):
74 pass
75
60 def run(self, cmd, timeout=None): 76 def run(self, cmd, timeout=None):
61 return self.connection.run(cmd, timeout) 77 return self.connection.run(cmd, timeout)
62 78