From 29cdaa380c2ef6db8dd331b32df61a2670faf460 Mon Sep 17 00:00:00 2001 From: Alexander Bushnev Date: Tue, 28 Jan 2025 11:25:43 +0100 Subject: [PATCH] Report logs from routed test only on fail (#863) --- tests/routed.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/routed.sh b/tests/routed.sh index 9a89057a0..03fe33612 100644 --- a/tests/routed.sh +++ b/tests/routed.sh @@ -53,7 +53,7 @@ for LOCATOR in $(echo "$LOCATORS" | xargs); do sleep 5 echo "> Running $TESTBIN ..." - "$TESTBIN" "$LOCATOR" + "$TESTBIN" "$LOCATOR" > client."$1".log 2>&1 RETCODE=$? echo "> Stopping zenohd ..." @@ -61,10 +61,13 @@ for LOCATOR in $(echo "$LOCATORS" | xargs); do sleep 1 - echo "> Logs of zenohd ..." - cat zenohd."$1".log - - [ "$RETCODE" -lt 0 ] && exit "$RETCODE" + if [ "$RETCODE" -lt 0 ]; then + echo "> Logs of client ..." + cat client."$1".log + echo "> Logs of zenohd ..." + cat zenohd."$1".log + exit "$RETCODE" + fi done echo "> Done ($RETCODE)."