diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2016-02-13 11:02:13 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-02-15 16:28:23 +0000 |
commit | 67ccf7413b2ac9f516dbdaa6a39d4cec38a6c94d (patch) | |
tree | bf3dcb792526ba2ae2f1cdc2f645a7e003d797a5 /meta/lib | |
parent | 4c90daaeb946f1adf58b2f71f1af8eb7f5906474 (diff) | |
download | openembedded-core-67ccf7413b2ac9f516dbdaa6a39d4cec38a6c94d.tar.gz openembedded-core-67ccf7413b2ac9f516dbdaa6a39d4cec38a6c94d.tar.bz2 openembedded-core-67ccf7413b2ac9f516dbdaa6a39d4cec38a6c94d.zip |
oeqa/targetcontrol: make ssh control optional
Added new parameter 'ssh' to targetcontrol 'start' method
to be able to test images without running ssh server.
[YOCTO #8498]
(From OE-Core rev: 1c3c66aadd43092bc19242b0651ee810cc31fe7c)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oeqa/targetcontrol.py | 18 | ||||
-rw-r--r-- | meta/lib/oeqa/utils/commands.py | 4 |
2 files changed, 12 insertions, 10 deletions
diff --git a/meta/lib/oeqa/targetcontrol.py b/meta/lib/oeqa/targetcontrol.py index edc0d01c1e..f461651930 100644 --- a/meta/lib/oeqa/targetcontrol.py +++ b/meta/lib/oeqa/targetcontrol.py @@ -68,7 +68,7 @@ class BaseTarget(object): bb.note("SSH log file: %s" % self.sshlog) @abstractmethod - def start(self, params=None): + def start(self, params=None, ssh=True): pass @abstractmethod @@ -176,11 +176,12 @@ class QemuTarget(BaseTarget): bb.note("Qemu log file: %s" % self.qemulog) super(QemuTarget, self).deploy() - def start(self, params=None): - if self.runner.start(params): - self.ip = self.runner.ip - self.server_ip = self.runner.server_ip - self.connection = SSHControl(ip=self.ip, logfile=self.sshlog) + def start(self, params=None, ssh=True): + if self.runner.start(params, get_ip=ssh): + if ssh: + self.ip = self.runner.ip + self.server_ip = self.runner.server_ip + self.connection = SSHControl(ip=self.ip, logfile=self.sshlog) else: self.stop() if os.path.exists(self.qemulog): @@ -231,8 +232,9 @@ class SimpleRemoteTarget(BaseTarget): def deploy(self): super(SimpleRemoteTarget, self).deploy() - def start(self, params=None): - self.connection = SSHControl(self.ip, logfile=self.sshlog, port=self.port) + def start(self, params=None, ssh=True): + if ssh: + self.connection = SSHControl(self.ip, logfile=self.sshlog, port=self.port) def stop(self): self.connection = None diff --git a/meta/lib/oeqa/utils/commands.py b/meta/lib/oeqa/utils/commands.py index 93a0e4846b..32e001c6b5 100644 --- a/meta/lib/oeqa/utils/commands.py +++ b/meta/lib/oeqa/utils/commands.py @@ -178,7 +178,7 @@ def create_temp_layer(templayerdir, templayername, priority=999, recipepathspec= @contextlib.contextmanager -def runqemu(pn): +def runqemu(pn, ssh=True): import bb.tinfoil import bb.build @@ -222,7 +222,7 @@ def runqemu(pn): try: qemu.deploy() try: - qemu.start() + qemu.start(ssh=ssh) except bb.build.FuncFailed: raise Exception('Failed to start QEMU - see the logs in %s' % logdir) |