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) (From OE-Core rev: 67ccf7413b2ac9f516dbdaa6a39d4cec38a6c94d) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
0ade65834b
commit
7066f1671e
|
@ -68,7 +68,7 @@ class BaseTarget(object):
|
||||||
bb.note("SSH log file: %s" % self.sshlog)
|
bb.note("SSH log file: %s" % self.sshlog)
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def start(self, params=None):
|
def start(self, params=None, ssh=True):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
|
@ -176,11 +176,12 @@ class QemuTarget(BaseTarget):
|
||||||
bb.note("Qemu log file: %s" % self.qemulog)
|
bb.note("Qemu log file: %s" % self.qemulog)
|
||||||
super(QemuTarget, self).deploy()
|
super(QemuTarget, self).deploy()
|
||||||
|
|
||||||
def start(self, params=None):
|
def start(self, params=None, ssh=True):
|
||||||
if self.runner.start(params):
|
if self.runner.start(params, get_ip=ssh):
|
||||||
self.ip = self.runner.ip
|
if ssh:
|
||||||
self.server_ip = self.runner.server_ip
|
self.ip = self.runner.ip
|
||||||
self.connection = SSHControl(ip=self.ip, logfile=self.sshlog)
|
self.server_ip = self.runner.server_ip
|
||||||
|
self.connection = SSHControl(ip=self.ip, logfile=self.sshlog)
|
||||||
else:
|
else:
|
||||||
self.stop()
|
self.stop()
|
||||||
if os.path.exists(self.qemulog):
|
if os.path.exists(self.qemulog):
|
||||||
|
@ -231,8 +232,9 @@ class SimpleRemoteTarget(BaseTarget):
|
||||||
def deploy(self):
|
def deploy(self):
|
||||||
super(SimpleRemoteTarget, self).deploy()
|
super(SimpleRemoteTarget, self).deploy()
|
||||||
|
|
||||||
def start(self, params=None):
|
def start(self, params=None, ssh=True):
|
||||||
self.connection = SSHControl(self.ip, logfile=self.sshlog, port=self.port)
|
if ssh:
|
||||||
|
self.connection = SSHControl(self.ip, logfile=self.sshlog, port=self.port)
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
self.connection = None
|
self.connection = None
|
||||||
|
|
|
@ -178,7 +178,7 @@ def create_temp_layer(templayerdir, templayername, priority=999, recipepathspec=
|
||||||
|
|
||||||
|
|
||||||
@contextlib.contextmanager
|
@contextlib.contextmanager
|
||||||
def runqemu(pn):
|
def runqemu(pn, ssh=True):
|
||||||
|
|
||||||
import bb.tinfoil
|
import bb.tinfoil
|
||||||
import bb.build
|
import bb.build
|
||||||
|
@ -222,7 +222,7 @@ def runqemu(pn):
|
||||||
try:
|
try:
|
||||||
qemu.deploy()
|
qemu.deploy()
|
||||||
try:
|
try:
|
||||||
qemu.start()
|
qemu.start(ssh=ssh)
|
||||||
except bb.build.FuncFailed:
|
except bb.build.FuncFailed:
|
||||||
raise Exception('Failed to start QEMU - see the logs in %s' % logdir)
|
raise Exception('Failed to start QEMU - see the logs in %s' % logdir)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue