qemurunner: add parameter to method 'start'

QemuRunner requires pair of ip addresses provided through kernel
commandline for method 'start' to work. These ip addresses are
used to connect to the image using ssh and run tests there.
However, this functionality should not be mandatory as testing
doesn't always require ssh connection. Some tests can be run using
serial console.

Added new parameter 'get_ip' to QemuRunner.start to make it possible
to skip getting pair of ip addresses from kernel command line. This
should allow oe-selftest to test images without modifying kernel
command line.

[YOCTO #8498]

(From OE-Core rev: 3f8b734ebb81d035849288091bb0b97b9c4fba34)

(From OE-Core rev: 4c90daaeb946f1adf58b2f71f1af8eb7f5906474)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ed Bartosh 2016-02-13 11:02:12 +02:00 committed by Richard Purdie
parent d083fec6d1
commit 0ade65834b
1 changed files with 23 additions and 22 deletions

View File

@ -91,7 +91,7 @@ class QemuRunner:
self._dump_host()
raise SystemExit
def start(self, qemuparams = None):
def start(self, qemuparams = None, get_ip = True):
if self.display:
os.environ["DISPLAY"] = self.display
# Set this flag so that Qemu doesn't do any grabs as SDL grabs
@ -178,6 +178,7 @@ class QemuRunner:
if self.is_alive():
logger.info("qemu started - qemu procces pid is %s" % self.qemupid)
if get_ip:
cmdline = ''
with open('/proc/%s/cmdline' % self.qemupid) as p:
cmdline = p.read()