diff mbox

[v2] test: perf: l2fwd detect missing odp_generator

Message ID 1452693127-28492-1-git-send-email-mike.holmes@linaro.org
State Accepted
Commit b36af9d94ec28efbabb1f4402f83bacf96706ad5
Headers show

Commit Message

Mike Holmes Jan. 13, 2016, 1:52 p.m. UTC
The script did not check that the odp_generator was present.
Updates to ensure the clean up is always called at EXIT

Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
---
v2:
   Use stuarts suggetion to clean up the interfaces on EXIT

 test/performance/odp_l2fwd_run | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

Comments

Stuart Haslam Jan. 13, 2016, 3:27 p.m. UTC | #1
On Wed, Jan 13, 2016 at 08:52:07AM -0500, Mike Holmes wrote:
> The script did not check that the odp_generator was present.
> Updates to ensure the clean up is always called at EXIT
> 
> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>

Reviewed-by: Stuart Haslam <stuart.haslam@linaro.org>

> ---
> v2:
>    Use stuarts suggetion to clean up the interfaces on EXIT
> 
>  test/performance/odp_l2fwd_run | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/test/performance/odp_l2fwd_run b/test/performance/odp_l2fwd_run
> index 001d8c2..cab97a8 100755
> --- a/test/performance/odp_l2fwd_run
> +++ b/test/performance/odp_l2fwd_run
> @@ -48,12 +48,20 @@ fi
>  
>  run_l2fwd()
>  {
> -	setup_pktio_env
> +	setup_pktio_env clean # install trap to call cleanup_pktio_env
> +
>  	if [ $? -ne 0 ]; then
>  		echo "setup_pktio_env error $?"
>  		exit $TEST_SKIPPED
>  	fi
>  
> +	type odp_generator > /dev/null
> +	if [ $? -ne 0 ]; then
> +		echo "odp_generator not installed. Aborting."
> +		cleanup_pktio_env
> +		exit 1
> +	fi
> +
>  	#@todo: limit odp_generator to cores
>  	#https://bugs.linaro.org/show_bug.cgi?id=1398
>  	(odp_generator${EXEEXT} -I $IF0 \
> @@ -88,9 +96,6 @@ run_l2fwd()
>  
>  	rm -f $LOG
>  	cleanup_pktio_env
> -	if [ $? -ne 0 ]; then
> -		echo "cleanup_pktio_env error $?"
> -	fi
>  
>  	exit $ret
>  }
> -- 
> 2.5.0
>
Maxim Uvarov Jan. 15, 2016, 10:41 a.m. UTC | #2
Merged,
Maxim.

On 01/13/2016 18:27, Stuart Haslam wrote:
> On Wed, Jan 13, 2016 at 08:52:07AM -0500, Mike Holmes wrote:
>> The script did not check that the odp_generator was present.
>> Updates to ensure the clean up is always called at EXIT
>>
>> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
> Reviewed-by: Stuart Haslam <stuart.haslam@linaro.org>
>
>> ---
>> v2:
>>     Use stuarts suggetion to clean up the interfaces on EXIT
>>
>>   test/performance/odp_l2fwd_run | 13 +++++++++----
>>   1 file changed, 9 insertions(+), 4 deletions(-)
>>
>> diff --git a/test/performance/odp_l2fwd_run b/test/performance/odp_l2fwd_run
>> index 001d8c2..cab97a8 100755
>> --- a/test/performance/odp_l2fwd_run
>> +++ b/test/performance/odp_l2fwd_run
>> @@ -48,12 +48,20 @@ fi
>>   
>>   run_l2fwd()
>>   {
>> -	setup_pktio_env
>> +	setup_pktio_env clean # install trap to call cleanup_pktio_env
>> +
>>   	if [ $? -ne 0 ]; then
>>   		echo "setup_pktio_env error $?"
>>   		exit $TEST_SKIPPED
>>   	fi
>>   
>> +	type odp_generator > /dev/null
>> +	if [ $? -ne 0 ]; then
>> +		echo "odp_generator not installed. Aborting."
>> +		cleanup_pktio_env
>> +		exit 1
>> +	fi
>> +
>>   	#@todo: limit odp_generator to cores
>>   	#https://bugs.linaro.org/show_bug.cgi?id=1398
>>   	(odp_generator${EXEEXT} -I $IF0 \
>> @@ -88,9 +96,6 @@ run_l2fwd()
>>   
>>   	rm -f $LOG
>>   	cleanup_pktio_env
>> -	if [ $? -ne 0 ]; then
>> -		echo "cleanup_pktio_env error $?"
>> -	fi
>>   
>>   	exit $ret
>>   }
>> -- 
>> 2.5.0
>>
> _______________________________________________
> 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 001d8c2..cab97a8 100755
--- a/test/performance/odp_l2fwd_run
+++ b/test/performance/odp_l2fwd_run
@@ -48,12 +48,20 @@  fi
 
 run_l2fwd()
 {
-	setup_pktio_env
+	setup_pktio_env clean # install trap to call cleanup_pktio_env
+
 	if [ $? -ne 0 ]; then
 		echo "setup_pktio_env error $?"
 		exit $TEST_SKIPPED
 	fi
 
+	type odp_generator > /dev/null
+	if [ $? -ne 0 ]; then
+		echo "odp_generator not installed. Aborting."
+		cleanup_pktio_env
+		exit 1
+	fi
+
 	#@todo: limit odp_generator to cores
 	#https://bugs.linaro.org/show_bug.cgi?id=1398
 	(odp_generator${EXEEXT} -I $IF0 \
@@ -88,9 +96,6 @@  run_l2fwd()
 
 	rm -f $LOG
 	cleanup_pktio_env
-	if [ $? -ne 0 ]; then
-		echo "cleanup_pktio_env error $?"
-	fi
 
 	exit $ret
 }