Files
xen/automation/scripts/qemu-key.exp
T
Stefano Stabellini 1e2a5f991f automation: add default QEMU_TIMEOUT value if not already set
The expectation is that QEMU_TIMEOUT should be set as a Gitlab CI/CD
variable but if not we should be able to run the pipeline anyway.

Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>
2024-08-16 16:50:19 -07:00

50 lines
746 B
Plaintext
Executable File

#!/usr/bin/expect -f
if {[info exists env(QEMU_TIMEOUT)]} {
set timeout $env(QEMU_TIMEOUT)
} else {
set timeout 1500
}
log_file -a $env(QEMU_LOG)
match_max 10000
eval spawn $env(QEMU_CMD)
expect_after {
-re "(.*)\r" {
exp_continue
}
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