|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v1 05/13] CI: enable XTF status codes
On Wed, 4 Nov 2026, dmukhin@xxxxxxxx wrote:
> From: Denis Mukhin <dmukhin@xxxxxxxx>
>
> Enable XTF status code parsing detection similarly to python
> 'xtf-runner' script (XTF repo) to allow fine-grained test report.
>
> Signed-off-by: Denis Mukhin <dmukhin@xxxxxxxx>
> ---
> automation/scripts/console.exp | 25 ++++++++++++++++++++-----
> 1 file changed, 20 insertions(+), 5 deletions(-)
>
> diff --git a/automation/scripts/console.exp b/automation/scripts/console.exp
> index e27886bbef23..55373f86e673 100755
> --- a/automation/scripts/console.exp
> +++ b/automation/scripts/console.exp
> @@ -14,8 +14,9 @@
> # - WAKEUP_CMD (optional): command to execute to wakeup the system 30s after
> # seeing SUSPEND_MSG
> # - LOG_MSG (optional): final console message to wait for
> -# - PASSED: message to look for to consider test a success; if LOG_MSG is
> set,
> +# - PASSED (optional): 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
> +# - TEST_XTF (optional): distinguish XTF error codes
>
> if {[info exists env(TEST_TIMEOUT_OVERRIDE)]} {
> set timeout $env(TEST_TIMEOUT_OVERRIDE)
> @@ -31,12 +32,24 @@ match_max 10000
>
> eval spawn $env(TEST_CMD)
>
> +if {[info exists env(TEST_XTF)]} {
> + expect_before {
> + -re {Test result: SUCCESS} { exit 0 }
> + -re {ERROR-EOF} { exit 2 }
What prints "ERROR-EOF" on the console? The only producer is send_error,
and that goes to stderr, so expect does not see it.
> + -re {Test result: SKIP} { exit 3 }
> + -re {Neither HAP nor Shadow available} { exit 3 }
This is an error, it should not be a skip
> + -re {Test result: ERROR} { exit 4 }
> + -re {Test result: FAILURE} { exit 5 }
> + -re { crashed } { exit 6 }
XTF panic() ends with hypercall_shutdown(SHUTDOWN_crash) which prints:
(XEN) Hardware Dom0 crashed: 'noreboot' set - not rebooting.
The trick is that "crashed:" probably does not match " crashed "
This should work:
if {[info exists env(TEST_XTF)]} {
expect_before {
-re {Test result: SUCCESS} { exit 0 }
-re {Test result: SKIP} { exit 3 }
-re {Test result: ERROR} { exit 4 }
-re {Test result: FAILURE} { exit 5 }
-re {PANIC: } { exit 6 }
-re {Panic on CPU} { exit 6 }
-re {Dom[0-9]+ crashed:} { exit 6 }
-re {\(vcpu#[0-9]+\) crashed} { exit 6 }
}
}
> + }
> +}
> +
> expect_after {
> -re "(.*)\r" {
> exp_continue -continue_timer
> }
> timeout {send_error "\nERROR-Timeout!\n"; exit 1}
> - eof {send_error "\nERROR-EOF!\n"; exit 1}
> + eof {send_error "\nERROR-EOF!\n"; exit 2}
> }
timeout keeps exit 1, which is also what expect returns when the script
hits a Tcl error, and patch 7 maps 1 to TIMEOUT. Please give timeout its
own code, so that a TIMEOUT in the report really is a timeout
> if {[info exists env(UBOOT_CMD)]} {
> @@ -71,9 +84,11 @@ if {[info exists env(LOG_MSG)]} {
> }
> }
>
> -expect {
> - -re "$env(PASSED)" {
> - exit 0
> +if {[info exists env(PASSED)]} {
> + expect {
> + -re "$env(PASSED)" {
> + exit 0
> + }
> }
> }
>
> --
> 2.55.0
>
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |