<?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>10889</bug_id>
          
          <creation_ts>2017-01-06 21:41:07 +0000</creation_ts>
          <short_desc>Zephyr kernel tests fail to start if python module pexpect is not installed</short_desc>
          <delta_ts>2017-01-24 21:51:44 +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>Other YP Layers</product>
          <component>meta-zephyr</component>
          <version>2.3</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>24 Jan 2017: RESOLVED</status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.3 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Henry Bruce">henry.bruce</reporter>
          <assigned_to name="Juro Bystricky">juro.bystricky</assigned_to>
          <cc>bluelightning</cc>
    
    <cc>srifenbark</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Done (doc changes complete)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>69596</commentid>
    <comment_count>0</comment_count>
    <who name="Henry Bruce">henry.bruce</who>
    <bug_when>2017-01-06 21:41:07 +0000</bug_when>
    <thetext>Observed behavior
=================
Kernel tests will not run if python module pexpect is not installed
$ bitbake zephyr-kernel-test-all -ctestimage

ERROR: zephyr-kernel-test-test-nano-work-1.6.0-r0 do_testimage: Failed to import QemuTargetZephyr from available controller modules:
Traceback (most recent call last):
  File &quot;/path/to/poky/meta/lib/oeqa/targetcontrol.py&quot;, line 32, in get_target_controller
    controller = getattr(sys.modules[__name__], testtarget)
AttributeError: module &apos;oeqa.targetcontrol&apos; has no attribute &apos;QemuTargetZephyr&apos;

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File &quot;/path/to/poky/meta/lib/oeqa/targetcontrol.py&quot;, line 38, in get_target_controller
    controller = testtargetloader.get_controller_module(testtarget, bbpath)
  File &quot;/path/to/poky/meta/lib/oeqa/controllers/testtargetloader.py&quot;, line 15, in get_controller_module
    controller = self.load_controller_from_name(target, controllerslist)
  File &quot;path/to/poky/meta/lib/oeqa/controllers/testtargetloader.py&quot;, line 48, in load_controller_from_name
    obj = self.load_controller_from_module(target, name)
  File &quot;/path/to/poky/meta/lib/oeqa/controllers/testtargetloader.py&quot;, line 57, in load_controller_from_module
    module = __import__(modulename, globals(), locals(), [target])
  File &quot;/path/to/poky/meta-yocto-bsp/lib/oeqa/controllers/beaglebonetarget.py&quot;, line 25, in &lt;module&gt;
    import pexpect
ImportError: No module named &apos;pexpect&apos;

ERROR: zephyr-kernel-test-test-nano-work-1.6.0-r0 do_testimage: Function failed: do_testimage
ERROR: Logfile of failure stored in: /path/to/build/tmp/work/i586-yocto-elf/zephyr-kernel-test-test-nano-work/1.6.0-r0/temp/log.do_testimage.27044

Expected behavior
=================
Documentation states that python module pexpect must be installed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69599</commentid>
    <comment_count>1</comment_count>
    <who name="Juro Bystricky">juro.bystricky</who>
    <bug_when>2017-01-06 22:06:50 +0000</bug_when>
    <thetext>The bug has actually nothing to do with meta-zephyr.
It is the 

meta-yocto-bsp/lib/oeqa/controllers/beaglebonetarget.py

complaining about missing python module &quot;pexpect&quot;. 
I could speculate the module was previously included with python2.7 by default
but it is not installed by python3, at least for some Linux distros. 
However, I suspect this problem has always been there.

Manual installation :

$ sudo pip3 install pexpect

should fix the problem.

So the most prudent fix is to update the documentation explicitly stating pexpect is required

http://www.yoctoproject.org/docs/1.8/ref-manual/ref-manual.html#required-packages-for-the-host-development-system</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69778</commentid>
    <comment_count>2</comment_count>
    <who name="Juro Bystricky">juro.bystricky</who>
    <bug_when>2017-01-12 23:18:35 +0000</bug_when>
    <thetext>Punting this to Scott, as the need for &quot;pexpect&quot; should be documented.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69951</commentid>
    <comment_count>3</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2017-01-20 00:00:59 +0000</bug_when>
    <thetext>Juro, 

So installing the &quot;pexpect&quot; package for all supported distros.  I assume that it needs to be in the &quot;Essentials&quot; grouping (see http://www.yoctoproject.org/docs/2.3/ref-manual/ref-manual.html#required-packages-for-the-host-development-system)

Thanks, 
Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70047</commentid>
    <comment_count>4</comment_count>
    <who name="Juro Bystricky">juro.bystricky</who>
    <bug_when>2017-01-23 20:33:51 +0000</bug_when>
    <thetext>yes, I believe that is exactly what is needed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70060</commentid>
    <comment_count>5</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2017-01-23 22:37:56 +0000</bug_when>
    <thetext>Juro, 

See http://www.yoctoproject.org/docs/2.3/ref-manual/ref-manual.html#required-packages-for-the-host-development-system for the changes in the ref-manual. 

See http://www.yoctoproject.org/docs/2.3/yocto-project-qs/yocto-project-qs.html#packages for the similar section in the YP Quick Start.

If this is ok - let me know. 

Thanks, 
Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70069</commentid>
    <comment_count>6</comment_count>
    <who name="Juro Bystricky">juro.bystricky</who>
    <bug_when>2017-01-23 23:36:09 +0000</bug_when>
    <thetext>Looks good to me. (And it should be probably back ported to previous Yocto
documentation as well, this is not a new requirement)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70071</commentid>
    <comment_count>7</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2017-01-24 00:35:05 +0000</bug_when>
    <thetext>Backported to top of yocto-docs/morty branch.  See ref-manual at http://www.yoctoproject.org/docs/2.2.1/ref-manual/ref-manual.html#required-packages-for-the-host-development-system

Backported to top of yocto-docs/morty branch.  see YP Quick Start at http://www.yoctoproject.org/docs/2.2.1/yocto-project-qs/yocto-project-qs.html#packages

Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70089</commentid>
    <comment_count>8</comment_count>
    <who name="Juro Bystricky">juro.bystricky</who>
    <bug_when>2017-01-24 17:40:52 +0000</bug_when>
    <thetext>Looks fine. Both pip3 and pexpect are always needed:
pip3 in order to run toaster and build Build Appliance
pexpect is (and has always been) needed by beaglbone testimage</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70100</commentid>
    <comment_count>9</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2017-01-24 21:51:44 +0000</bug_when>
    <thetext>Thanks Juro, 

I am setting the bug to RESOLVED and putting the doc flag to &quot;done.&quot;

Scott</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>