mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-20 18:30:51 +00:00
tests/k8s: print logs on fail only (k8s-confidential-attestation.bats)
Use the variable BATS_TEST_COMPLETED which is defined by the bats framework when the test finishes. `BATS_TEST_COMPLETED=` (empty) means the test failed, so the node syslogs will be printed only at that condition. Fixes: #9750 Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
This commit is contained in:
parent
b3cb19b6a7
commit
55ae98eb28
@ -93,7 +93,7 @@ teardown() {
|
||||
[ -n "${pod_name:-}" ] && kubectl describe "pod/${pod_name}" || true
|
||||
[ -n "${pod_config_dir:-}" ] && kubectl delete -f "${K8S_TEST_YAML}" || true
|
||||
|
||||
if [ -n "${node_start_time}:-}" ]; then
|
||||
if [[ -n "${node_start_time}:-}" && -z "$BATS_TEST_COMPLETED" ]]; then
|
||||
echo "DEBUG: system logs of node '$node' since test start time ($node_start_time)"
|
||||
print_node_journal "$node" "kata" --since "$node_start_time" || true
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user