diff mbox

test: performance: set a packet rate pass threshold for l2fwd

Message ID 1447254087-13353-1-git-send-email-stuart.haslam@linaro.org
State Accepted
Commit f39224febeed74296beaa04dd65068b3a38ecb2e
Headers show

Commit Message

Stuart Haslam Nov. 11, 2015, 3:01 p.m. UTC
Report a failure if the maximum achieved packet rate is less than a
predefined threshold (currently set at 5000pps).

Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org>
---
 test/performance/odp_l2fwd_run | 25 ++++++++++++++++++++++---
 1 file changed, 22 insertions(+), 3 deletions(-)

Comments

Stuart Haslam Dec. 10, 2015, 2:07 p.m. UTC | #1
ping

odp_generator appears to be broken on master, this would've caught it.

Stuart.

On 11 November 2015 at 15:01, Stuart Haslam <stuart.haslam@linaro.org> wrote:
> Report a failure if the maximum achieved packet rate is less than a
> predefined threshold (currently set at 5000pps).
>
> Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org>
> ---
>  test/performance/odp_l2fwd_run | 25 ++++++++++++++++++++++---
>  1 file changed, 22 insertions(+), 3 deletions(-)
>
> diff --git a/test/performance/odp_l2fwd_run b/test/performance/odp_l2fwd_run
> index e0c61e7..001d8c2 100755
> --- a/test/performance/odp_l2fwd_run
> +++ b/test/performance/odp_l2fwd_run
> @@ -61,16 +61,35 @@ run_l2fwd()
>                         2>&1 > /dev/null &
>         GEN_PID=$!
>
> -       echo "Run odp_l2fwd -i $IF1,$IF2 -m 0 -t 30 -c 2"
> -       odp_l2fwd${EXEEXT} -i $IF1,$IF2 -m 0 -t 30 -c 2
> +       # this just turns off output buffering so that you still get periodic
> +       # output while piping to tee, as long as stdbuf is available.
> +       if [ "$(which stdbuf)" != "" ]; then
> +               STDBUF="stdbuf -o 0"
> +       else
> +               STDBUF=
> +       fi
> +       LOG=odp_l2fwd_tmp.log
> +       $STDBUF odp_l2fwd${EXEEXT} -i $IF1,$IF2 -m 0 -t 30 -c 2 | tee $LOG
>         ret=$?
>
>         kill ${GEN_PID}
>
> +       if [ ! -f $LOG ]; then
> +               echo "FAIL: $LOG not found"
> +               ret=1
> +       elif [ $ret -eq 0 ]; then
> +               PASS_PPS=5000
> +               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
> +       fi
> +
> +       rm -f $LOG
>         cleanup_pktio_env
>         if [ $? -ne 0 ]; then
>                 echo "cleanup_pktio_env error $?"
> -               exit $TEST_SKIPPED
>         fi
>
>         exit $ret
> --
> 2.1.1
>
Maxim Uvarov Dec. 10, 2015, 2:30 p.m. UTC | #2
On 12/10/2015 17:07, Stuart Haslam wrote:
> ping
>
> odp_generator appears to be broken on master, this would've caught it.
>
> Stuart.
Thank we need to fix it and then apply that patch.

Maxim.

>
> On 11 November 2015 at 15:01, Stuart Haslam <stuart.haslam@linaro.org> wrote:
>> Report a failure if the maximum achieved packet rate is less than a
>> predefined threshold (currently set at 5000pps).
>>
>> Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org>
>> ---
>>   test/performance/odp_l2fwd_run | 25 ++++++++++++++++++++++---
>>   1 file changed, 22 insertions(+), 3 deletions(-)
>>
>> diff --git a/test/performance/odp_l2fwd_run b/test/performance/odp_l2fwd_run
>> index e0c61e7..001d8c2 100755
>> --- a/test/performance/odp_l2fwd_run
>> +++ b/test/performance/odp_l2fwd_run
>> @@ -61,16 +61,35 @@ run_l2fwd()
>>                          2>&1 > /dev/null &
>>          GEN_PID=$!
>>
>> -       echo "Run odp_l2fwd -i $IF1,$IF2 -m 0 -t 30 -c 2"
>> -       odp_l2fwd${EXEEXT} -i $IF1,$IF2 -m 0 -t 30 -c 2
>> +       # this just turns off output buffering so that you still get periodic
>> +       # output while piping to tee, as long as stdbuf is available.
>> +       if [ "$(which stdbuf)" != "" ]; then
>> +               STDBUF="stdbuf -o 0"
>> +       else
>> +               STDBUF=
>> +       fi
>> +       LOG=odp_l2fwd_tmp.log
>> +       $STDBUF odp_l2fwd${EXEEXT} -i $IF1,$IF2 -m 0 -t 30 -c 2 | tee $LOG
>>          ret=$?
>>
>>          kill ${GEN_PID}
>>
>> +       if [ ! -f $LOG ]; then
>> +               echo "FAIL: $LOG not found"
>> +               ret=1
>> +       elif [ $ret -eq 0 ]; then
>> +               PASS_PPS=5000
>> +               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
>> +       fi
>> +
>> +       rm -f $LOG
>>          cleanup_pktio_env
>>          if [ $? -ne 0 ]; then
>>                  echo "cleanup_pktio_env error $?"
>> -               exit $TEST_SKIPPED
>>          fi
>>
>>          exit $ret
>> --
>> 2.1.1
>>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
Maxim Uvarov Dec. 11, 2015, 7:16 a.m. UTC | #3
Merged.
Maxim.

On 12/10/2015 17:07, Stuart Haslam wrote:
> ping
>
> odp_generator appears to be broken on master, this would've caught it.
>
> Stuart.
>
> On 11 November 2015 at 15:01, Stuart Haslam <stuart.haslam@linaro.org> wrote:
>> Report a failure if the maximum achieved packet rate is less than a
>> predefined threshold (currently set at 5000pps).
>>
>> Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org>
>> ---
>>   test/performance/odp_l2fwd_run | 25 ++++++++++++++++++++++---
>>   1 file changed, 22 insertions(+), 3 deletions(-)
>>
>> diff --git a/test/performance/odp_l2fwd_run b/test/performance/odp_l2fwd_run
>> index e0c61e7..001d8c2 100755
>> --- a/test/performance/odp_l2fwd_run
>> +++ b/test/performance/odp_l2fwd_run
>> @@ -61,16 +61,35 @@ run_l2fwd()
>>                          2>&1 > /dev/null &
>>          GEN_PID=$!
>>
>> -       echo "Run odp_l2fwd -i $IF1,$IF2 -m 0 -t 30 -c 2"
>> -       odp_l2fwd${EXEEXT} -i $IF1,$IF2 -m 0 -t 30 -c 2
>> +       # this just turns off output buffering so that you still get periodic
>> +       # output while piping to tee, as long as stdbuf is available.
>> +       if [ "$(which stdbuf)" != "" ]; then
>> +               STDBUF="stdbuf -o 0"
>> +       else
>> +               STDBUF=
>> +       fi
>> +       LOG=odp_l2fwd_tmp.log
>> +       $STDBUF odp_l2fwd${EXEEXT} -i $IF1,$IF2 -m 0 -t 30 -c 2 | tee $LOG
>>          ret=$?
>>
>>          kill ${GEN_PID}
>>
>> +       if [ ! -f $LOG ]; then
>> +               echo "FAIL: $LOG not found"
>> +               ret=1
>> +       elif [ $ret -eq 0 ]; then
>> +               PASS_PPS=5000
>> +               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
>> +       fi
>> +
>> +       rm -f $LOG
>>          cleanup_pktio_env
>>          if [ $? -ne 0 ]; then
>>                  echo "cleanup_pktio_env error $?"
>> -               exit $TEST_SKIPPED
>>          fi
>>
>>          exit $ret
>> --
>> 2.1.1
>>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
diff mbox

Patch

diff --git a/test/performance/odp_l2fwd_run b/test/performance/odp_l2fwd_run
index e0c61e7..001d8c2 100755
--- a/test/performance/odp_l2fwd_run
+++ b/test/performance/odp_l2fwd_run
@@ -61,16 +61,35 @@  run_l2fwd()
 			2>&1 > /dev/null &
 	GEN_PID=$!
 
-	echo "Run odp_l2fwd -i $IF1,$IF2 -m 0 -t 30 -c 2"
-	odp_l2fwd${EXEEXT} -i $IF1,$IF2 -m 0 -t 30 -c 2
+	# this just turns off output buffering so that you still get periodic
+	# output while piping to tee, as long as stdbuf is available.
+	if [ "$(which stdbuf)" != "" ]; then
+		STDBUF="stdbuf -o 0"
+	else
+		STDBUF=
+	fi
+	LOG=odp_l2fwd_tmp.log
+	$STDBUF odp_l2fwd${EXEEXT} -i $IF1,$IF2 -m 0 -t 30 -c 2 | tee $LOG
 	ret=$?
 
 	kill ${GEN_PID}
 
+	if [ ! -f $LOG ]; then
+		echo "FAIL: $LOG not found"
+		ret=1
+	elif [ $ret -eq 0 ]; then
+		PASS_PPS=5000
+		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
+	fi
+
+	rm -f $LOG
 	cleanup_pktio_env
 	if [ $? -ne 0 ]; then
 		echo "cleanup_pktio_env error $?"
-		exit $TEST_SKIPPED
 	fi
 
 	exit $ret