diff options
Diffstat (limited to 'scripts/qemuimage-testlib')
-rw-r--r-- | scripts/qemuimage-testlib | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/scripts/qemuimage-testlib b/scripts/qemuimage-testlib index c2c394d5ed..608c6f0a75 100644 --- a/scripts/qemuimage-testlib +++ b/scripts/qemuimage-testlib | |||
@@ -365,8 +365,21 @@ Test_Create_Qemu() | |||
365 | elif [ "$QEMUARCH" = "qemumips" ]; then | 365 | elif [ "$QEMUARCH" = "qemumips" ]; then |
366 | KERNEL=$(Test_Find_Image -l ${DEPLOY_DIR}/images -k vmlinux -a ${QEMUARCH}) | 366 | KERNEL=$(Test_Find_Image -l ${DEPLOY_DIR}/images -k vmlinux -a ${QEMUARCH}) |
367 | fi | 367 | fi |
368 | |||
369 | # If there is no kernel image found, return failed directly | ||
370 | if [ $? -eq 1 ]; then | ||
371 | Test_Info "No kernel image file found under ${DEPLOY_DIR}/images for ${QEMUARCH}, pls. have a check" | ||
372 | return $ret | ||
373 | fi | ||
368 | 374 | ||
369 | ROOTFS_IMAGE=$(Test_Find_Image -l ${DEPLOY_DIR}/images -t ${QEMUTARGET} -a ${QEMUARCH}) | 375 | ROOTFS_IMAGE=$(Test_Find_Image -l ${DEPLOY_DIR}/images -t ${QEMUTARGET} -a ${QEMUARCH}) |
376 | |||
377 | # If there is no rootfs image found, return failed directly | ||
378 | if [ $? -eq 1 ]; then | ||
379 | Test_Info "No ${QEMUTARGET} rootfs image file found under ${DEPLOY_DIR}/images for ${QEMUARCH}, pls. have a check" | ||
380 | return $ret | ||
381 | fi | ||
382 | |||
370 | TEST_ROOTFS_IMAGE="${TEST_TMP}/${QEMUTARGET}-${QEMUARCH}-test.ext3" | 383 | TEST_ROOTFS_IMAGE="${TEST_TMP}/${QEMUTARGET}-${QEMUARCH}-test.ext3" |
371 | 384 | ||
372 | CP=`which cp` | 385 | CP=`which cp` |
@@ -375,6 +388,11 @@ Test_Create_Qemu() | |||
375 | fi | 388 | fi |
376 | $CP $ROOTFS_IMAGE $TEST_ROOTFS_IMAGE | 389 | $CP $ROOTFS_IMAGE $TEST_ROOTFS_IMAGE |
377 | 390 | ||
391 | if [ $? -ne 0 ]; then | ||
392 | Test_Info "Image ${ROOTFS_IMAGE} copy to ${TEST_ROOTFS_IMAGE} failed, return fail" | ||
393 | return $ret | ||
394 | fi | ||
395 | |||
378 | export MACHINE=$QEMUARCH | 396 | export MACHINE=$QEMUARCH |
379 | 397 | ||
380 | # Create Qemu in localhost VNC Port 1 | 398 | # Create Qemu in localhost VNC Port 1 |
@@ -402,6 +420,11 @@ Test_Create_Qemu() | |||
402 | if [ ${up_time} -lt ${timeout} ]; then | 420 | if [ ${up_time} -lt ${timeout} ]; then |
403 | sleep 5 | 421 | sleep 5 |
404 | TARGET_IPADDR=`Test_Fetch_Target_IP $PID` | 422 | TARGET_IPADDR=`Test_Fetch_Target_IP $PID` |
423 | # If IP address is 0, means there is no qemu process found | ||
424 | if [ ${TARGET_IPADDR} -eq 0 ]; then | ||
425 | Test_Info "There is no qemu process or qemu ip address found, return failed" | ||
426 | return $ret | ||
427 | fi | ||
405 | fi | 428 | fi |
406 | 429 | ||
407 | while [ ${up_time} -lt ${timeout} ] | 430 | while [ ${up_time} -lt ${timeout} ] |