mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 18:21:39 +01:00
Instead use env to find the location of expect. Additionally do not use the -f flag, as it's only meaningful when passing arguments on the command line, which we never do for console.exp. From the expect 5.45.4 man page: > The -f flag prefaces a file from which to read commands from. The flag > itself is optional as it is only useful when using the #! notation (see > above), so that other arguments may be supplied on the command line. Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
52 lines
861 B
Plaintext
Executable File
52 lines
861 B
Plaintext
Executable File
#!/usr/bin/env expect
|
|
|
|
if {[info exists env(TEST_TIMEOUT_OVERRIDE)]} {
|
|
set timeout $env(TEST_TIMEOUT_OVERRIDE)
|
|
} elseif {[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
|
|
|