<?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>12842</bug_id>
          
          <creation_ts>2018-07-03 04:53:42 +0000</creation_ts>
          <short_desc>TEST_TARGET = &quot;SimpleRemoteTarget&quot; doesn&apos;t work</short_desc>
          <delta_ts>2020-03-31 04:50:02 +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>0.0.0</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>Future</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Paul Eggleton">bluelightning</reporter>
          <assigned_to name="yeoh ee peng">ee.peng.yeoh</assigned_to>
          <cc>akuster</cc>
    
    <cc>ee.peng.yeoh</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>Regression (Used to work)</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>81004</commentid>
    <comment_count>0</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2018-07-03 04:53:42 +0000</bug_when>
    <thetext>It seems that in the oeqa refactoring, setting TEST_TARGET = &quot;SimpleRemoteTarget&quot; results in the following error:

-------------- snip --------------
ERROR: core-image-minimal-1.0-r0 do_testimage: Error executing a python function in exec_python_func() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
File: &apos;exec_python_func() autogenerated&apos;, lineno: 2, function: &lt;module&gt;
[... trimmed huge backtrace ...]
File: &apos;/data/poky/meta/lib/oeqa/runtime/context.py&apos;, lineno: 169, function: _loadControllerFromName
     0165:        for name in modulenames:
     0166:            obj = OERuntimeTestContextExecutor._loadControllerFromModule(target, name)
     0167:            if obj:
     0168:                return obj
 *** 0169:        raise AttributeError(&quot;Unable to load {0} from available modules: {1}&quot;.format(target, str(modulenames)))
     0170:
     0171:    # Search for and return a controller or None from given module name
     0172:    @staticmethod
     0173:    def _loadControllerFromModule(target, modulename):
Exception: AttributeError: Unable to load SimpleRemoteTarget from available modules: [&apos;oeqa.controllers.masterimage&apos;, &apos;oeqa.controllers.testtargetloader&apos;, &apos;oeqa.controllers.beaglebonetarget&apos;, &apos;oeqa.controllers.edgeroutertarget&apos;, &apos;oeqa.controllers.grubtarget&apos;]
-------------- snip --------------

I found it wasn&apos;t even looking at targetcontrol.py where SimpleRemoteTarget is defined; I tried adding controllerslist.append(&apos;oeqa.targetcontrol&apos;) to the end of _getControllerModulenames() in meta/lib/oeqa/runtime/context.py however the old and new controller classes are not compatible so it still fails to initialise. As a workaround specifically for SimpleRemoteTarget I found you can use &quot;simpleremote&quot; instead though.

There are two main problems with all of this:

1) Our manuals (notably the reference manual) still talk about SimpleRemoteTarget and a bunch of other values as being valid, but at least SimpleRemoteTarget isn&apos;t anymore and I suspect it&apos;s not the only one. Either the code needs to be fixed so that these targets all work, or the documentation needs to be updated to remove *all* references to TEST_TARGET values that no longer work.

2) The error shown includes a huge backtrace and doesn&apos;t even describe what the valid values are - instead it tells you what modules it looked in. That might be useful for diagnostic purposes if you&apos;re prepared to dig into the code but it doesn&apos;t help the average user.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81646</commentid>
    <comment_count>1</comment_count>
    <who name="Apoorv">apoorv.sangal</who>
    <bug_when>2018-09-27 03:13:36 +0000</bug_when>
    <thetext>QemuTarget is used to start a qemu instance (as it&apos;s currently done in testimage.bbclass).
SimpleRemoteTarget is meant for a remote machine (by setting TEST_TARGET_IP) that&apos;s already up and running with network and ssh. It allows to select one implementation or another by setting TEST_TARGET (currently to: &quot;qemu&quot; and &quot;simpleremote&quot;).

Earlier, in poky (old version), when input (TEST_TARGET = &quot;simpleremote&quot;) is provided through local.conf file, then corresponding controller class implementation &quot;SimpleRemoteTarget&quot; got called. 
The &quot;SimpleRemoteTarget&quot; is class implementation for input &quot;simpleremote&quot;.

poky commit id: 17e3dc2cb5e7c060647a29a508d43a622ba53b80

+def get_target_controller(d):
+    if d.getVar(&quot;TEST_TARGET&quot;, True) == &quot;qemu&quot;:
+        return QemuTarget(d)
+    elif d.getVar(&quot;TEST_TARGET&quot;, True) == &quot;simpleremote&quot;:
+        return SimpleRemoteTarget(d)
+    else:
+        bb.fatal(&quot;Please set a valid TEST_TARGET&quot;)

Now, in latest poky release, this class &quot;SimpleRemoteTarget&quot; implementation has been replaced by class &quot;OESSHTarget&quot; (meta/lib/oeqa/core/target/ssh.py:class OESSHTarget(OETarget):)

file name : poky/meta/lib/oeqa/runtime/context.py

if target_type == &apos;simpleremote&apos;:
    target = OESSHTarget(logger, target_ip, server_ip, **kwargs)
