Skip to content

Commit

Permalink
test: l2fwd: improve runner script failure detection
Browse files Browse the repository at this point in the history
Currently, even if runner script fails to parse the maximum pps value
from `odp_l2fwd` test log (e.g. the searched pattern is not found or
value is not numerical), runner script reports success.

Improve this by checking that the parsed value is actually found and is
an integer. This should help if the searched pattern somehow changes
without additionally updating the runner script.

Signed-off-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
  • Loading branch information
TuomasTaipale authored and MatiasElo committed Oct 4, 2024
1 parent 35b34ed commit fb39a70
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/performance/odp_l2fwd_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@ run_l2fwd()
PASS_PPS=10
fi
MAX_PPS=$(awk '/TEST RESULT/ {print $3}' $LOG)
if [ "$MAX_PPS" -lt "$PASS_PPS" ]; then
NUMREG='^[0-9]+$'
echo "PARSED PPS: $MAX_PPS"
if ! [[ $MAX_PPS =~ $NUMREG ]]; then
echo "FAIL: cannot parse $LOG"
ret=1
elif [ "$MAX_PPS" -lt "$PASS_PPS" ]; then
echo -e "\nodp_packet_gen"
echo "=============="
cat $GEN_LOG
Expand Down

0 comments on commit fb39a70

Please sign in to comment.