From 0f7b76019207cfcf34c5b20ae488029551bc5d5e Mon Sep 17 00:00:00 2001 From: Dmitrii Golovanov Date: Mon, 16 Jun 2025 14:17:57 +0200 Subject: [PATCH] test-case: latency-metrics: fix no metrics JSON Fix output JSON in case there is no metrics gathered in non-trial mode, e.g. if gawk is missing on the DUT. Signed-off-by: Dmitrii Golovanov --- test-case/latency-metrics.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test-case/latency-metrics.sh b/test-case/latency-metrics.sh index 0a288177..c8c6bd0c 100755 --- a/test-case/latency-metrics.sh +++ b/test-case/latency-metrics.sh @@ -235,7 +235,10 @@ report_metric() printf '"probes":0, "xruns":0}' >> "${RESULT_JSON}" [ -f "${METRICS_JSON}" ] && rm "${METRICS_JSON}" [ -f "${EVENTS_JSON}" ] && rm "${EVENTS_JSON}" - [ "${trial_mode}" -ne 0 ] || skip_test "No latency metrics collected" + if [ "${trial_mode}" -eq 0 ]; then + printf ']}' >> "${RESULT_JSON}" + skip_test "No latency metrics collected" + fi else local metrics_ metrics_=$(cat "${METRICS_JSON}")