<?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>12597</bug_id>
          
          <creation_ts>2018-03-12 14:41:31 +0000</creation_ts>
          <short_desc>ptest: UPDATE_ALTERNATIVES ignored</short_desc>
          <delta_ts>2019-04-24 03:26:35 +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>core</component>
          <version>2.5</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>normal</bug_severity>
          <target_milestone>4.99</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Juro Bystricky">juro.bystricky</reporter>
          <assigned_to name="Mariano Lopez">just.another.mariano</assigned_to>
          <cc>just.another.mariano</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>ross.burton</cc>
    
    <cc>stephano</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>79788</commentid>
    <comment_count>0</comment_count>
    <who name="Juro Bystricky">juro.bystricky</who>
    <bug_when>2018-03-12 14:41:31 +0000</bug_when>
    <thetext>The purpose of ptest is to test a cross-compiled package on a target platform.
Due to UPDATE_ALTERNATIVES, sometimes we end up testing utilities belonging to another package (which may have a different ptest implemented). For example, a core-image-minimal has three different implementations of &quot;kill&quot;. Testing &quot;busybox&quot; will test &quot;kill&quot; as a part of the test suite. In my experience this will fail, as we may test &quot;kill&quot; provided by util-linux instead of the one provided by busybox. Alternatively, the test may pass (false positive) where the &quot;real&quot; busybox kill would have failed.

So, I believe all recipes with both ptest and UPDATE_ALTERNATIVES should be revisited and the corresponding run-ptest routines should be something like:

1. save current UPDATE_ALTERNATIVES as used by this package
2. set UPDATE_ALTERNATIVES to the ones provided by this package
3. do testing as before
4. restore the original UPDATE_ALTERNATIVES</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79830</commentid>
    <comment_count>1</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2018-03-15 08:06:27 +0000</bug_when>
    <thetext>Alternatively, change the test suite to call kill.busybox instead of kill?  Not sure what is less invasive.

Fiddling alternatives will mean the tests can&apos;t be parallelised but I suspect that on usual hardware that isn&apos;t a massive problem anyway.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83554</commentid>
    <comment_count>2</comment_count>
    <who name="Mariano Lopez">just.another.mariano</who>
    <bug_when>2019-04-16 03:43:43 +0000</bug_when>
    <thetext>Juro, Ross,

I have implemented this feature using symlinks to call the &quot;correct&quot; binaries that were modified by update-alternatives when the rootfs was generated.

The complete process is as follows:

1. Set PTEST_BINDIR to &quot;1&quot; in order to generate a bin directory within the ptest directory that will be created in the rootfs. This bin directory has symlinks to the binaries renamed by update-alternatives.
2. Modify the run-ptest script to include the generated bin directory as the first directory of PATH.
3. Execute the ptest using the new PATH.

You can check the patches here:

1. Change to the ptest class:
https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=6995ec65e8019dc6fdf96fc9d508ba600b4551d9

2. Change to the util-linux recipe/ptest script:
https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=db9a0dd7849edcfa1ae4b56d0c991997b850e913

I also changed busybox as Ross requested in the Mailing List:
https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=677bacd446247d9a83401a516352b214d384dfd3

Is there something else to be implemented as part of this bug?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83633</commentid>
    <comment_count>3</comment_count>
    <who name="Mariano Lopez">just.another.mariano</who>
    <bug_when>2019-04-24 03:26:35 +0000</bug_when>
    <thetext>I&apos;ll mark this as resolved and if there is something else to be added, we can reopen this bug.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>