Files
xen/automation/scripts/console.exp
T
Victor Lira 5e99a40ea5 automation: use expect utility in xilinx tests
Fixes: 95764a0817 (automation: update xilinx test scripts (tty))
This patch introduced a CI failure due to a timeout in xilinx-x86_64 test.

Change xilinx-x86_64 and xilinx-arm64 scripts to use "expect" utility
to determine test result and allow early exit from tests.
Add "expect" to xilinx container environment (dockerfile).
Rename references to "QEMU" in "qemu-key.exp" expect script to "TEST" to be
used by both QEMU and hardware tests.

Signed-off-by: Victor Lira <victorm.lira@amd.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
2024-08-29 18:43:47 -07:00

50 lines
762 B
Plaintext
Executable File

#!/usr/bin/expect -f
if {[info exists env(TEST_TIMEOUT)]} {
set timeout $env(TEST_TIMEOUT)
} else {
set timeout 1500
}
log_file -a $env(TEST_LOG)
match_max 10000
eval spawn $env(TEST_CMD)
expect_after {
-re "(.*)\r" {
exp_continue -continue_timer
}
timeout {send_error "ERROR-Timeout!\n"; exit 1}
eof {send_error "ERROR-EOF!\n"; exit 1}
}
if {[info exists env(UBOOT_CMD)]} {
expect "=>"
send "$env(UBOOT_CMD)\r"
}
if {[info exists env(LOG_MSG)]} {
expect {
"$env(PASSED)" {
expect "$env(LOG_MSG)"
exit 0
}
"$env(LOG_MSG)" {
expect "$env(PASSED)"
exit 0
}
}
}
expect {
"$env(PASSED)" {
exit 0
}
}
expect eof