Skip to content
Snippets Groups Projects
Commit 7950f2b7 authored by Jerome Forissier's avatar Jerome Forissier
Browse files

qemu-check.exp: fixes/improvements for Travis CI environment


* Detect kernel rcu_sched stall + cosmetic improvements
* Start QEMU with options '-nographic -monitor none'. Without this,
QEMU cannot be run on the Travis servers which have no display.
'-monitor none' is needed when '-nographic' is set and one wants to
redirect serial port 0 (first occurrence of '-serial stdio'), otherwise
a conflict occurs and the following message is shown:
    qemu-system-arm: -serial stdio: cannot use stdio by multiple character
    devices
* Fix undefined variable error on timeout
* Set LD_LIBRARY_PATH. The libraries that come with the compiler
sometimes end up under /lib, or under /lib/arm-linx-gnueabihf. By setting
LD_LIBRARY_PATH we support both.
* Catch kernel panic/timeout on boot to make the script more robust.

Signed-off-by: default avatarJerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: default avatarJoakim Bech <joakim.bech@linaro.org>
parent 2660ff2d
No related branches found
No related tags found
No related merge requests found
...@@ -38,11 +38,24 @@ log_user 0 ...@@ -38,11 +38,24 @@ log_user 0
# Save guest console output to a file # Save guest console output to a file
log_file -a -noappend "serial0.log" log_file -a -noappend "serial0.log"
info "Starting QEMU..." info "Starting QEMU..."
spawn ../qemu/arm-softmmu/qemu-system-arm -machine virt -cpu cortex-a15 -m 1057 -serial stdio -serial file:serial1.log -bios $bios spawn ../qemu/arm-softmmu/qemu-system-arm -nographic -monitor none -machine virt -cpu cortex-a15 -m 1057 -serial stdio -serial file:serial1.log -bios $bios
expect "*Please press Enter to activate this console. " expect {
"Kernel panic" {
info "!!! Kernel panic\n"
exit 1
}
timeout {
info "!!! Timeout\n"
exit 1
}
"Please press Enter to activate this console. "
}
send -- "\r" send -- "\r"
expect "root@Vexpress:/ " expect "root@Vexpress:/ "
info " done, guest is booted.\nLoading OP-TEE driver and tee-supplicant..." info " done, guest is booted.\nLoading OP-TEE driver and tee-supplicant..."
# Toolchain libraries might be here or there
send -- "export LD_LIBRARY_PATH=/lib:/lib/arm-linux-gnueabihf\r"
expect "root@Vexpress:/ "
send -- "modprobe optee_armtz\r" send -- "modprobe optee_armtz\r"
expect "root@Vexpress:/ " expect "root@Vexpress:/ "
sleep 1 sleep 1
...@@ -51,10 +64,15 @@ expect "root@Vexpress:/ " ...@@ -51,10 +64,15 @@ expect "root@Vexpress:/ "
sleep 1 sleep 1
info " done.\nRunning: $cmd...\n" info " done.\nRunning: $cmd...\n"
send -- "$cmd\r" send -- "$cmd\r"
set casenum "none"
expect { expect {
# Exit with error status as soon as a test fails # Exit with error status as soon as a test fails
-re { XTEST_TEE_([^ ]+) FAIL} { -re { XTEST_TEE_([^ ]+) FAIL} {
info "$expect_out(1,string) FAIL" info " $expect_out(1,string) FAIL\n"
exit 1
}
-re {rcu_sched detected stalls} {
info " Kernel error: '$expect_out(0,string)'\n"
exit 1 exit 1
} }
# Crude progress indicator: print one # when each test [sub]case starts # Crude progress indicator: print one # when each test [sub]case starts
...@@ -72,13 +90,14 @@ expect { ...@@ -72,13 +90,14 @@ expect {
} }
info "#" info "#"
incr ncases incr ncases
if {$ncases % 50 == 0} { info "\n" }
exp_continue exp_continue
} }
# Exit when result separator is seen # Exit when result separator is seen
"+-----------------------------------------------------\r\r" {} "+-----------------------------------------------------\r\r" {}
timeout { timeout {
info "!!! Timeout\n" info "!!! Timeout\n"
info "TIMEOUT - test case too long or hung? ($casenum)\n" info "TIMEOUT - test case too long or hung? (last test started: $casenum)\n"
exit 2 exit 2
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment