diff --git a/tests/regression/apparmor/task.yaml b/tests/regression/apparmor/task.yaml index e9983dcbc..02fe532b2 100644 --- a/tests/regression/apparmor/task.yaml +++ b/tests/regression/apparmor/task.yaml @@ -104,12 +104,13 @@ environment: artifacts: - bash.log - bash.err + - bash.trace execute: | # Run the shell script that is named after the spread variant we are running # now. The makefile runs them all sequentially via the "alltests" goal. Here # we can parallelize it through spread and also have a way to run precisely # the test we want, especially for debugging. - if ! bash -x "$SPREAD_VARIANT".sh >bash.log 2>bash.err; then + if ! BASH_XTRACEFD=42 bash -x "$SPREAD_VARIANT".sh >bash.log 2>bash.err 42>bash.trace; then for xfail in ${XFAIL:-}; do if [ "$SPREAD_SYSTEM" = "$xfail" ]; then echo "Ignoring expected failure of $SPREAD_TASK on $SPREAD_SYSTEM" @@ -118,13 +119,17 @@ execute: | done echo "Test $SPREAD_VARIANT has unexpectedly failed" - echo "Test execution logs are in the files bash.{log.err} and are collected as artifacts" + echo "Test execution logs are in the files bash.{log,err,trace} and are collected as artifacts" + echo "Bash errors are listed below:" + cat bash.err exit 1 else for xfail in ${XFAIL:-}; do if [ "$SPREAD_SYSTEM" = "$xfail" ]; then echo "Test $SPREAD_VARIANT has unexpectedly passed" - echo "Test execution logs are in the files bash.{log.err} and are collected as artifacts" + echo "Test execution logs are in the files bash.{log,err,trace} and are collected as artifacts" + echo "Bash errors are listed below:" + cat bash.err exit 1 fi done