* [PATCH 1/4] scripts: Remove bashism from sh script
2017-10-06 10:34 [PATCH 0/4] Simple smoke test for QEMU Alexander Smirnov
@ 2017-10-06 10:34 ` Alexander Smirnov
2017-10-06 10:34 ` [PATCH 2/4] scripts: Add option to route start_vm output to file Alexander Smirnov
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Alexander Smirnov @ 2017-10-06 10:34 UTC (permalink / raw)
To: isar-users; +Cc: Alexander Smirnov
The '[[' is an extension supported by modern shells like bash, zsh etc...
Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
---
scripts/start_vm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/start_vm b/scripts/start_vm
index 1ce84b7..abf9eb0 100755
--- a/scripts/start_vm
+++ b/scripts/start_vm
@@ -70,7 +70,7 @@ DISTRO=stretch
BUILD_DIR=$PWD
# Parse command line to get user configuration
-while [[ $# -gt 0 ]]
+while [ $# -gt 0 ]
do
key="$1"
--
2.1.4
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/4] scripts: Add option to route start_vm output to file
2017-10-06 10:34 [PATCH 0/4] Simple smoke test for QEMU Alexander Smirnov
2017-10-06 10:34 ` [PATCH 1/4] scripts: Remove bashism from sh script Alexander Smirnov
@ 2017-10-06 10:34 ` Alexander Smirnov
2017-10-06 10:34 ` [PATCH 3/4] scripts: Add option to store QEMU pid Alexander Smirnov
2017-10-06 10:34 ` [PATCH 4/4] scripts: Add simple smoke test Alexander Smirnov
3 siblings, 0 replies; 5+ messages in thread
From: Alexander Smirnov @ 2017-10-06 10:34 UTC (permalink / raw)
To: isar-users; +Cc: Alexander Smirnov
Possibility to route QEMU output to file will be used for simple
smoke tests to check Isar QEMU images.
Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
---
scripts/start_vm | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/scripts/start_vm b/scripts/start_vm
index abf9eb0..444512b 100755
--- a/scripts/start_vm
+++ b/scripts/start_vm
@@ -28,6 +28,7 @@ qemu-system-$QEMU_ARCH \\\\\n\
-kernel \$IMAGE_DIR/$KERNEL_IMAGE \\\\\n\
-initrd \$IMAGE_DIR/$INITRD_IMAGE \\\\\n\
-append \"console=$MACHINE_SERIAL root=/dev/$ROOTFS_DEV rw\" \\\\\n\
+ $EXTRA_ARGS \\\\\n\
$root1"
root2=`echo $QEMU_ROOTFS_DEV \
@@ -40,6 +41,7 @@ qemu-system-$QEMU_ARCH \\\\\n\
-kernel $IMAGE_DIR/$KERNEL_IMAGE \
-initrd $IMAGE_DIR/$INITRD_IMAGE \
-append "console=$MACHINE_SERIAL root=/dev/$ROOTFS_DEV rw" \
+ $EXTRA_ARGS \
$root2
}
@@ -57,6 +59,8 @@ show_help() {
echo " -b, --build BUILD set path to build directory."
echo " -d, --distro DISTRO set isar Debian distribution."
echo " Supported: jessie, stretch."
+ echo " -o, --out FILE Route QEMU console output to"
+ echo " specified file."
echo " --help display this message and exit."
echo
echo "Exit status:"
@@ -91,6 +95,10 @@ do
DISTRO=$2
shift
;;
+ -o|--out)
+ EXTRA_ARGS="$EXTRA_ARGS -serial file:$2"
+ shift
+ ;;
*)
echo "error: invalid parameter '$key', please try '--help' to get list of supported parameters"
exit $ES_BUG
--
2.1.4
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 3/4] scripts: Add option to store QEMU pid
2017-10-06 10:34 [PATCH 0/4] Simple smoke test for QEMU Alexander Smirnov
2017-10-06 10:34 ` [PATCH 1/4] scripts: Remove bashism from sh script Alexander Smirnov
2017-10-06 10:34 ` [PATCH 2/4] scripts: Add option to route start_vm output to file Alexander Smirnov
@ 2017-10-06 10:34 ` Alexander Smirnov
2017-10-06 10:34 ` [PATCH 4/4] scripts: Add simple smoke test Alexander Smirnov
3 siblings, 0 replies; 5+ messages in thread
From: Alexander Smirnov @ 2017-10-06 10:34 UTC (permalink / raw)
To: isar-users; +Cc: Alexander Smirnov
Add possibility to store QEMU pid to file for further usage.
Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
---
scripts/start_vm | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/scripts/start_vm b/scripts/start_vm
index 444512b..400484a 100755
--- a/scripts/start_vm
+++ b/scripts/start_vm
@@ -61,6 +61,7 @@ show_help() {
echo " Supported: jessie, stretch."
echo " -o, --out FILE Route QEMU console output to"
echo " specified file."
+ echo " -p, --pid FILE Store QEMU pid to file."
echo " --help display this message and exit."
echo
echo "Exit status:"
@@ -99,6 +100,10 @@ do
EXTRA_ARGS="$EXTRA_ARGS -serial file:$2"
shift
;;
+ -p|--pid)
+ EXTRA_ARGS="$EXTRA_ARGS -pidfile $2"
+ shift
+ ;;
*)
echo "error: invalid parameter '$key', please try '--help' to get list of supported parameters"
exit $ES_BUG
--
2.1.4
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 4/4] scripts: Add simple smoke test
2017-10-06 10:34 [PATCH 0/4] Simple smoke test for QEMU Alexander Smirnov
` (2 preceding siblings ...)
2017-10-06 10:34 ` [PATCH 3/4] scripts: Add option to store QEMU pid Alexander Smirnov
@ 2017-10-06 10:34 ` Alexander Smirnov
3 siblings, 0 replies; 5+ messages in thread
From: Alexander Smirnov @ 2017-10-06 10:34 UTC (permalink / raw)
To: isar-users; +Cc: Alexander Smirnov
This simple smoke test checks if newly Isar image boots in QEMU to
login prompt. That's the first check that will be performes after
successfull build.
Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
---
scripts/vm_smoke_test | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)
create mode 100755 scripts/vm_smoke_test
diff --git a/scripts/vm_smoke_test b/scripts/vm_smoke_test
new file mode 100755
index 0000000..3bcfd5a
--- /dev/null
+++ b/scripts/vm_smoke_test
@@ -0,0 +1,50 @@
+#!/bin/sh
+#
+# This software is a part of ISAR.
+# Copyright (C) 2015-2017 ilbers GmbH
+
+CONSOLE_OUTPUT=/tmp/isar_console
+PID_FILE=/tmp/qemu.pid
+
+check_output() {
+ str=$(tail -1 $CONSOLE_OUTPUT)
+
+ if [ "$str" = "isar login: " ]; then
+ echo "Test: PASSED"
+ else
+ echo "Test: FAIL"
+ fi
+}
+
+run_test () {
+ ARCH=$1
+ DISTRO=$2
+
+ echo "-------------------------------------------------"
+ echo "Testing Isar [$DISTRO] image for [$ARCH] machine:"
+
+ # Start QEMU with Isar image
+ start_vm -a $ARCH -d $DISTRO -o $CONSOLE_OUTPUT -p $PID_FILE > /dev/null 2>&1 &
+ sleep 30
+ kill `cat $PID_FILE`
+
+ # Check output
+ check_output
+
+ # Clean up test artifacts
+ rm $CONSOLE_OUTPUT
+ rm $PID_FILE
+}
+
+# ARM machine
+run_test arm wheezy
+run_test arm jessie
+run_test arm stretch
+
+# AMD64 machine
+run_test amd64 jessie
+run_test amd64 stretch
+
+# i386 machine
+run_test i386 jessie
+run_test i386 stretch
--
2.1.4
^ permalink raw reply [flat|nested] 5+ messages in thread