qa/live: fail the dpdk test when no packets are captured

When Suricata exits during startup it never writes a stats event, so jq
returns an empty string and the test aborted the comparison with
"unary operator expected".
Quote the value and compare it against the expected outcome, so an empty
result fails the same way a false one does.
pull/16292/head
Lukas Sismis 1 month ago
parent bc1340f4bd
commit d84b715344

@ -42,7 +42,7 @@ sleep 15
# check stats and alerts
STATSCHECK=$(jq -c 'select(.event_type == "stats")' ./eve.json | tail -n1 | jq '.stats.capture.packets > 0')
if [ $STATSCHECK = false ]; then
if [ "$STATSCHECK" != true ]; then
echo "ERROR no packets captured"
RES=1
fi
@ -59,7 +59,7 @@ sleep 15
# check stats and alerts
STATSCHECK=$(jq -c 'select(.event_type == "stats")' ./eve.json | tail -n1 | jq '.stats.capture.packets > 0')
if [ $STATSCHECK = false ]; then
if [ "$STATSCHECK" != true ]; then
echo "ERROR no packets captured"
RES=1
fi

Loading…
Cancel
Save