Skip to contentSkip to conversation

context.py: Do not mask exceptions needlessly.

PATCH Superseded Paulo Neves 2 participants 5 messages Aug 5, 2018

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 context.py: Do not mask exceptions needlessly.

There were a lot of assumptions in the controller import code of context.py which were not true anymore. These assumptions reflected themselves by catching exceptions and re-raising them with unhelpful error messages in other parts of the code.

This commit does not fix the classes controller classes that became broken after the refactor but at least it allows for the exceptions to be thrown where the imports fail, thus actually showing what exactly went wrong with the import.

An example of such an improvement is that before if the controller class failed during it's init contructor the controller would just be skipped and the task would just complain it could not find the controller. Now for example, if there is a NamerError due to a variable not being declared, the user will get that report.

---
 meta/lib/oeqa/runtime/context.py | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)
meta/lib/oeqa/runtime/context.py +4 -10
index 0294003..a7f3823 100644
@@ -112,12 +112,9 @@ class OERuntimeTestContextExecutor(OETestContextExecutor):
             # XXX: Don't base your targets on this code it will be refactored
             # in the near future.
             # Custom target module loading
-            try:
-                target_modules_path = kwargs.get('target_modules_path', '')
-                controller = OERuntimeTestContextExecutor.getControllerModule(target_type, target_modules_path)
-                target = controller(logger, target_ip, server_ip, **kwargs)
-            except ImportError as e:
-                raise TypeError("Failed to import %s from available controller modules" % target_type)
+            target_modules_path = kwargs.get('target_modules_path', '')
+            controller = OERuntimeTestContextExecutor.getControllerModule(target_type, target_modules_path)
+            target = controller(logger, target_ip, server_ip, **kwargs)
 
         return target
 
@@ -173,10 +170,7 @@ class OERuntimeTestContextExecutor(OETestContextExecutor):
     def _loadControllerFromModule(target, modulename):
         obj = None
         # import module, allowing it to raise import exception
-        try:
-            module = __import__(modulename, globals(), locals(), [target])
-        except Exception as e:
-            return obj
+        module = __import__(modulename, globals(), locals(), [target])
         # look for target class in the module, catching any exceptions as it
         # is valid that a module may not have the target class.
         try:
Signature · 1 line
2.7.4
#1 lore raw

PATCH 2/4 testimage: Refactoring and fixing.

The testimage.bbclass invocation of controllers besides simpletarget and qemutarget was broken.
Setting TEST_TARGET to
class names did not work, only hardcoded values set in context.py were allowed. On the other hand the other TEST_TARGETs available were
supposedly available through the class name convetion but
none of them were working. See:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=12842

In this commit qemuwrapper and simpletarget TEST_TARGETS are now not available through these names, but through the common convention of class names.

The code for layer defined controllers was outdated and broken because the example controllers in meta-yocto-bsp as well as the controllers available in masterimage were dependent only on the datastore d being available for __init__ contruction, when the testimage.bbclass and context.py, which initialize test controllers never passed the datastore. This commit fixes all the controllers to not use the datastore, but the testdata json file that is loaded by the testimage.bbclass. This way the tests can still be exported to be ran outside bitbake. The kwargs and logger is still passed in the constructor and there maybe some redundancies between the kwargs and the td test datstore, but this is not addressed in this commit.

In masterimage.py there was a duplicate SystemdbootTarget which was removed. It is my opinion that all targets should go to meta-yocto-bsp or meta/ and should not get special treatment whether they come from poky or other layer.

There was a functionality that was lost in masterimage about retrieving a fresh BB_ORIGENV. The test data json file does not store this, so the build-time enviromental variables cannot be retrieved later on, when running the tests.

The deploy() method invocation of the test cases was removed in the refactoring and this commit re-adds it in the same logical place. The deploy method was added as an abstract method so that all Test controller classes have this method. This method had been lost and was not used in the simpleremote and qemuwrapper, because these controllers do not need the functionality, but almost any real board requires certain steps to deploy the new images, before the tests can be ran. An example of this need was visible in the master image and subclasses in meta-yocto-bsp.

