<?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>8307</bug_id>
          
          <creation_ts>2015-09-16 03:40:16 +0000</creation_ts>
          <short_desc>AttributeError: &apos;TestContext&apos; object has no attribute &apos;sigterm&apos;</short_desc>
          <delta_ts>2015-09-22 02:49:42 +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>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>NOTABUG</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>critical</bug_severity>
          <target_milestone>2.0</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="zjh">junhuix.zhang</reporter>
          <assigned_to name="Mariano Lopez">mariano.lopez</assigned_to>
          <cc>cathy.shen</cc>
    
    <cc>daniel.alexandrux.istrate</cc>
    
    <cc>daweix.wu</cc>
    
    <cc>mariano.lopez</cc>
    
    <cc>patrick.ohly</cc>
          
          <qa_contact name="Alexandru Georgescu">alexandru.c.georgescu</qa_contact>
          <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>54128</commentid>
    <comment_count>0</comment_count>
    <who name="zjh">junhuix.zhang</who>
    <bug_when>2015-09-16 03:40:16 +0000</bug_when>
    <thetext>Traceback (most recent call last):
  File &quot;/home/tester/Iot-auto/AFT/2015_09_16_09_50_52/galileo_sanity/iottest/oeqa/oetest.py&quot;, line 149, in setUp
    if self.tc.sigterm:
AttributeError: &apos;TestContext&apos; object has no attribute &apos;sigterm&apos;


Our test cases is run by an exported runner.
Maybe in setUp should judge self.tc has &apos;sigterm&apos; first,
Or sync this feature to runexported.py</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54130</commentid>
    <comment_count>1</comment_count>
    <who name="Cathy Shen">cathy.shen</who>
    <bug_when>2015-09-16 06:38:08 +0000</bug_when>
    <thetext>Impact both QA and CI testing, pls. prioritize.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54277</commentid>
    <comment_count>2</comment_count>
    <who name="Mariano Lopez">mariano.lopez</who>
    <bug_when>2015-09-18 14:46:57 +0000</bug_when>
    <thetext>Adding the SIGTERM handler broke the (the already broken) exported test feature. The problem right now with exported test is that has been broken for months and is not easy to test changes against it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54278</commentid>
    <comment_count>3</comment_count>
    <who name="Mariano Lopez">mariano.lopez</who>
    <bug_when>2015-09-18 14:48:44 +0000</bug_when>
    <thetext>zjh, cathy,

If you have a working version of runexported tests, please consider to share it in the mailing list.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54304</commentid>
    <comment_count>4</comment_count>
    <who name="Mariano Lopez">mariano.lopez</who>
    <bug_when>2015-09-18 22:00:42 +0000</bug_when>
    <thetext>Send patch to the mailing list to fix the break introduced when handling the SIGTERM signal in testimage. You can find the patch here:

http://lists.openembedded.org/pipermail/openembedded-core/2015-September/110708.html

And the commit is also in poky contrib here:

http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=mariano/bug8307

I&apos;ve already checked and the sigterm var is handled fine when exporting the test, although running the exported test is still broken</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54343</commentid>
    <comment_count>5</comment_count>
    <who name="zjh">junhuix.zhang</who>
    <bug_when>2015-09-21 05:08:57 +0000</bug_when>
    <thetext>

(In reply to comment #3)
&gt; zjh, cathy,
&gt; 
&gt; If you have a working version of runexported tests, please consider to share
&gt; it in the mailing list.

We didn&apos;t use the original export feature of yocto, the original feature has missed bb package(since runtest.py had imported bb).
Most of our export features are from yocto, you can try it with these steps:

ssh://zjh@10.239.52.71/home/zjh/meta-qa
passwd: 123456
1. add this layer to your poky: 
    cd [path to your poky]; git clone ssh://zjh@10.239.52.71/home/zjh/meta-qa; vi build/conf/bblayers.conf
2. add thease info to your build/conf/local.conf:
INHERIT += &quot;test-iot&quot;
TEST_EXPORT_DIR = &quot;iottest&quot;
TEST_TARGET = &quot;simpleremote&quot;
TEST_TARGET_IP = &quot;192.168.7.2&quot;
TEST_SERVER_IP = &quot;192.168.7.1&quot;
TEST_SUITES_MANIFEST = &quot;[path to your poky]/meta-qa/conf/test/iottest.manifest&quot;

3. bitbake core-image-sato, this step will build hello and hello-host
4. start your qemu
5. use another terminal to run test suite: bitbake core-image-sato -c test_iot
6. export testsuite: bitbake core-image-sato -c test_iot_export
7. run exported test suite: cd tmp/deploy/testsuite; tar xf  iot-testsuite.tar.gz; tar xf iot-testfiles.qemux86 .tar.gz -C iottest; cd iottest; python runtest.py -m qemux86 -t 192.168.7.2</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54344</commentid>
    <comment_count>6</comment_count>
    <who name="zjh">junhuix.zhang</who>
    <bug_when>2015-09-21 05:11:27 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; Send patch to the mailing list to fix the break introduced when handling the
&gt; SIGTERM signal in testimage. You can find the patch here:
&gt; 
&gt; http://lists.openembedded.org/pipermail/openembedded-core/2015-September/
&gt; 110708.html
&gt; 
&gt; And the commit is also in poky contrib here:
&gt; 
&gt; http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=mariano/bug8307
&gt; 
&gt; I&apos;ve already checked and the sigterm var is handled fine when exporting the
&gt; test, although running the exported test is still broken

If you follow my steps from my previous comment, you will find this issue is still exist after apply your patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54345</commentid>
    <comment_count>7</comment_count>
    <who name="zjh">junhuix.zhang</who>
    <bug_when>2015-09-21 05:13:14 +0000</bug_when>
    <thetext>(In reply to comment #5)
&gt; 
&gt; (In reply to comment #3)
&gt; &gt; zjh, cathy,
&gt; &gt; 
&gt; &gt; If you have a working version of runexported tests, please consider to share
&gt; &gt; it in the mailing list.
&gt; 
&gt; We didn&apos;t use the original export feature of yocto, the original feature has
&gt; missed bb package(since runtest.py had imported bb).
&gt; Most of our export features are from yocto, you can try it with these steps:
&gt; 
&gt; ssh://zjh@10.239.52.71/home/zjh/meta-qa
&gt; passwd: 123456
&gt; 1. add this layer to your poky: 
&gt;     cd [path to your poky]; git clone
&gt; ssh://zjh@10.239.52.71/home/zjh/meta-qa; vi build/conf/bblayers.conf
&gt; 2. add thease info to your build/conf/local.conf:
&gt; INHERIT += &quot;test-iot&quot;
&gt; TEST_EXPORT_DIR = &quot;iottest&quot;
&gt; TEST_TARGET = &quot;simpleremote&quot;
&gt; TEST_TARGET_IP = &quot;192.168.7.2&quot;
&gt; TEST_SERVER_IP = &quot;192.168.7.1&quot;
&gt; TEST_SUITES_MANIFEST = &quot;[path to your
&gt; poky]/meta-qa/conf/test/iottest.manifest&quot;
&gt; 
&gt; 3. bitbake core-image-sato, this step will build hello and hello-host
&gt; 4. start your qemu
&gt; 5. use another terminal to run test suite: bitbake core-image-sato -c
&gt; test_iot
&gt; 6. export testsuite: bitbake core-image-sato -c test_iot_export
&gt; 7. run exported test suite: cd tmp/deploy/testsuite; tar xf 
&gt; iot-testsuite.tar.gz; tar xf iot-testfiles.qemux86 .tar.gz -C iottest; cd
&gt; iottest; python runtest.py -m qemux86 -t 192.168.7.2

step 5 is not necessary in this case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54410</commentid>
    <comment_count>8</comment_count>
    <who name="Mariano Lopez">mariano.lopez</who>
    <bug_when>2015-09-21 20:42:10 +0000</bug_when>
    <thetext>I was able to reproduce the problem. The issue is within meta-qa on runtest.py.

You are using runtest instead of runexported; in runtest you recreate testContext by hand (d and target) but in runexported the object data is stored in a JSON file and read from there.

Also the host_dumper object is never recreated in runtest, so if at some point a test needs it you&apos;ll have another issue.

What I would recommend is to recreate the missing objects or attributes in runtest using the exported JSON produced by testimage, otherwise if we keep adding functionality to the testimage class you would experience more errors.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54413</commentid>
    <comment_count>9</comment_count>
    <who name="zjh">junhuix.zhang</who>
    <bug_when>2015-09-22 02:27:38 +0000</bug_when>
    <thetext>Yes, you are right. I have tried this in runexport.py(need add poky/bitbake/lib to sys.path first in runexport.py). Didn&apos;t find this issue.
We were trying to keep the test suite is independent before. So we removed some feature from runexport.py.
Anyway, this is not a upstream bug. Thanks for your clarification. We will change our scripts to keep sync up with upstream.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54414</commentid>
    <comment_count>10</comment_count>
    <who name="Cathy Shen">cathy.shen</who>
    <bug_when>2015-09-22 02:49:42 +0000</bug_when>
    <thetext>Thanks, close this ticket.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>