diff mbox

[kvm-unit-tests,12/12] scripts/mkstandalone: return the exit value of a test

Message ID 1453209851-27760-13-git-send-email-rkrcmar@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Radim Krčmář Jan. 19, 2016, 1:24 p.m. UTC
This brings scripts/mkstandalone in line with $TEST_DIR/run.
The exit value doesn't make much sense and should be fixed.

Signed-off-by: Radim Kr?má? <rkrcmar@redhat.com>
---
 scripts/mkstandalone.sh | 1 -
 scripts/runtime.bash    | 5 ++++-
 2 files changed, 4 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/scripts/mkstandalone.sh b/scripts/mkstandalone.sh
index 764c42d12e3b..05d86d281f68 100755
--- a/scripts/mkstandalone.sh
+++ b/scripts/mkstandalone.sh
@@ -53,7 +53,6 @@  generate_test ()
 	cat scripts/runtime.bash
 
 	echo "run ${args[@]}"
-	echo "exit 0"
 }
 
 function mkstandalone()
diff --git a/scripts/runtime.bash b/scripts/runtime.bash
index defbef31377d..15e3534cb52c 100644
--- a/scripts/runtime.bash
+++ b/scripts/runtime.bash
@@ -47,12 +47,15 @@  function run()
     # extra_params in the config file may contain backticks that need to be
     # expanded, so use eval to start qemu
     eval $cmdline
+    ret=$?
 
-    if [ $? -le 1 ]; then
+    if [ $ret -le 1 ]; then
         echo -e "\e[32mPASS\e[0m $1"
     else
         echo -e "\e[31mFAIL\e[0m $1"
     fi
+
+    return $ret
 }
 
 function usage()