bash -lt syntax expects 2 integer values, not strings. Also return code of piped command needs to be get in a little bit different way. https://bugs.linaro.org/show_bug.cgi?id=2872
Signed-off-by: Maxim Uvarov <maxim.uva...@linaro.org> --- .../performance/odp_pktio_ordered_run.sh | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/test/common_plat/performance/odp_pktio_ordered_run.sh b/test/common_plat/performance/odp_pktio_ordered_run.sh index d91211c0..8b20cd59 100755 --- a/test/common_plat/performance/odp_pktio_ordered_run.sh +++ b/test/common_plat/performance/odp_pktio_ordered_run.sh @@ -24,17 +24,25 @@ fi $STDBUF ./odp_pktio_ordered${EXEEXT} -i pcap:in=${PCAP_IN}:loops=$LOOPS,\ pcap:out=${PCAP_OUT} -t $DURATION | tee $LOG -ret=$? +ret=${PIPESTATUS[0]} + +if [ $ret -ne 0 ]; then + echo "FAIL: no odp_pktio_ordered${EXEEXT}" + rm -f $LOG + exit $ret +fi if [ ! -f $LOG ]; then echo "FAIL: $LOG not found" ret=1 -elif [ $ret -eq 0 ]; then - MAX_PPS=$(awk '/TEST RESULT/ {print $3}' $LOG) - if [ "$MAX_PPS" -lt "$PASS_PPS" ]; then - echo "FAIL: pps below threshold $MAX_PPS < $PASS_PPS" - ret=1 - fi + exit $ret +fi + +MAX_PPS=$(awk '/TEST RESULT/ {print $3}' $LOG) +echo "MAX_PPS=$MAX_PPS" +if [ $MAX_PPS -lt $PASS_PPS ]; then + echo "FAIL: pps below threshold $MAX_PPS < $PASS_PPS" + ret=1 fi rm -f $LOG -- 2.11.0.295.gd7dffce