A dependency on images fstypes of qemu was removed from testimage. The allowed file system types were not relevant for other controllers, and made it so that there was an import of the OEQemuTarget python class applicable to all possible controllers, including non qemu.

The manual was changed wherever I saw it was appropriate but, some improvements may still be needed.

The SimpleRemoteTarget, OEQemuTarget and a custom controller, developed according to the manual were successfully tested.

---
 .../dev-manual/dev-manual-common-tasks.xml         |   8 +-
 documentation/ref-manual/ref-variables.xml         |  19 +---
 .../lib/oeqa/controllers/beaglebonetarget.py       |   6 +-
 .../lib/oeqa/controllers/edgeroutertarget.py       |   6 +-
 meta-yocto-bsp/lib/oeqa/controllers/grubtarget.py  |   4 +-
 meta/classes/testimage.bbclass                     |  18 +---
 meta/lib/oeqa/controllers/masterimage.py           | 107 ++++++---------------
 .../target/qemu.py => controllers/qemutarget.py}   |  30 ++++--
 meta/lib/oeqa/controllers/simpleremote.py          |  33 +++++++
 .../target/ssh.py => controllers/sshtarget.py}     |   9 +-
 meta/lib/oeqa/core/target/__init__.py              |   4 +
 meta/lib/oeqa/runtime/context.py                   |  32 +-----
 meta/lib/oeqa/targetcontrol.py                     |  97 ++++++-------------
 13 files changed, 153 insertions(+), 220 deletions(-)
 rename meta/lib/oeqa/{core/target/qemu.py => controllers/qemutarget.py} (58%)
 create mode 100644 meta/lib/oeqa/controllers/simpleremote.py
 rename meta/lib/oeqa/{core/target/ssh.py => controllers/sshtarget.py} (98%)
documentation/dev-manual/dev-manual-common-tasks.xml +4 -4
index fe1bfba..95aa533 100644
@@ -11400,7 +11400,7 @@
                             within a separately started QEMU or any
                             other virtual machine manager.
                             </para></listitem>
-                        <listitem><para><emphasis>"Systemd-bootTarget":</emphasis>
+                        <listitem><para><emphasis>"SystemdbootTarget":</emphasis>
                             Choose "Systemd-bootTarget" if your hardware is
                             an EFI-based machine with
                             <filename>systemd-boot</filename> as bootloader and
@@ -11459,10 +11459,10 @@
             </section>
 
             <section id='selecting-systemd-boottarget'>
-                <title>Selecting Systemd-bootTarget</title>
+                <title>Selecting SystemdbootTarget</title>
 
                 <para>
-                    If you did not set <filename>TEST_TARGET</filename> to
+                    If you did not set <filename>TEST_TARG
                     "Systemd-bootTarget", then you do not need any information
                     in this section.
                     You can skip down to the
@@ -11472,7 +11472,7 @@
 
                 <para>
                     If you did set <filename>TEST_TARGET</filename> to
-                    "Systemd-bootTarget", you also need to perform a one-time
+                    "SystemdbootTarget", you also need to perform a one-time
                     setup of your master image by doing the following:
                     <orderedlist>
                         <listitem><para><emphasis>Set <filename>EFI_PROVIDER</filename>:</emphasis>
documentation/ref-manual/ref-variables.xml +4 -15
index 1c55a92..15dcca7 100644
@@ -15128,35 +15128,24 @@ recipes-graphics/xorg-font/font-alias_1.0.3.bb:PR = "${INC_PR}.3"
                     You can provide the following arguments with
                     <filename>TEST_TARGET</filename>:
                     <itemizedlist>
-                        <listitem><para><emphasis>"qemu" and "QemuTarget":</emphasis>
+                        <listitem><para><emphasis>"QemuTarget":</emphasis>
                             Boots a QEMU image and runs the tests.
                             See the
                             "<ulink url='&YOCTO_DOCS_DEV_URL;#qemu-image-enabling-tests'>Enabling Runtime Tests on QEMU</ulink>"
                             section in the Yocto Project Development Tasks
                             Manual for more information.
                             </para></listitem>
