diff options
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oeqa/targetcontrol.py | 16 |
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 | |||
12 | from oeqa.utils.sshcontrol import SSHControl | 12 | from oeqa.utils.sshcontrol import SSHControl |
13 | from oeqa.utils.qemurunner import QemuRunner | 13 | from oeqa.utils.qemurunner import QemuRunner |
14 | from oeqa.controllers.testtargetloader import TestTargetLoader | 14 | from oeqa.controllers.testtargetloader import TestTargetLoader |
15 | from abc import ABCMeta, abstractmethod | ||
15 | 16 | ||
16 | def get_target_controller(d): | 17 | def 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 | ||
41 | class BaseTarget(object): | 42 | class 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 | ||