<?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>4114</bug_id>
          
          <creation_ts>2013-03-26 15:44:11 +0000</creation_ts>
          <short_desc>Add ptest integration</short_desc>
          <delta_ts>2014-09-29 13:09:04 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>10</classification_id>
          <classification>QA/Testing</classification>
          <product>Test Plans/Suite</product>
          <component>test-plans/suite</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>High</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>1.7 M3</target_milestone>
          
          <blocked>4680</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Björn Stenberg">bjst</reporter>
          <assigned_to name="Lucian Musat">georgex.l.musat</assigned_to>
          <cc>alexandru.c.georgescu</cc>
    
    <cc>atul.singh008</cc>
    
    <cc>bluelightning</cc>
    
    <cc>corneliux.stoicescu</cc>
    
    <cc>elizabeth.flanagan</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>sgw</cc>
    
    <cc>sstncr</cc>
          
          <qa_contact name="Andra Necula">andrax.g.necula</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>31173</commentid>
    <comment_count>0</comment_count>
    <who name="Björn Stenberg">bjst</who>
    <bug_when>2013-03-26 15:44:11 +0000</bug_when>
    <thetext>Ptests should be ran, and results interpreted, as part of automatic testing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>32723</commentid>
    <comment_count>1</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2013-04-29 15:29:05 +0000</bug_when>
    <thetext>From Richard&apos;s recent comments, this would need us to:

* Enable ptest to run from the qemuimagetests

* Find a way to collect up the ptest results (log into buildhistory so we can compare tests results to previous runs?). Important detail is when test results which did pass start failing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>32941</commentid>
    <comment_count>2</comment_count>
    <who name="Stefan Stanacar">sstncr</who>
    <bug_when>2013-05-08 09:24:25 +0000</bug_when>
    <thetext>I&apos;ll take  shot at this.
I&apos;ve started something here: http://git.yoctoproject.org/cgit.cgi/poky-contrib/?h=stefans%2Fqemu-ptest1
specifically the first part: enable ptest to run from the qemuimagetests

I&apos;ve tested a core-image-sato with the following in local.conf:

DISTRO_FEATURES_append = &quot; ptest&quot;
IMAGE_FEATURES_append = &quot; ptest-pkgs tools-sdk&quot;
IMAGE_INSTALL_append = &quot; ptest-runner dbus bash glib-2.0&quot;
IMAGETEST = &quot;qemu&quot;
TEST_SCEN = &quot;standalone:ptest&quot;

I have some issues:
 - running ptest takes a long time, right know I&apos;ve used 850 seconds as a timeout but that&apos;s not enough. I want to add support in qemuimagetest for passing arguments to runqemu (arguments like kvm and qemuparams=&quot;-m 1024&quot;), and that should help.
 - there are tests which fail and are known to fail - how to exclude them.
 - I have no idea on how to integrate the results in buildhistory from qemutests. Help?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>32942</commentid>
    <comment_count>3</comment_count>
    <who name="Björn Stenberg">bjst</who>
    <bug_when>2013-05-08 09:48:55 +0000</bug_when>
    <thetext>Yes, ptests can take a very long time. And obviously the time varies for different targets too. In our system we use a timeout per line instead of per command, so that as long as the tests produce output they don&apos;t time out.

The ptests recipes in dylan still have some bugs, causing more test failures than necessary (and possibly timeouts). I will submit patches for that shortly.

As for integrating with qemuimagetest, I don&apos;t know. We are using an expect script to boot and run all targets in buildbot, both qemu and hardware boards. We run this in autobuilder and parse the logs to extract results.

I think we should have a discussion about how to implement automatic testing in a way so it is easy for people to set up and run auto tests in their projects and on their hardware.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>33139</commentid>
    <comment_count>4</comment_count>
    <who name="Stefan Stanacar">sstncr</who>
    <bug_when>2013-05-17 15:09:20 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; Yes, ptests can take a very long time. And obviously the time varies for
&gt; different targets too. In our system we use a timeout per line instead of
&gt; per command, so that as long as the tests produce output they don&apos;t time out.
&gt; 

Hmm, this might be a good idea. I&apos;ll think about it.

&gt; The ptests recipes in dylan still have some bugs, causing more test failures
&gt; than necessary (and possibly timeouts). I will submit patches for that
&gt; shortly.
&gt; 

Ok, great.

&gt; As for integrating with qemuimagetest, I don&apos;t know. We are using an expect
&gt; script to boot and run all targets in buildbot, both qemu and hardware
&gt; boards. We run this in autobuilder and parse the logs to extract results.
&gt; 

The thing is we don&apos;t want to tie people to the autobuilder to run these tests. Some people might use other build systems (like jenkins). That&apos;s way we want the tests to be run as part of qemuimagetest. These way they can be fired off from a command line too. The bad thing is that doesn&apos;t integrate with real hardware.

After some changes to qemuimagetest went in master:
- we can now pass qemuparams=&quot;-m 1024&quot; and that helps a lot
- a timeout can be specified to Test_SSH now, before it was limited to 50 seconds.
That helped me with the long running part and timeouts.
Given that and the top 2 commits from http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=stefans/qemu-ptest2 now I can succesfully run a sato image and get the log file.
If the image it&apos;s built with INHERIT += &quot;buildhistory&quot; the ptest log will be copied in buildhistory dir. I&apos;m wondering if that&apos;s enough for tracking.

&gt; I think we should have a discussion about how to implement automatic testing
&gt; in a way so it is easy for people to set up and run auto tests in their
&gt; projects and on their hardware.

I think that will be great.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36678</commentid>
    <comment_count>5</comment_count>
    <who name="Stefan Stanacar">sstncr</who>
    <bug_when>2013-09-13 12:53:29 +0000</bug_when>
    <thetext>Unfortunately I don&apos;t think anything usable will make it in 1.5, so I&apos;m bumping the target milestone. 
Also, as the qemuimagetest is obsolete by testimage.bbclass, I&apos;ve make an attempt at a skeleton implementation here: 
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=stefans/run-ptest1&amp;id=b9e86394684f2c3809b3539cbe6b67e28e4d96cf

It just runs ptest-runner and copies the log to buildhistory dir but it doesn&apos;t do any &quot;check&quot; of the results.
The good part is that testimage already had support for restart the target with more memory (but now qemu have 256 by default so it&apos;s okay) and for setting longer or no timeouts. And if testimage will know about real hardware this will just work. (either from an AB setup or  fired off from command line).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45486</commentid>
    <comment_count>6</comment_count>
    <who name="Lucian Musat">georgex.l.musat</who>
    <bug_when>2014-09-09 10:41:12 +0000</bug_when>
    <thetext>Ptest runtime test has been developed and it&apos;s waiting review</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45674</commentid>
    <comment_count>7</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2014-09-18 14:54:35 +0000</bug_when>
    <thetext>Code merged to master http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=7c16a538bc57116b87cf1912e7f4a460b38e015c</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45937</commentid>
    <comment_count>8</comment_count>
    <who name="Andra Necula">andrax.g.necula</who>
    <bug_when>2014-09-29 13:09:04 +0000</bug_when>
    <thetext>Verified on commit 8ac8eca2e3bd8c78e2b31ea974930ed0243258a3.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>