#!/usr/bin/env expect
+#
+# Variables used by this script:
+# - TEST_TIMEOUT: timeout between each *_MSG match
+# - TEST_TIMEOUT_OVERRIDE: when set, overrides TEST_TIMEOUT
+# - TEST_LOG: save console log to this file
+# - TEST_CMD: commands that prints test system console output to stdout - in
+# qemu tests that's usually qemu itself (with -serial stdio), in hardware
+# tests that's a command to read serial console
+# - UBOOT_CMD (optional): command to enter at u-boot prompt
+# - BOOT_MSG (optional): initial Xen message to wait for (aka sign-of-life)
+# - LOG_MSG (optional): final console message to wait for
+# - PASSED: message to look for to consider test a success; if LOG_MSG is set,
+# both LOG_MSG and PASSED must appear (in any order) for test to succeed
if {[info exists env(TEST_TIMEOUT_OVERRIDE)]} {
set timeout $env(TEST_TIMEOUT_OVERRIDE)
send "$env(UBOOT_CMD)\r"
}
+if {[info exists env(BOOT_MSG)]} {
+ expect -re "$env(BOOT_MSG)"
+}
+
if {[info exists env(LOG_MSG)]} {
expect {
- "$env(PASSED)" {
- expect "$env(LOG_MSG)"
+ -re "$env(PASSED)" {
+ expect -re "$env(LOG_MSG)"
exit 0
}
- "$env(LOG_MSG)" {
- expect "$env(PASSED)"
+ -re "$env(LOG_MSG)" {
+ expect -re "$env(PASSED)"
exit 0
}
}
}
expect {
- "$env(PASSED)" {
+ -re "$env(PASSED)" {
exit 0
}
}
-netdev user,id=n0,tftp=binaries,bootfile=/pxelinux.0"
export TEST_LOG="smoke.serial"
+export BOOT_MSG="Latest ChangeSet: "
export LOG_MSG="Domain-0"
export PASSED="BusyBox"
export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
export TEST_LOG="${serial_log}"
+export BOOT_MSG="Latest ChangeSet: "
export LOG_MSG="Domain-0"
export PASSED="/ #"
-bios /usr/lib/u-boot/qemu_arm64/u-boot.bin"
export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
+export BOOT_MSG="Latest ChangeSet: "
export TEST_LOG="smoke.serial"
export LOG_MSG="Domain-0"
export PASSED="BusyBox"
-bios /usr/lib/u-boot/qemu_arm/u-boot.bin"
export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
+export BOOT_MSG="Latest ChangeSet: "
export TEST_LOG="${serial_log}"
export LOG_MSG="${dom0_prompt}"
export PASSED="${passed}"
-bios /usr/lib/u-boot/qemu_arm64/u-boot.bin"
export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
+export BOOT_MSG="Latest ChangeSet: "
export TEST_LOG="smoke.serial"
export PASSED="${passed}"
# Capture test result and power off board before exiting.
export PASSED="${PASS_MSG}"
+export BOOT_MSG="Latest ChangeSet: "
export TEST_CMD="cat ${SERIAL_DEV}"
export TEST_LOG="smoke.serial"
# Capture test result and power off board before exiting.
export PASSED="${passed}"
+export BOOT_MSG="Latest ChangeSet: "
export LOG_MSG="Welcome to Alpine Linux"
export TEST_CMD="cat ${SERIAL_DEV}"
export TEST_LOG="smoke.serial"