Skip to content

Commit a16ce69

Browse files
committed
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 <dmitrii.golovanov@intel.com>
1 parent 20a47bc commit a16ce69

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test-case/latency-metrics.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,10 @@ report_metric()
235235
printf '"probes":0, "xruns":0}' >> "${RESULT_JSON}"
236236
[ -f "${METRICS_JSON}" ] && rm "${METRICS_JSON}"
237237
[ -f "${EVENTS_JSON}" ] && rm "${EVENTS_JSON}"
238-
[ "${trial_mode}" -ne 0 ] || skip_test "No latency metrics collected"
238+
if [ "${trial_mode}" -eq 0 ]; then
239+
printf ']}' >> "${RESULT_JSON}"
240+
skip_test "No latency metrics collected"
241+
fi
239242
else
240243
local metrics_
241244
metrics_=$(cat "${METRICS_JSON}")

0 commit comments

Comments
 (0)