<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>12841</bug_id>
          
          <creation_ts>2018-07-03 03:19:40 +0000</creation_ts>
          <short_desc>Additional layer extending test breaks bitbake -c testimage</short_desc>
          <delta_ts>2019-06-06 15:17:31 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>10</classification_id>
          <classification>QA/Testing</classification>
          <product>Runtime Testing</product>
          <component>general</component>
          <version>5.99</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>MOVED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.7</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Paul Eggleton">bluelightning</reporter>
          <assigned_to name="Apoorv">apoorv.sangal</assigned_to>
          <cc>ee.peng.yeoh</cc>
    
    <cc>ross.burton</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>81003</commentid>
    <comment_count>0</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2018-07-03 03:19:40 +0000</bug_when>
    <thetext>If you add meta-security-smack to your configuration (inside the https://github.com/intel/meta-intel-iot-security repository) then add INHERIT += &quot;testimage&quot; to local.conf and then run bitbake -c testimage on a previously built image, you will get:

--------- snip ---------
ERROR: core-image-minimal-1.0-r0 do_testimage: Error executing a python function in exec_python_func() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
File: &apos;exec_python_func() autogenerated&apos;, lineno: 2, function: &lt;module&gt;
     0001:
 *** 0002:do_testimage(d)
     0003:
File: &apos;/data/poky/meta/classes/testimage.bbclass&apos;, lineno: 125, function: do_testimage
     0121:    netstat -an
     0122:}
     0123:
     0124:python do_testimage() {
 *** 0125:    testimage_main(d)
     0126:}
     0127:
     0128:addtask testimage
     0129:do_testimage[nostamp] = &quot;1&quot;
File: &apos;/data/poky/meta/classes/testimage.bbclass&apos;, lineno: 148, function: testimage_main
     0144:    import logging
     0145:
     0146:    from bb.utils import export_proxies
     0147:    from oeqa.core.utils.misc import updateTestData
 *** 0148:    from oeqa.runtime.context import OERuntimeTestContext
     0149:    from oeqa.runtime.context import OERuntimeTestContextExecutor
     0150:    from oeqa.core.target.qemu import supported_fstypes
     0151:    from oeqa.core.utils.test import getSuiteCases
     0152:    from oeqa.utils import make_logger_bitbake_compatible
Exception: ImportError: No module named &apos;oeqa.runtime.context&apos;

ERROR: core-image-minimal-1.0-r0 do_testimage: Function failed: do_testimage
ERROR: Logfile of failure stored in: /data/poky/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/temp/log.do_testimage.83960
ERROR: Task (/data/poky/meta/recipes-core/images/core-image-minimal.bb:do_testimage) failed with exit code &apos;1&apos;
--------- snip ---------

The issue is related to the fact that meta-security-smack is adding a few custom runtime tests. Interestingly, if you run the following within the poky repo then the issue goes away:

touch meta/lib/oeqa/__init__.py

It seems to me we probably ought to have this file there in OE-Core - I don&apos;t think meta-security-smack is doing something specific to trigger this that it shouldn&apos;t although I&apos;m not 100% sure.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81617</commentid>
    <comment_count>1</comment_count>
    <who name="Apoorv">apoorv.sangal</who>
    <bug_when>2018-09-25 14:08:05 +0000</bug_when>
    <thetext>this is due to changes made in commit id d9b3ee8b38f877c1723e48f1aa311c28102786fb. This would need further analaysis.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81641</commentid>
    <comment_count>2</comment_count>
    <who name="Apoorv">apoorv.sangal</who>
    <bug_when>2018-09-26 14:26:46 +0000</bug_when>
    <thetext>QemuTarget is used to start a qemu instance (as it&apos;s currently done in testimage.bbclass).
SimpleRemoteTarget is meant for a remote machine (by setting TEST_TARGET_IP) that&apos;s already up and running with network and ssh. It allows to select one implementation or another by setting TEST_TARGET (currently to: &quot;qemu&quot; and &quot;simpleremote&quot;).

Earlier,in poky (old version), when input (TAEST_TARGET = &quot;simpleremote&quot;) is provided through local.conf file, then corresponding controller class implemention &quot;SimpleRemoteTarget&quot; got called. 
The &quot;SimpleRemoteTarget&quot; is class implemention for input &quot;simpleremote&quot;.

poky commit id: 17e3dc2cb5e7c060647a29a508d43a622ba53b80

+def get_target_controller(d):
+    if d.getVar(&quot;TEST_TARGET&quot;, True) == &quot;qemu&quot;:
+        return QemuTarget(d)
+    elif d.getVar(&quot;TEST_TARGET&quot;, True) == &quot;simpleremote&quot;:
+        return SimpleRemoteTarget(d)
+    else:
+        bb.fatal(&quot;Please set a valid TEST_TARGET&quot;)

Now, in latest poky release, this class &quot;SimpleRemoteTarget&quot; implemention has been replaced by class &quot;OESSHTarget&quot; (meta/lib/oeqa/core/target/ssh.py:class OESSHTarget(OETarget):)

file name : poky/meta/lib/oeqa/runtime/context.py

if target_type == &apos;simpleremote&apos;:
    target = OESSHTarget(logger, target_ip, server_ip, **kwargs)
elif target_type == &apos;qemu&apos;:
    target = OEQemuTarget(logger, target_ip, server_ip, **kwargs)
else:

This class &quot;SimpleRemoteTarget&quot;  is present in file ./meta/lib/oeqa/targetcontrol.py but its instance/object is not being created anywhere.

Based on the analysis, class &quot;SimpleRemoteTarget&quot; is obsolete now. So, we need to update the document.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81645</commentid>
    <comment_count>3</comment_count>
    <who name="Apoorv">apoorv.sangal</who>
    <bug_when>2018-09-27 02:53:58 +0000</bug_when>
    <thetext>apologies..please discard my comment2, it was for bug id 12842.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84085</commentid>
    <comment_count>4</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2019-06-06 15:17:31 +0000</bug_when>
    <thetext>I believe the problem here is that meta-security-smack ships a __init__.py in its oeqa tree:

https://github.com/intel/meta-intel-iot-security/blob/master/meta-security-smack/lib/oeqa/runtime/__init__.py

This file should be deleted.

Moved to https://github.com/intel/meta-intel-iot-security/pull/142.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>