<?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>11524</bug_id>
          
          <creation_ts>2017-05-18 08:14:01 +0000</creation_ts>
          <short_desc>Runtime testing using Systemd-bootTarget is not working</short_desc>
          <delta_ts>2018-01-17 05:24:45 +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>configuration</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>normal</bug_severity>
          <target_milestone>2.4.2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Erik Botö">erik.boto</reporter>
          <assigned_to name="Stephano Cetola">stephano</assigned_to>
          <cc>leonardo.sandoval.gonzalez</cc>
    
    <cc>randy.macleod</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>73316</commentid>
    <comment_count>0</comment_count>
    <who name="Erik Botö">erik.boto</who>
    <bug_when>2017-05-18 08:14:01 +0000</bug_when>
    <thetext>I&apos;ve tried to follow the documentation from http://www.yoctoproject.org/docs/2.2/dev-manual/dev-manual.html#performing-automated-runtime-testing in order to setup a Intel NUC with core-image-testmaster, and then use bitbake -c testimage core-image-sato in order to run the tests.

I didn&apos;t understand how to use the installer parts of core-image-testmaster-initrd, so I deployed it manually by setting up the partition scheme according to the docs and manually creating /etc/masterimage.

But when I then run &apos;bitbake -c testimage core-image-sato&apos; it fails with the following error:

core-image-sato-1.0-r0 do_testimage: core-image-sato - deploying image on target
ERROR: core-image-sato-1.0-r0 do_testimage: Failed deploying test image: Command &apos;[&apos;ssh&apos;, &apos;-l&apos;, &apos;root&apos;, &apos;-o&apos;, &apos;UserKnownHostsFile=/dev/null&apos;, &apos;-o&apos;, &apos;StrictHostKeyChecking=no&apos;, &apos;-o&apos;, &apos;LogLevel=ERROR&apos;, &apos;172.31.173.107&apos;, &apos;export PATH=/usr/sbin:/sbin:/usr/bin:/bin; cp ~/test-kernel /boot&apos;]&apos; returned non-zero exit status 1:
cp: cannot stat &apos;/home/root/test-kernel&apos;: No such file or directory

Looking at the core-image-testmaster instance I see that deploy step has managed to create some symlinks, but never actually copied the actual artifacts those symlinks points to:

lrwxrwxrwx 1 root root 80 May 18 05:57 test-kernel -&gt; bzImage--4.8.17+git0+bb6984f46b_9bcb4ea3fa-r0-intel-corei7-64-20170517060056.bin
lrwxrwxrwx 1 root root 60 May 18 05:57 test-rootfs.tar.gz -&gt; core-image-sato-intel-corei7-64-20170517133030.rootfs.tar.gz

Inspecting the code I found this definition of copy_to in lib/oeqa/utils/sshcontrol.py:

    def copy_to(self, localpath, remotepath):
        if os.path.islink(localpath):
            link = os.readlink(localpath)
            dst_dir, dst_base = os.path.split(remotepath)
            return self.run(&quot;cd %s; ln -s %s %s&quot; % (dst_dir, link, dst_base))
        else:
            command = self.scp + [localpath, &apos;%s@%s:%s&apos; % (self.user, self.ip, remotepath)]
            return self._internal_run(command, ignore_status=False)

Since the arguments passed to this is functions are symlinks (in my case tmp/deploy/images/intel-corei7-64/core-image-sato-intel-corei7-64.tar.gz which is a symlink to tmp/deploy/images/intel-corei7-64/core-image-sato-intel-corei7-64-20170517133030.rootfs.tar.gz) it just created a dead symlink instead of scp:ing the file. 

Why is this if/else needed? Does it matter that the input is a symlink? The scp command can still be executed with the symlink as input.

I would be happy to work on a patch if I can get in contact with someone who can review it so I don&apos;t miss the &quot;big picture&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73399</commentid>
    <comment_count>1</comment_count>
    <who name="Erik Botö">erik.boto</who>
    <bug_when>2017-05-22 06:02:51 +0000</bug_when>
    <thetext>Created a patch set on the mailing list for oe-core that addresses the issues I had when setting up automatic runtime tests:

http://lists.openembedded.org/pipermail/openembedded-core/2017-May/136912.html
http://lists.openembedded.org/pipermail/openembedded-core/2017-May/136913.html
http://lists.openembedded.org/pipermail/openembedded-core/2017-May/136914.html
http://lists.openembedded.org/pipermail/openembedded-core/2017-May/136915.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75325</commentid>
    <comment_count>2</comment_count>
    <who name="Stephano Cetola">stephano</who>
    <bug_when>2017-07-26 20:42:49 +0000</bug_when>
    <thetext>The patches have been submitted. I believe this is waiting on a sign off from some in QA to confirm that this fix is appropriate. I&apos;m not sure who that should be though. 

Adding Leo to CC. Let me know who can help with this one.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77208</commentid>
    <comment_count>3</comment_count>
    <who name="Stephano Cetola">stephano</who>
    <bug_when>2017-09-28 19:47:23 +0000</bug_when>
    <thetext>Sorry this got lost in the 2.4 shuffle. 

I spoke with Jair and Leo. They both think this patch is still relevant and that it looks good.

I&apos;ll resubmit this and CC the correct people so that it gets into 2.5M1.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78006</commentid>
    <comment_count>4</comment_count>
    <who name="Stephano Cetola">stephano</who>
    <bug_when>2017-11-06 22:51:33 +0000</bug_when>
    <thetext>https://patchwork.openembedded.org/patch/145458/
https://patchwork.openembedded.org/patch/145457/
https://patchwork.openembedded.org/patch/145460/
https://patchwork.openembedded.org/patch/145459/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78126</commentid>
    <comment_count>5</comment_count>
    <who name="Stephano Cetola">stephano</who>
    <bug_when>2017-11-09 16:50:34 +0000</bug_when>
    <thetext>This is now in oe-core:

a9c7f877e5bda32249755dc7014d436e4b85f07a
adfe79dee90b6e080b97869444882b84468d49ba
64614ab6894143fa4876558cbe3d2954e5b08eac
1eb2a9c2f48d3af13ce651f1adf024b3380299d1

Backporting to 2.4 now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78163</commentid>
    <comment_count>6</comment_count>
    <who name="Stephano Cetola">stephano</who>
    <bug_when>2017-11-12 17:33:08 +0000</bug_when>
    <thetext>https://patchwork.openembedded.org/series/9690/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79099</commentid>
    <comment_count>7</comment_count>
    <who name="Stephano Cetola">stephano</who>
    <bug_when>2018-01-17 05:24:29 +0000</bug_when>
    <thetext>Merged in the following commits:

a9d446d9c42a67109ae87a156ae43dcbb0f56e1e
4e376d0658fe8315cfcca927ea275e1260bcc02f
1871d61b75f2fbc0df1368960b7746371fd875f5
6f5c4a8e07f8cdf3f6352e9e85d7376937bb32d2</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>