<?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>7524</bug_id>
          
          <creation_ts>2015-03-26 19:26:22 +0000</creation_ts>
          <short_desc>oeqa: tests in additional layer not found</short_desc>
          <delta_ts>2015-09-03 09:25:23 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>devtools / tool chain</component>
          <version>1.7</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>30 April 2015: IN PROGRESS REVIEW</status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.9 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Patrick Ohly">patrick.ohly</reporter>
          <assigned_to name="Scott Rifenbark">srifenbark</assigned_to>
          <cc>bogdanx.a.voiculescu</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>srifenbark</cc>
          
          <qa_contact name="Bogdan Alexandru Voiculescu">bogdanx.a.voiculescu</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Done (doc changes complete)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>49821</commentid>
    <comment_count>0</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2015-03-26 19:26:22 +0000</bug_when>
    <thetext>I created the following dummy.py in meta-oe/lib/oeqa/runtime/dummy.py. meta-oe is in my bblayer.conf. My local.conf has:

INHERIT += &quot;testimage&quot;
TEST_SUITES=&quot;dummy&quot;

dummy.py:
-------------------
import unittest
from oeqa.oetest import oeRuntimeTest, skipModule
from oeqa.utils.decorators import *

class DummyTest(oeRuntimeTest):

    def test_dummy(self):
        pass
-------------------


According to the comments in the documentation and meta/lib/oeqa/runtime/__ini__.py, I would expect my test to be found.

But it fails:

&gt; bitbake -c testimage core-image-minimal 
...
NOTE: Executing RunQueue Tasks
ERROR: Loading tests failed:
Traceback (most recent call last):
  File &quot;testimage.bbclass&quot;, line 48, in testimage_main
  File &quot;/data2/yocto/iot-os/meta/lib/oeqa/oetest.py&quot;, line 29, in loadTests
    suite = testloader.loadTestsFromNames(tc.testslist)
  File &quot;/usr/lib64/python2.7/unittest/loader.py&quot;, line 130, in loadTestsFromNames
    suites = [self.loadTestsFromName(name, module) for name in names]
  File &quot;/usr/lib64/python2.7/unittest/loader.py&quot;, line 100, in loadTestsFromName
    parent, obj = obj, getattr(obj, part)
AttributeError: &apos;module&apos; object has no attribute &apos;dummy&apos;

It works once I move the file to meta/lib/oeqa/runtime.

I&apos;m using a not-quite-up-to-date master branch of OE-core (rev 5f74262cabb414a1a6000ab6b2d3ba2c92e2a7ff).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49869</commentid>
    <comment_count>1</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2015-03-27 14:40:44 +0000</bug_when>
    <thetext>strace -f shows that the source file of the test is read when located inside the additional layer. So the file search path is okay, it&apos;s just loading/running which somehow fails.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50130</commentid>
    <comment_count>2</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2015-04-07 16:53:48 +0000</bug_when>
    <thetext>I figured it out: the lib/oeqa/runtime directory of a layer must contain an __init__.py file. The file can be empty, but it must exist.

So this is a documentation bug after all, for http://www.yoctoproject.org/docs/1.7.1/dev-manual/dev-manual.html#qemu-image-writing-new-tests

I suggest to rephrase the last sentence of the first paragraph as &quot;Just remember that filenames need to map directly to test (module) names, that you do not use module names that collide with existing core tests, and that there must be at least an empty __init__.py file in the runtime directory.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50669</commentid>
    <comment_count>3</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2015-04-30 15:38:29 +0000</bug_when>
    <thetext>Hi, 

Checkout http://www.yoctoproject.org/docs/1.9/dev-manual/dev-manual.html#qemu-image-writing-new-tests for the changes.  Because the list was a bit long, I reformatted into a bulleted list.  

I have this in IN PROGRESS REVIEW now.  Let me know of any issues. 

Thanks,
Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51179</commentid>
    <comment_count>4</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2015-05-21 09:51:07 +0000</bug_when>
    <thetext>Looks good to me. Not sure whether that means that I should change the status to &quot;RESOLVED&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51195</commentid>
    <comment_count>5</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2015-05-21 13:52:45 +0000</bug_when>
    <thetext>Hi Patrick, 

Since you filed the bug and it was assigned to me and you approved the fix, I will set it to RESOLVED and mark the doc flag done.  QA will then move it from RESOLVED to VERIFIED. 

Thanks!
Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53661</commentid>
    <comment_count>6</comment_count>
    <who name="Bogdan Alexandru Voiculescu">bogdanx.a.voiculescu</who>
    <bug_when>2015-09-03 09:25:23 +0000</bug_when>
    <thetext>verified; documentation looks good.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>