elif target_type == &apos;qemu&apos;:
    target = OEQemuTarget(logger, target_ip, server_ip, **kwargs)
else:

This class &quot;SimpleRemoteTarget&quot;  is present in file ./meta/lib/oeqa/targetcontrol.py but its instance/object is not being created anywhere.

Based on the analysis, class &quot;SimpleRemoteTarget&quot; is obsolete now. So, we need to update the document.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85113</commentid>
    <comment_count>2</comment_count>
    <who name="yeoh ee peng">ee.peng.yeoh</who>
    <bug_when>2019-09-27 02:12:49 +0000</bug_when>
    <thetext>Based on git grep on master (commit: 81f9e815d36848761a9dfa94b00ad998bb39a4a6)

meta/classes/testexport.bbclass:TEST_TARGET ?= &quot;simpleremote&quot;
meta/classes/testimage.bbclass:TEST_TARGET ?= &quot;qemu&quot;
meta/classes/testimage.bbclass:    if (d.getVar(&apos;TEST_TARGET&apos;) == &apos;simpleremote&apos;
meta/classes/testimage.bbclass:    if d.getVar(&quot;TEST_TARGET&quot;) == &quot;qemu&quot;:

It was clear that TEST_TARGET = &quot;SimpleRemoteTarget&quot; was obsolete, it shall be replaced by TEST_TARGET = &quot;simpleremote&quot;.

We are contacting Scott Rifenbark for document update.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85114</commentid>
    <comment_count>3</comment_count>
    <who name="Armin Kuster">akuster</who>
    <bug_when>2019-09-27 02:34:16 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; Based on git grep on master (commit:
&gt; 81f9e815d36848761a9dfa94b00ad998bb39a4a6)
&gt; 
&gt; meta/classes/testexport.bbclass:TEST_TARGET ?= &quot;simpleremote&quot;
&gt; meta/classes/testimage.bbclass:TEST_TARGET ?= &quot;qemu&quot;
&gt; meta/classes/testimage.bbclass:    if (d.getVar(&apos;TEST_TARGET&apos;) ==
&gt; &apos;simpleremote&apos;
&gt; meta/classes/testimage.bbclass:    if d.getVar(&quot;TEST_TARGET&quot;) == &quot;qemu&quot;:
&gt; 
&gt; It was clear that TEST_TARGET = &quot;SimpleRemoteTarget&quot; was obsolete, it shall
&gt; be replaced by TEST_TARGET = &quot;simpleremote&quot;.
&gt; 
&gt; We are contacting Scott Rifenbark for document update.

Thank you for the information. 

We need to create a doc patch. I can help in that area if you don&apos;t want to send a patch. Scott is out for a bit.  Let me know how you want to proceed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85181</commentid>
    <comment_count>4</comment_count>
    <who name="yeoh ee peng">ee.peng.yeoh</who>
    <bug_when>2019-10-03 09:38:06 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; (In reply to comment #2)
&gt; &gt; Based on git grep on master (commit:
&gt; &gt; 81f9e815d36848761a9dfa94b00ad998bb39a4a6)
&gt; &gt; 
&gt; &gt; meta/classes/testexport.bbclass:TEST_TARGET ?= &quot;simpleremote&quot;
&gt; &gt; meta/classes/testimage.bbclass:TEST_TARGET ?= &quot;qemu&quot;
&gt; &gt; meta/classes/testimage.bbclass:    if (d.getVar(&apos;TEST_TARGET&apos;) ==
&gt; &gt; &apos;simpleremote&apos;
&gt; &gt; meta/classes/testimage.bbclass:    if d.getVar(&quot;TEST_TARGET&quot;) == &quot;qemu&quot;:
&gt; &gt; 
&gt; &gt; It was clear that TEST_TARGET = &quot;SimpleRemoteTarget&quot; was obsolete, it shall
&gt; &gt; be replaced by TEST_TARGET = &quot;simpleremote&quot;.
&gt; &gt; 
&gt; &gt; We are contacting Scott Rifenbark for document update.
&gt; 
&gt; Thank you for the information. 
&gt; 
&gt; We need to create a doc patch. I can help in that area if you don&apos;t want to
&gt; send a patch. Scott is out for a bit.  Let me know how you want to proceed.

I am new to yocto document patch. 
I found http://git.yoctoproject.org/cgit/cgit.cgi/yocto-docs/ this repository, I am guessing that I shall make the changes to mega-manual and create a patch. 
May I know which mailing list to send the doc patch? Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86876</commentid>
    <comment_count>5</comment_count>
    <who name="yeoh ee peng">ee.peng.yeoh</who>
    <bug_when>2020-03-31 04:50:02 +0000</bug_when>
    <thetext>Document patches sent to mailing list.
https://lists.yoctoproject.org/g/docs/message/124
https://lists.yoctoproject.org/g/docs/message/125
https://lists.yoctoproject.org/g/docs/message/126
https://lists.yoctoproject.org/g/docs/message/127</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>