Script which launches QEMU and runs robot CI test against it
This script will be run within automation to do a basic QEMU
CI test against the input openbmc build.
Change-Id: I6ffccd7f5767bec9bc673b1a41bd7bd1d960924c
Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
diff --git a/scripts/boot-qemu-test.exp b/scripts/boot-qemu-test.exp
new file mode 100755
index 0000000..f4c3d38
--- /dev/null
+++ b/scripts/boot-qemu-test.exp
@@ -0,0 +1,39 @@
+#!/usr/bin/expect
+#
+# Launch QEMU and verify we can login then sleep for defined amount of time
+# before exiting
+#
+# Requires following env variables be set:
+# QEMU_RUN_TIMER Amount of time to run the QEMU instance
+# HOME Location of scripts
+
+set timeout "$env(QEMU_RUN_TIMER)*2"
+set command "$env(HOME)/boot-qemu.sh"
+
+spawn $command
+
+expect {
+ timeout { send_user "\nFailed to boot\n"; exit 1 }
+ eof { send_user "\nFailure, got EOF"; exit 1 }
+ "qemuarm login:"
+}
+
+send "root\r"
+
+expect {
+ timeout { send_user "\nFailed, no login prompt\n"; exit 1 }
+ eof { send_user "\nFailure, got EOF"; exit 1 }
+ "Password:"
+}
+
+send "0penBmc\r"
+
+expect {
+ timeout { send_user "\nFailed, could not login\n"; exit 1 }
+ eof { send_user "\nFailure, got EOF"; exit 1 }
+ "root@qemuarm:~#"
+}
+
+send_user "OPENBMC-READY\n"
+sleep "$env(QEMU_RUN_TIMER)"
+send_user "OPENBMC-EXITING\n"