-                        <listitem><para><emphasis>"simpleremote" and "SimpleRemoteTarget":</emphasis>
+                        <listitem><para><emphasis>"SimpleRemoteTarget":</emphasis>
                             Runs the tests on target hardware that is already
                             up and running.
                             The hardware can be on the network or it can be
                             a device running an image on QEMU.
                             You must also set
                             <link linkend='var-TEST_TARGET_IP'><filename>TEST_TARGET_IP</filename></link>
-                            when you use "simpleremote" or "SimpleRemoteTarget".
+                            when you use "SimpleRemoteTarget".
                             <note>
                                 This argument is defined in
-                                <filename>meta/lib/oeqa/targetcontrol.py</filename>.
-                                The small caps names are kept for compatibility
-                                reasons.
-                            </note>
-                            </para></listitem>
-                        <listitem><para><emphasis>"GummibootTarget":</emphasis>
-                            Automatically deploys and runs tests on an
-                            EFI-enabled machine that has a master image
-                            installed.
-                            <note>
-                                This argument is defined in
-                                <filename>meta/lib/oeqa/controllers/masterimage.py</filename>.
+                                <filename>meta/lib/oeqa/controllers/simpleremote.py</filename>.
                             </note>
                             </para></listitem>
                     </itemizedlist>
meta-yocto-bsp/lib/oeqa/controllers/beaglebonetarget.py +3 -3
index 0f1aeb3..440a8f8 100644
@@ -36,10 +36,10 @@ class BeagleBoneTarget(MasterImageHardwareTarget):
     def get_extra_files(self):
         return list(self.dtbs.keys())
 
-    def __init__(self, d):
-        super(BeagleBoneTarget, self).__init__(d)
+    def __init__(self, td, logger, **kwargs):
+        super(BeagleBoneTarget, self).__init__(td, logger, **kwargs)
 
