]> code.ossystems Code Review - openembedded-core.git/commitdiff
testimage: Allow testing on QEMU machines with a single serial port
authorAlejandro Hernandez Samaniego <alejandro@enedino.org>
Sat, 8 Feb 2020 10:30:04 +0000 (02:30 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 13 Feb 2020 11:54:02 +0000 (11:54 +0000)
commmit 6cde67d0a84 enables the use of qemurunner on machines that
only have a single serial port, but still sets the default value
as serial_ports=2 if not provided.

The testimage class does not call qemurunner with a serial_ports
argument, hence always defaulting to two.

Pass the serial_ports argument from the testimage class to allow
tests to run on QEMU machines with a single serial port.

Signed-off-by: Alejandro Hernandez Samaniego <alejandro@enedino.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/testimage.bbclass
meta/lib/oeqa/core/target/qemu.py

index 844ed87944bfe215f7e4303bfba071f0bd4fd539..0d55c3247ebef7b4e5c231da248c8226b2448e8b 100644 (file)
@@ -256,6 +256,7 @@ def testimage_main(d):
                       'kvm'         : kvm,
                       'slirp'       : slirp,
                       'dump_dir'    : d.getVar("TESTIMAGE_DUMP_DIR"),
+                      'serial_ports': len(d.getVar("SERIAL_CONSOLES").split()),
                     }
 
     # TODO: Currently BBPATH is needed for custom loading of targets.
index 758703c0d12841034ca04a75e71c2bbc7ec7ee41..008a9f03cee9ad696431bc5f89dfd9ba9e29d2dd 100644 (file)
@@ -18,7 +18,7 @@ class OEQemuTarget(OESSHTarget):
     def __init__(self, logger, server_ip, timeout=300, user='root',
             port=None, machine='', rootfs='', kernel='', kvm=False, slirp=False,
             dump_dir='', dump_host_cmds='', display='', bootlog='',
-            tmpdir='', dir_image='', boottime=60, **kwargs):
+            tmpdir='', dir_image='', boottime=60, serial_ports=2, **kwargs):
 
         super(OEQemuTarget, self).__init__(logger, None, server_ip, timeout,
                 user, port)
@@ -35,7 +35,8 @@ class OEQemuTarget(OESSHTarget):
                                  deploy_dir_image=dir_image, display=display,
                                  logfile=bootlog, boottime=boottime,
                                  use_kvm=kvm, use_slirp=slirp, dump_dir=dump_dir,
-                                 dump_host_cmds=dump_host_cmds, logger=logger)
+                                 dump_host_cmds=dump_host_cmds, logger=logger,
+                                 serial_ports=serial_ports)
 
     def start(self, params=None, extra_bootparams=None, runqemuparams=''):
         if self.use_slirp and not self.server_ip: