* [PATCH 0/1] qemuimage-testlib: Add check for existence of image and correctness of ip address
@ 2010-12-23 15:26 Jiajun Xu
2010-12-23 15:26 ` [PATCH 1/1] " Jiajun Xu
2010-12-23 15:54 ` [PATCH 0/1] " Richard Purdie
0 siblings, 2 replies; 3+ messages in thread
From: Jiajun Xu @ 2010-12-23 15:26 UTC (permalink / raw)
To: poky
Fixes [BUGID #612, #611]
We need to check the existence of to-be tested image in sanity test. Meanwhile, we should check the ip address to make sure it is valid.
Pull URL: git://git.pokylinux.org/poky-contrib.git
Branch: jxu49/master
Browse: http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=jxu49/master
Thanks,
Jiajun Xu <jiajun.xu@intel.com>
---
Jiajun Xu (1):
qemuimage-testlib: Add check for existence of image and correctness
of ip address
scripts/qemuimage-testlib | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/1] qemuimage-testlib: Add check for existence of image and correctness of ip address
2010-12-23 15:26 [PATCH 0/1] qemuimage-testlib: Add check for existence of image and correctness of ip address Jiajun Xu
@ 2010-12-23 15:26 ` Jiajun Xu
2010-12-23 15:54 ` [PATCH 0/1] " Richard Purdie
1 sibling, 0 replies; 3+ messages in thread
From: Jiajun Xu @ 2010-12-23 15:26 UTC (permalink / raw)
To: poky
Fixes [BUGID #612, #611]
Add check for existence of image to be tested in qemuimage-testlib.
This ensures that sanity test returns failure immediatly when there is
no image found. And also add check for the correctness of ip address.
If the ip address returned by function Test_Fetch_Target_IP is 0, it
means qemu starts up failed and no valid ip address found.
Signed-off-by Jiajun Xu <jiajun.xu@intel.com>
---
scripts/qemuimage-testlib | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/scripts/qemuimage-testlib b/scripts/qemuimage-testlib
index c2c394d..608c6f0 100644
--- a/scripts/qemuimage-testlib
+++ b/scripts/qemuimage-testlib
@@ -365,8 +365,21 @@ Test_Create_Qemu()
elif [ "$QEMUARCH" = "qemumips" ]; then
KERNEL=$(Test_Find_Image -l ${DEPLOY_DIR}/images -k vmlinux -a ${QEMUARCH})
fi
+
+ # If there is no kernel image found, return failed directly
+ if [ $? -eq 1 ]; then
+ Test_Info "No kernel image file found under ${DEPLOY_DIR}/images for ${QEMUARCH}, pls. have a check"
+ return $ret
+ fi
ROOTFS_IMAGE=$(Test_Find_Image -l ${DEPLOY_DIR}/images -t ${QEMUTARGET} -a ${QEMUARCH})
+
+ # If there is no rootfs image found, return failed directly
+ if [ $? -eq 1 ]; then
+ Test_Info "No ${QEMUTARGET} rootfs image file found under ${DEPLOY_DIR}/images for ${QEMUARCH}, pls. have a check"
+ return $ret
+ fi
+
TEST_ROOTFS_IMAGE="${TEST_TMP}/${QEMUTARGET}-${QEMUARCH}-test.ext3"
CP=`which cp`
@@ -375,6 +388,11 @@ Test_Create_Qemu()
fi
$CP $ROOTFS_IMAGE $TEST_ROOTFS_IMAGE
+ if [ $? -ne 0 ]; then
+ Test_Info "Image ${ROOTFS_IMAGE} copy to ${TEST_ROOTFS_IMAGE} failed, return fail"
+ 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 "There is no qemu process or qemu ip address found, return failed"
+ return $ret
+ fi
fi
while [ ${up_time} -lt ${timeout} ]
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 0/1] qemuimage-testlib: Add check for existence of image and correctness of ip address
2010-12-23 15:26 [PATCH 0/1] qemuimage-testlib: Add check for existence of image and correctness of ip address Jiajun Xu
2010-12-23 15:26 ` [PATCH 1/1] " Jiajun Xu
@ 2010-12-23 15:54 ` Richard Purdie
1 sibling, 0 replies; 3+ messages in thread
From: Richard Purdie @ 2010-12-23 15:54 UTC (permalink / raw)
To: Jiajun Xu; +Cc: poky
On Thu, 2010-12-23 at 23:26 +0800, Jiajun Xu wrote:
> Fixes [BUGID #612, #611]
>
> We need to check the existence of to-be tested image in sanity test. Meanwhile, we should check the ip address to make sure it is valid.
>
> Pull URL: git://git.pokylinux.org/poky-contrib.git
> Branch: jxu49/master
> Browse: http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=jxu49/master
>
> Thanks,
> Jiajun Xu <jiajun.xu@intel.com>
Merged into master, thanks!
Richard
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-12-23 15:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-23 15:26 [PATCH 0/1] qemuimage-testlib: Add check for existence of image and correctness of ip address Jiajun Xu
2010-12-23 15:26 ` [PATCH 1/1] " Jiajun Xu
2010-12-23 15:54 ` [PATCH 0/1] " Richard Purdie
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.