-        self.image_fstype = self.get_image_fstype(d)
+        self.image_fstype = self.get_image_fstype(td)
         self.deploy_cmds = [
                 'mkdir -p /mnt/testrootfs',
                 'mount -L testrootfs /mnt/testrootfs',
meta-yocto-bsp/lib/oeqa/controllers/edgeroutertarget.py +3 -3
index 9c47b5b..3c5484c 100644
@@ -41,10 +41,10 @@ from oeqa.controllers.masterimage import MasterImageHardwareTarget
 
 class EdgeRouterTarget(MasterImageHardwareTarget):
 
-    def __init__(self, d):
-        super(EdgeRouterTarget, self).__init__(d)
+    def __init__(self, td, logger, **kwargs):
+        super(EdgeRouterTarget, self).__init__(td, logger, **kwargs)
 
-        self.image_fstype = self.get_image_fstype(d)
+        self.image_fstype = self.get_image_fstype(td)
         self.deploy_cmds = [
                 'mount -L boot /boot',
                 'mkdir -p /mnt/testrootfs',
meta-yocto-bsp/lib/oeqa/controllers/grubtarget.py +2 -2
index 7bc807d..941c31f 100644
@@ -24,8 +24,8 @@ from oeqa.controllers.masterimage import MasterImageHardwareTarget
 
 class GrubTarget(MasterImageHardwareTarget):
 
-    def __init__(self, d):
-        super(GrubTarget, self).__init__(d)
+    def __init__(self, td, logger, **kwargs):
+        super(GrubTarget, self).__init__(td, logger, **kwargs)
         self.deploy_cmds = [
                 'mount -L boot /boot',
                 'mkdir -p /mnt/testrootfs',
meta/classes/testimage.bbclass +3 -15
index 9feb267..1b33f72 100644
@@ -70,7 +70,7 @@ DEFAULT_TEST_SUITES_remove_qemumips64 = "${MIPSREMOVE}"
 TEST_SUITES ?= "${DEFAULT_TEST_SUITES}"
 
 TEST_QEMUBOOT_TIMEOUT ?= "1000"
-TEST_TARGET ?= "qemu"
+TEST_TARGET ?= "OEQemuTarget"
 
 TESTIMAGEDEPENDS = ""
 TESTIMAGEDEPENDS_qemuall = "qemu-native:do_populate_sysroot qemu-helper-native:do_populate_sysroot qemu-helper-native:do_addto_recipe_sysroot"
@@ -142,7 +142,6 @@ def testimage_main(d):
     from oeqa.core.utils.misc import updateTestData
     from oeqa.runtime.context import OERuntimeTestContext
     from oeqa.runtime.context import OERuntimeTestContextExecutor
-    from oeqa.core.target.qemu import supported_fstypes
     from oeqa.core.utils.test import getSuiteCases
     from oeqa.utils import make_logger_bitbake_compatible
 
@@ -184,15 +183,6 @@ def testimage_main(d):
     # Get machine
     machine = d.getVar("MACHINE")
 
-    # Get rootfs
-    fstypes = [fs for fs in d.getVar('IMAGE_FSTYPES').split(' ')
-                  if fs in supported_fstypes]
-    if not fstypes:
-        bb.fatal('Unsupported image type built. Add a comptible image to '
-                 'IMAGE_FSTYPES. Supported types: %s' %
-                 ', '.join(supported_fstypes))
-    rootfs = '%s.%s' % (image_name, fstypes[0])
-
     # Get tmpdir (not really used, just for compatibility)
     tmpdir = d.getVar("TMPDIR")
 
@@ -225,7 +215,6 @@ def testimage_main(d):
     # TODO: We use the current implementatin of qemu runner because of
     # time constrains, qemu runner really needs a refactor too.
     target_kwargs = { 'machine'     : machine,
-                      'rootfs'      : rootfs,
                       'tmpdir'      : tmpdir,
                       'dir_image'   : dir_image,
                       'display'     : display,
@@ -248,9 +237,7 @@ def testimage_main(d):
         d.getVar("TESTIMAGE_DUMP_DIR"))
 
     # the robot dance
-    target = OERuntimeTestContextExecutor.getTarget(
-        d.getVar("TEST_TARGET"), logger, d.getVar("TEST_TARGET_IP"),
-        d.getVar("TEST_SERVER_IP"), **target_kwargs)
+    target = OERuntimeTestContextExecutor.getTarget(d.getVar("TEST_TARGET"), td, logger, **target_kwargs)
 
     # test context
     tc = OERuntimeTestContext(td, logger, target, host_dumper,
@@ -277,6 +264,7 @@ def testimage_main(d):
         # Add systemd.log_level=debug to enable systemd debug logging
         bootparams = 'systemd.log_target=console'
 
+    tc.target.deploy()
     results = None
     orig_sigterm_handler = signal.signal(signal.SIGTERM, sigterm_exception)
     try:
meta/lib/oeqa/controllers/masterimage.py +32 -75

148 lines not on this page · raw message

meta/lib/oeqa/controllers/qemutarget.py renamed from meta/lib/oeqa/core/target/qemu.py +23 -7
similarity index 58%
rename from meta/lib/oeqa/core/target/qemu.py
rename to meta/lib/oeqa/controllers/qemutarget.py
index bf3b633..a867dfb 100644
@@ -6,24 +6,37 @@ import sys
 import signal
 import time
 
-from .ssh import OESSHTarget
+from oeqa.controllers.sshtarget import OESSHTarget
 from oeqa.utils.qemurunner import QemuRunner
 
-supported_fstypes = ['ext3', 'ext4', 'cpio.gz', 'wic']
 
 class OEQemuTarget(OESSHTarget):
-    def __init__(self, logger, ip, server_ip, timeout=300, user='root',
+    supported_fstypes = ['ext3', 'ext4', 'cpio.gz', 'wic']
+    def __init__(self, td, logger, timeout=300, user='root',
             port=None, machine='', rootfs='', kernel='', kvm=False,
             dump_dir='', dump_host_cmds='', display='', bootlog='',
             tmpdir='', dir_image='', boottime=60, **kwargs):
 
-        super(OEQemuTarget, self).__init__(logger, ip, server_ip, timeout,
-                user, port)
+        super(OEQemuTarget, self).__init__(td, logger, timeout, user, port)
 
-        self.ip = ip
-        self.server_ip = server_ip
+        self.ip = td['TEST_TARGET_IP']
+        self.server_ip = td['TEST_SERVER_IP']
         self.machine = machine
+
+
+        image_name = ("%s/%s" % (td['DEPLOY_DIR_IMAGE'], td['IMAGE_LINK_NAME']))
+
+        # Get rootfs
+        if not rootfs:
+            fstypes = [fs for fs in td['IMAGE_FSTYPES'].split(' ')
+                          if fs in self.supported_fstypes]
+            if not fstypes:
+                bb.fatal('Unsupported image type built. Add a comptible image to '
+                         'IMAGE_FSTYPES. Supported types: %s' %
+                         ', '.join(self.supported_fstypes))
+            rootfs = '%s.%s' % (image_name, fstypes[0])
         self.rootfs = rootfs
+
         self.kernel = kernel
         self.kvm = kvm
 
@@ -41,5 +54,8 @@ class OEQemuTarget(OESSHTarget):
             self.stop()
             raise RuntimeError("FAILED to start qemu - check the task log and the boot log")
 
+    def deploy(self):
+        pass
+
     def stop(self):
         self.runner.stop()
meta/lib/oeqa/controllers/simpleremote.py new file +33 -0
new file mode 100644
index 0000000..5f945d0
@@ -0,0 +1,33 @@
+from oeqa.targetcontrol import BaseTarget
+from oeqa.utils.sshcontrol import SSHControl
+
+class SimpleRemoteTarget(BaseTarget):
+
+    def __init__(self, td, logger, **kwargs):
+        super(SimpleRemoteTarget, self).__init__(td, logger, **kwargs)
+        addr = td['TEST_TARGET_IP'] or bb.fatal('Please set TEST_TARGET_IP with the IP address of the machine you want to run the tests on.')
+        self.ip = addr.split(":")[0]
+        try:
+            self.port = addr.split(":")[1]
+        except IndexError:
+            self.port = None
+        self.logger.info("Target IP: %s" % self.ip)
+        self.server_ip = td['TEST_SERVER_IP']
+        if not self.server_ip:
+            try:
+                self.server_ip = subprocess.check_output(['ip', 'route', 'get', self.ip ]).split("\n")[0].split()[-1]
+            except Exception as e:
+                bb.fatal("Failed to determine the host IP address (alternatively you can set TEST_SERVER_IP with the IP address of this machine): %s" % e)
+        self.logger.info("Server IP: %s" % self.server_ip)
+
+    def deploy(self):
+        super(SimpleRemoteTarget, self).deploy()
+
+    def start(self, params=None, ssh=True, extra_bootparams=None):
+        if ssh:
+            self.connection = SSHControl(self.ip, logfile=self.sshlog, port=self.port)
+
+    def stop(self):
+        self.connection = None
+        self.ip = None
+        self.server_ip = None
meta/lib/oeqa/controllers/sshtarget.py renamed from meta/lib/oeqa/core/target/ssh.py +5 -4
similarity index 98%
rename from meta/lib/oeqa/core/target/ssh.py
rename to meta/lib/oeqa/controllers/sshtarget.py
index 8ff1f6c..fd1c0b2 100644
@@ -8,10 +8,10 @@ import logging
 import subprocess
 import codecs
 
-from . import OETarget
+from oeqa.core.target import OETarget
 
 class OESSHTarget(OETarget):
-    def __init__(self, logger, ip, server_ip, timeout=300, user='root',
+    def __init__(self, td, logger, timeout=300, user='root',
                  port=None, **kwargs):
         if not logger:
             logger = logging.getLogger('target')
@@ -25,8 +25,9 @@ class OESSHTarget(OETarget):
             logger.addHandler(fileHandler)
 
         super(OESSHTarget, self).__init__(logger)
-        self.ip = ip
-        self.server_ip = server_ip
+        self.ip = td['TEST_TARGET_IP']
+        self.server_ip = td['TEST_SERVER_IP']
+
         self.timeout = timeout
         self.user = user
         ssh_options = [
meta/lib/oeqa/core/target/__init__.py +4 -0
index d2468bc..081a30e 100644
@@ -21,6 +21,10 @@ class OETarget(object):
         pass
 
     @abstractmethod
+    def deploy(self):
+        pass
+
+    @abstractmethod
     def copyTo(self, localSrc, remoteDst):
         pass
 
meta/lib/oeqa/runtime/context.py +5 -27
index a7f3823..b886435 100644
@@ -4,8 +4,6 @@
 import os
 
 from oeqa.core.context import OETestContext, OETestContextExecutor
-from oeqa.core.target.ssh import OESSHTarget
-from oeqa.core.target.qemu import OEQemuTarget
 from oeqa.utils.dump import HostDumper
 
 from oeqa.runtime.loader import OERuntimeTestLoader
@@ -89,32 +87,12 @@ class OERuntimeTestContextExecutor(OETestContextExecutor):
                 help="Qemu boot configuration, only needed when target_type is QEMU.")
 
     @staticmethod
-    def getTarget(target_type, logger, target_ip, server_ip, **kwargs):
+    def getTarget(target_type, td, logger, **kwargs):
         target = None
 
-        if target_ip:
-            target_ip_port = target_ip.split(':')
-            if len(target_ip_port) == 2:
-                target_ip = target_ip_port[0]
-                kwargs['port'] = target_ip_port[1]
-
-        if target_type == 'simpleremote':
-            target = OESSHTarget(logger, target_ip, server_ip, **kwargs)
-        elif target_type == 'qemu':
-            target = OEQemuTarget(logger, target_ip, server_ip, **kwargs)
-        else:
-            # XXX: This code uses the old naming convention for controllers and
-            # targets, the idea it is to leave just targets as the controller
-            # most of the time was just a wrapper.
-            # XXX: This code tries to import modules from lib/oeqa/controllers
-            # directory and treat them as controllers, it will less error prone
-            # to use introspection to load such modules.
-            # XXX: Don't base your targets on this code it will be refactored
-            # in the near future.
-            # Custom target module loading
-            target_modules_path = kwargs.get('target_modules_path', '')
-            controller = OERuntimeTestContextExecutor.getControllerModule(target_type, target_modules_path)
-            target = controller(logger, target_ip, server_ip, **kwargs)
+        target_modules_path = kwargs.get('target_modules_path', '')
+        controller = OERuntimeTestContextExecutor.getControllerModule(target_type, target_modules_path)
+        target = controller(td, logger, **kwargs)
 
         return target
 
@@ -176,7 +154,7 @@ class OERuntimeTestContextExecutor(OETestContextExecutor):
         try:
             obj = getattr(module, target)
         except:
-            obj = None
+            pass
         return obj
         
     @staticmethod
meta/lib/oeqa/targetcontrol.py +32 -65

157 lines not on this page · raw message

Signature · 1 line
2.7.4
#2 lore raw

PATCH 3/4 testimage: target.start exceptions not masked.

In reply to Paulo Neves

Previously the target.start exceptions were being masked by the catch clause of RuntimeError and BlockingIOError which are very broad. We decoupled the start method try clause from the runTests try clause which requires catching the BlockingIOError and RuntimeError.

---
 meta/classes/testimage.bbclass | 36 +++++++++++++++++++++---------------
 1 file changed, 21 insertions(+), 15 deletions(-)
meta/classes/testimage.bbclass +21 -15
index 1b33f72..8e42294 100644
@@ -264,24 +264,30 @@ def testimage_main(d):
         # Add systemd.log_level=debug to enable systemd debug logging
         bootparams = 'systemd.log_target=console'
 
+
     tc.target.deploy()
-    results = None
-    orig_sigterm_handler = signal.signal(signal.SIGTERM, sigterm_exception)
+
+    #We do not want the runTests to mask exeptions of target.start but we want a failed start
+    #to trigger a stop.
     try:
-        # We need to check if runqemu ends unexpectedly
-        # or if the worker send us a SIGTERM
-        tc.target.start(extra_bootparams=bootparams)
-        results = tc.runTests()
-    except (RuntimeError, BlockingIOError) as err:
-        if isinstance(err, RuntimeError):
-            bb.error('testimage received SIGTERM, shutting down...')
-        else:
-            bb.error('runqemu failed, shutting down...')
-        if results:
-            results.stop()
-            results = None
+        tc.target.start(extra_bootparams=bootparams) 
+        results = None
+        orig_sigterm_handler = signal.signal(signal.SIGTERM, sigterm_exception)
+        try:
+            # We need to check if runqemu ends unexpectedly
+            # or if the worker send us a SIGTERM
+            results = tc.runTests()
+        except (RuntimeError, BlockingIOError) as err:
+            if isinstance(err, RuntimeError):
+                bb.error('testimage received SIGTERM, shutting down...')
+            else:
+                bb.error('runqemu failed, shutting down...')
+            if results:
+                results.stop()
+                results = None
+        finally:
+            signal.signal(signal.SIGTERM, orig_sigterm_handler)
     finally:
-        signal.signal(signal.SIGTERM, orig_sigterm_handler)
         tc.target.stop()
 
     # Show results (if we have them)
Signature · 1 line
2.7.4
#3 lore raw

PATCH 4/4 masterimage: Check for rootfs path instead of file.

In reply to Paulo Neves

The rootfs might be a directory path or a file path. A case in point is if the test wants to deploy a rootfs directly by rsyncing it to the target or even use it as part of a tftp server.

---
 meta/lib/oeqa/controllers/masterimage.py | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
meta/lib/oeqa/controllers/masterimage.py +1 -5
index 26e3870..fb8ab50 100644
@@ -51,11 +51,7 @@ class MasterImageHardwareTarget(oeqa.targetcontrol.BaseTarget, metaclass=ABCMeta
         self.image_fstype = self.get_image_fstype(td)
         self.rootfs = os.path.join(td['DEPLOY_DIR_IMAGE'], td['IMAGE_LINK_NAME'] + '.' + self.image_fstype)
         self.kernel = os.path.join(td['DEPLOY_DIR_IMAGE'], td["KERNEL_IMAGETYPE"] + '-' + td['MACHINE'] + '.bin')
-        if not os.path.isfile(self.rootfs):
-            # we could've checked that IMAGE_FSTYPES contains tar.gz but the config for running testimage might not be
-            # the same as the config with which the image was build, ie
-            # you bitbake core-image-sato with IMAGE_FSTYPES += "tar.gz"
-            # and your autobuilder overwrites the config, adds the test bits and runs bitbake core-image-sato -c testimage
+        if not os.path.exists(self.rootfs):
             bb.fatal("No rootfs found. Did you build the image ?\n"  \
               "If yes, did you build it with IMAGE_FSTYPES += \"{}\" ?"  \
               "\nExpected path: {}".format(" ".join(self.supported_image_fstypes), self.rootfs))
Signature · 1 line
2.7.4
#4 lore raw

✗ patchtest: failure for "context.py: Do not mask except..." and 3 more

In reply to Paulo Neves

== Series Details ==

Series: "context.py: Do not mask except..." and 3 more
Revision: 1
URL : https://patchwork.openembedded.org/series/13387/
State : failure

== Summary ==

Thank you for submitting this patch series to OpenEmbedded Core. This is an automated response. Several tests have been executed on the proposed series by patchtest resulting in the following failures:

* Issue Series sent to the wrong mailing list or some patches from the series correspond to different mailing lists [test_target_mailing_list]

  Suggested fix    Send the series again to the correct mailing list (ML)
  Suggested ML     [email protected] [http://git.yoctoproject.org/cgit/cgit.cgi/yocto-docs/]
  Patch's path:    documentation/dev-manual/dev-manual-common-tasks.xml

* Issue Series does not apply on top of target branch [test_series_merge_on_head]
Suggested fix Rebase your series on top of targeted branch
Targeted branch master (currently at 1c4d9f46d5)

If you believe any of these test results are incorrect, please reply to the mailing list ([email protected]) raising your concerns. Otherwise we would appreciate you correcting the issues and submitting a new version of the patchset if applicable. Please ensure you add/increment the version number when sending the new version (i.e. [PATCH] -> [PATCH v2] -> [PATCH v3] -> ...).

---

Guidelines:     https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe