<?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>11111</bug_id>
          
          <creation_ts>2017-02-28 09:43:06 +0000</creation_ts>
          <short_desc>enable running oe-selftest tests in CI</short_desc>
          <delta_ts>2017-04-10 19:22:08 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>6</classification_id>
          <classification>Yocto Project Subprojects</classification>
          <product>IoT Reference OS Kit</product>
          <component>intel-iot-refkit-tools</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>critical</bug_severity>
          <target_milestone>2.3 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Patrick Ohly">patrick.ohly</reporter>
          <assigned_to name="Olev Kartau">olev.kartau</assigned_to>
          <cc>anibal.limon</cc>
    
    <cc>benjamin.esquivel</cc>
    
    <cc>humberto.ibarra.lopez</cc>
    
    <cc>jair.de.jesus.gonzalez.plascencia</cc>
    
    <cc>mariano.lopez</cc>
    
    <cc>matti-pekka.sivosuo</cc>
    
    <cc>mikko.ylinen</cc>
    
    <cc>olev.kartau</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>70974</commentid>
    <comment_count>0</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2017-02-28 09:43:06 +0000</bug_when>
    <thetext>For testing complex boot scenarios (like TPM, image-installer, etc.) we need control over booting qemu. Such testing is easy in a test based on oe-selftest and impossible with testimage.bbclass based tests, so we need to extend the refkit CI so that it invokes oe-selftest with a certain list of tests.

It might be useful to have two sets:
* One which is used before building. If one of these tests fails, building can be skipped because there is a fatal flaw.
* One which is used after building, but only if building succeeded. These tests then can reuse build artifacts (like images) if they exist already.

The sstate test that we have falls into the first set, the (to be written) image tests into the second.

The sets could be defined in the CI .inc file.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70975</commentid>
    <comment_count>1</comment_count>
    <who name="Olev Kartau">olev.kartau</who>
    <bug_when>2017-02-28 10:20:42 +0000</bug_when>
    <thetext>refkit CI currently does not run
iotsstatetests.SStateTests.test_sstate_samesigs
before building.
Could it add any value running that test in refkit case?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70978</commentid>
    <comment_count>2</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2017-02-28 10:53:58 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; refkit CI currently does not run
&gt; iotsstatetests.SStateTests.test_sstate_samesigs
&gt; before building.
&gt; Could it add any value running that test in refkit case?

The test would need to be updated to reflect the current set of supported machines, but yes, in principle it might still be useful.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70981</commentid>
    <comment_count>3</comment_count>
    <who name="Olev Kartau">olev.kartau</who>
    <bug_when>2017-02-28 11:33:47 +0000</bug_when>
    <thetext>tried in refkit current master, takes 1min on a desktop machine.
Indeed, MACHINE set needs editing in
meta-refkit/lib/oeqa/selftest/iotsstatetests.py

Is the idea that we keep changing that file, or should 
we attempt defining machine set outside of code,
in some CI_ variables?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70982</commentid>
    <comment_count>4</comment_count>
    <who name="Olev Kartau">olev.kartau</who>
    <bug_when>2017-02-28 11:57:36 +0000</bug_when>
    <thetext>or another idea, can we modify samesigs test so that it takes
MACHINES as argument?
In refkit CI, machine set to build is defined in Jenkinsfile
so most convenient would be just run samesigs
giving MACHINES as argument, instead of parsing machines
from environment or strings defined in files etc.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70983</commentid>
    <comment_count>5</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2017-02-28 12:36:51 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; or another idea, can we modify samesigs test so that it takes
&gt; MACHINES as argument?

Yes, that would be useful. I also need to check whether improvements that I made to that test could go back to OE-core. I did something (better error reporting?) but without going back to the Ostro repo I am not sure what those were.

But enabling the mechanism for running oe-selftest is a bit orthogonal to actually enabling tests which use the mechanism. I&apos;m saying &quot;a bit&quot; because obviously some tests are needed for testing the mechanism ;-}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70984</commentid>
    <comment_count>6</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2017-02-28 15:26:40 +0000</bug_when>
    <thetext>Stephen, I think we need to keep this assigned to Olev. We need this enabled in the current Refkit CI scripts for Jenkins, and I believe Olev is still the one maintaining those.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71006</commentid>
    <comment_count>7</comment_count>
    <who name="Olev Kartau">olev.kartau</who>
    <bug_when>2017-03-01 08:51:57 +0000</bug_when>
    <thetext>Let&apos;s keep this ticket for enabling running additional tests in CI,
(both pre-build and after build),
and create a separate ticket about creating 
after-build, runnable-in-qemu, tests.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71007</commentid>
    <comment_count>8</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2017-03-01 09:15:53 +0000</bug_when>
    <thetext>The goal has always been to focus on &quot;enable oe-selftest tests&quot; (not writing them) and &quot;extend the refkit CI so that it invokes oe-selftest with a certain list of tests&quot;.

So yes, this issue here is about the CI system, not the tests using that functionality. Those were just mentioned to give a justification why such a capability in the CI system are needed, and why two slots are useful.

Also note that running tests works best when they use exactly the same build configuration as the build itself (better sstate reuse). This influences how to hook the tests into the CI system.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71104</commentid>
    <comment_count>9</comment_count>
    <who name="Olev Kartau">olev.kartau</who>
    <bug_when>2017-03-07 13:00:29 +0000</bug_when>
    <thetext>Refkit PR#53 has draft implementation of both pre-build and after-build selftest activation. You can check the last of 6 commits only for that, others are about Jenkinsfile refactoring, as I started to prepare for separate stage implementation for running test. Later, plan changed and test calls were inserted
into build script. Test names are taken from REFKIT_CI_ variables.
As pre-build, current sstate-samesigs test is used.
As post-build, there are no tests yet, I verified with samesigs test that step runs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71348</commentid>
    <comment_count>10</comment_count>
    <who name="Olev Kartau">olev.kartau</who>
    <bug_when>2017-03-16 10:59:47 +0000</bug_when>
    <thetext>PR#53 now reached a next checkpoint state, please check.
Per Mikko&apos;s idea, I moved BUILDHISTORY enablement from refkit-ci.inc
to build-project.sh which allows to simplify conf/auto.conf creation during oe-elftest.
pre- and post- tests are now as separate scripts and they will show as
separate CI build phases, to allow clear status reporting from stages.
Overall, this change also caused examination of other things
which leads to multiple commits with cleanup and re-structure.
for example, we were still running several CI-only-related steps in local build,
which is avoided in PR#53 current state of code.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71444</commentid>
    <comment_count>11</comment_count>
    <who name="Olev Kartau">olev.kartau</who>
    <bug_when>2017-03-20 08:21:27 +0000</bug_when>
    <thetext>PR#53 was merged, CI can now run oe-selftests, both pre- and post-build</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>