<?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>612</bug_id>
          
          <creation_ts>2010-12-22 16:29:39 +0000</creation_ts>
          <short_desc>imagetest-qemu ssh&apos;d into my desktop and ran /sbin/poweroff</short_desc>
          <delta_ts>2010-12-23 17:26:29 +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>Meta-yocto</product>
          <component>meta-yocto</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>Undecided</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Richard Purdie">richard.purdie</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>jiajun.xu</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>scott.a.garman</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>---</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>11287</commentid>
    <comment_count>0</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2010-12-22 16:29:39 +0000</bug_when>
    <thetext>I tried reproducing bug 611. It didn&apos;t build an image, it asked me for a sudo password to setup the network interfaces, then it ssh&apos;d into localhost and ran /sbin/poweroff, presumably as part of one of the shutdown tests.

I wasn&apos;t impressed by this.

I&apos;d like to see the qemu connection verified a little more rigorously.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11289</commentid>
    <comment_count>1</comment_count>
    <who name="Jiajun Xu">jiajun.xu</who>
    <bug_when>2010-12-22 16:38:07 +0000</bug_when>
    <thetext>It&apos;s a bug in sanity test. I can look into the bug and send out a patch for
such condition checking.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11300</commentid>
    <comment_count>2</comment_count>
    <who name="Jiajun Xu">jiajun.xu</who>
    <bug_when>2010-12-22 23:02:39 +0000</bug_when>
    <thetext>Hi Richard,
I would like to add following check in sanity test to prevent such issue. Could you help to review?

diff --git a/scripts/qemuimage-testlib b/scripts/qemuimage-testlib
index c2c394d..2325237 100644
--- a/scripts/qemuimage-testlib
+++ b/scripts/qemuimage-testlib
@@ -365,8 +365,21 @@ Test_Create_Qemu()
        elif [ &quot;$QEMUARCH&quot; = &quot;qemumips&quot; ]; then
                KERNEL=$(Test_Find_Image -l ${DEPLOY_DIR}/images -k vmlinux -a ${QEMUARCH})
        fi
+
+       # If there is kernel image found, return failed directly
+       if [ $? -eq 1 ]; then
+               Test_Info &quot;No kernel image file found under ${DEPLOY_DIR}/images for ${QEMUARCH}, pls. have a check&quot;
+               return $ret
+       fi

        ROOTFS_IMAGE=$(Test_Find_Image -l ${DEPLOY_DIR}/images -t ${QEMUTARGET} -a ${QEMUARCH})
+
+       # If there is rootfs image found, return failed directly
+       if [ $? -eq 1 ]; then
+               Test_Info &quot;No ${QEMUTARGET} rootfs image file found under ${DEPLOY_DIR}/images for ${QEMUARCH}, pls. have a check&quot;
+               return $ret
+       fi
+
        TEST_ROOTFS_IMAGE=&quot;${TEST_TMP}/${QEMUTARGET}-${QEMUARCH}-test.ext3&quot;

        CP=`which cp`
@@ -375,6 +388,11 @@ Test_Create_Qemu()
        fi
        $CP $ROOTFS_IMAGE $TEST_ROOTFS_IMAGE

+       if [ $? -ne 0 ]; then
+               Test_Info &quot;Image ${ROOTFS_IMAGE} copy to ${TEST_ROOTFS_IMAGE} failed, return fail&quot;
+               return $ret
+       fi
+
        export MACHINE=$QEMUARCH

        # Create Qemu in localhost VNC Port 1
@@ -402,6 +420,11 @@ Test_Create_Qemu()
        if [ ${up_time} -lt ${timeout} ]; then
                sleep 5
                TARGET_IPADDR=`Test_Fetch_Target_IP $PID`
+               # If IP address is 0, means there is no qemu process found
+               if [ ${TARGET_IPADDR} -eq 0 ]; then
+                       Test_Info &quot;There is no qemu process or qemu ip address found, return failed&quot;
+                       return $ret
+               fi
        fi</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11303</commentid>
    <comment_count>3</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2010-12-23 03:46:22 +0000</bug_when>
    <thetext>I&apos;ve checked and the &quot;If IP address is 0, means there is no qemu process found&quot; test does ensure the problem I saw doesn&apos;t happen. Please send this patch as is a definite improvement on the existing code, thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11309</commentid>
    <comment_count>4</comment_count>
    <who name="Jiajun Xu">jiajun.xu</who>
    <bug_when>2010-12-23 17:26:29 +0000</bug_when>
    <thetext>Fixing patch in master now, commit 236faced1d907b025a3136c5949a311104d3a661.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>