public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Alexander Smirnov <asmirnov@ilbers.de>
To: isar-users@googlegroups.com
Cc: Alexander Smirnov <asmirnov@ilbers.de>
Subject: [PATCH v2 2/3] scripts/vm_smoke_test: Check if QEMU didn't start
Date: Fri,  4 May 2018 15:27:13 +0300	[thread overview]
Message-ID: <20180504122714.1201-3-asmirnov@ilbers.de> (raw)
In-Reply-To: <20180504122714.1201-1-asmirnov@ilbers.de>

Add check for QEMU start and display error message if it didn't start.

Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
---
 scripts/vm_smoke_test | 27 +++++++++++++++++++--------
 1 file changed, 19 insertions(+), 8 deletions(-)

diff --git a/scripts/vm_smoke_test b/scripts/vm_smoke_test
index 76db97d..9c50508 100755
--- a/scripts/vm_smoke_test
+++ b/scripts/vm_smoke_test
@@ -1,7 +1,7 @@
 #!/bin/sh
 #
 # This software is a part of ISAR.
-# Copyright (C) 2015-2017 ilbers GmbH
+# Copyright (C) 2015-2018 ilbers GmbH
 
 CONSOLE_OUTPUT=/tmp/isar_console
 PID_FILE=/tmp/qemu.pid
@@ -56,18 +56,29 @@ run_test () {
     echo "Testing Isar [$DISTRO] image for [$ARCH] machine:"
 
     start_vm -a $ARCH -d $DISTRO -o $CONSOLE_OUTPUT -p $PID_FILE > /dev/null 2>&1 &
-    sleep 60
-    kill `cat $PID_FILE`
+    sleep 5
 
-    FAIL=0
+    if [ -z `ps -p $! -o pid=` ]; then
+        echo "QEMU start: FAILED"
+        RET=$ES_FAIL
+        echo "Command output:\n8<--"
+        start_vm -a $ARCH -d $DISTRO -o $CONSOLE_OUTPUT -p $PID_FILE
+        echo "\n8<--"
+    else
+        sleep 60
+        kill `cat $PID_FILE`
+
+        FAIL=0
 
-    check_login_prompt
+        check_login_prompt
 
-    check_example_module
+        check_example_module
 
-    [ $VERBOSE -eq 1 -o $FAIL -eq 1 ] && dump_boot_log
+        [ $VERBOSE -eq 1 -o $FAIL -eq 1 ] && dump_boot_log
+
+        rm $CONSOLE_OUTPUT
+    fi
 
-    rm $CONSOLE_OUTPUT
     rm $PID_FILE
 }
 
-- 
2.1.4


  parent reply	other threads:[~2018-05-04 12:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-04 12:27 [PATCH v2 0/3] Update scripts Alexander Smirnov
2018-05-04 12:27 ` [PATCH v2 1/3] scripts/vm_smoke_test: Add quite parameter Alexander Smirnov
2018-05-04 12:27 ` Alexander Smirnov [this message]
2018-05-04 12:27 ` [PATCH v2 3/3] scripts/ci_build: Make CI script more generic Alexander Smirnov
2018-05-04 18:23 ` [PATCH v2 0/3] Update scripts Henning Schild

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180504122714.1201-3-asmirnov@ilbers.de \
    --to=asmirnov@ilbers.de \
    --cc=isar-users@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox