[PATCHv2,2/2] example: packet make check tests

Message ID 1461168154-6285-4-git-send-email-maxim.uvarov@linaro.org
State New
Headers show

Commit Message

Maxim Uvarov April 20, 2016, 4:02 p.m.
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
---
 example/packet/.gitignore   |   3 +++
 example/packet/Makefile.am  |   7 +++++++
 example/packet/pktio_run.sh |  48 ++++++++++++++++++++++++++++++++++++++++++++
 example/packet/udp64.pcap   | Bin 0 -> 7624 bytes
 4 files changed, 58 insertions(+)
 create mode 100755 example/packet/pktio_run.sh
 create mode 100644 example/packet/udp64.pcap

diff --git a/example/packet/udp64.pcap b/example/packet/udp64.pcap
new file mode 100644
index 0000000000000000000000000000000000000000..45f9d6e6341a331125e1e3e49ab8ad1e71b20712
GIT binary patch
literal 7624
zcmca|c+)~A1{MYw_+QV!zzF1AIDRVZQX4OW4Ui4OOdthJV3Lu8!IgnQ52VaNFl`SP
zPy-M%&2gOL#31#rG%+bTB{eNQBQq;ICpRy@ps;AvtkLiqO%tPeXtbOdEel8Mj?wyY
zv^_D}W*Ti5GK{vPNBat+eXG&_<7gilID#<RE*xzaj<yR&+l8a;!qKvDbPRcP%zboT
XVRY^UIO8<hE*$M6kM@y?=pzFFfL+O&

literal 0
HcmV?d00001

Comments

Elo, Matias (Nokia - FI/Espoo) April 25, 2016, 1:15 p.m. | #1
Some comments below.

-Matias

> -----Original Message-----

> From: lng-odp [mailto:lng-odp-bounces@lists.linaro.org] On Behalf Of EXT Maxim

> Uvarov

> Sent: Wednesday, April 20, 2016 7:03 PM

> To: lng-odp@lists.linaro.org

> Subject: [lng-odp] [PATCHv2 2/2] example: packet make check tests

> 

> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>

> ---

>  example/packet/.gitignore   |   3 +++

>  example/packet/Makefile.am  |   7 +++++++

>  example/packet/pktio_run.sh |  48

> ++++++++++++++++++++++++++++++++++++++++++++

>  example/packet/udp64.pcap   | Bin 0 -> 7624 bytes

>  4 files changed, 58 insertions(+)

>  create mode 100755 example/packet/pktio_run.sh

>  create mode 100644 example/packet/udp64.pcap

> 

> diff --git a/example/packet/.gitignore b/example/packet/.gitignore

> index 0a5c1ed..4610a19 100644

> --- a/example/packet/.gitignore

> +++ b/example/packet/.gitignore

> @@ -1 +1,4 @@

>  odp_pktio

> +*.log

> +*.trs

> +pcapout.pcap

> diff --git a/example/packet/Makefile.am b/example/packet/Makefile.am

> index a811234..af729b0 100644

> --- a/example/packet/Makefile.am

> +++ b/example/packet/Makefile.am

> @@ -8,3 +8,10 @@ noinst_HEADERS = \

>  		  $(top_srcdir)/example/example_debug.h

> 

>  dist_odp_pktio_SOURCES = odp_pktio.c

> +

> +if test_example

> +if HAVE_PCAP

> +TESTS = pktio_run.sh

> +endif

> +endif

> +EXTRA_DIST = pktio_run.sh udp64.pcap

> diff --git a/example/packet/pktio_run.sh b/example/packet/pktio_run.sh

> new file mode 100755

> index 0000000..737fcb9

> --- /dev/null

> +++ b/example/packet/pktio_run.sh

> @@ -0,0 +1,48 @@

> +#!/bin/bash

> +#

> +# Copyright (c) 2016, Linaro Limited

> +# All rights reserved.

> +#

> +# SPDX-License-Identifier:     BSD-3-Clause

> +#

> +

> +PCAP_IN=`find . ${TEST_DIR} $(dirname $0) -name udp64.pcap -print -quit`

> +echo "using PCAP_IN = ${PCAP_IN}"

> +

> +# burst mode

> +./odp_pktio -ipcap:in=${PCAP_IN} -t 5 -m 0


I had to change the interface to ' -ipcap:in=${PCAP_IN}:out=pcapout.pcap' to produce an output file.

> +STATUS=$?

> +rm -f pcapout.pcap


You could compare the size of the output file to the input file in the same manner as it is done in the l2fwd_simple and switch examples.

> +

> +if [ $STATUS -new 0 ]; then


Should probably be '> +if [ $STATUS -ne 0 ]; then'.

> +	exit $STATUS

> +fi

> +

> +# queue mode

> +./odp_pktio -ipcap:in=${PCAP_IN} -t 5 -m 1

> +STATUS=$?

> +rm -f pcapout.pcap

> +

> +if [ $STATUS -new 0 ]; then


Same as above.

> +	exit $STATUS

> +fi

> +

> +# sched/queue mode

> +./odp_pktio -ipcap:in=${PCAP_IN} -t 5 -m 1

> +STATUS=$?

> +rm -f pcapout.pcap

> +

> +if [ $STATUS -new 0 ]; then


Same as above.

> +	exit $STATUS

> +fi

> +

> +# cpu number option test 1

> +./odp_pktio -ipcap:in=${PCAP_IN} -t 5 -m 0 -c 1

> +STATUS=$?

> +rm -f pcapout.pcap

> +

> +if [ $STATUS -new 0 ]; then


Same as above.

> +	exit $STATUS

> +fi

> +

> +exit 0

> diff --git a/example/packet/udp64.pcap b/example/packet/udp64.pcap

> new file mode 100644

> index

> 0000000000000000000000000000000000000000..45f9d6e6341a331125e1e3e49ab8a

> d1e71b20712

> GIT binary patch

> literal 7624

> zcmca|c+)~A1{MYw_+QV!zzF1AIDRVZQX4OW4Ui4OOdthJV3Lu8!IgnQ52VaNFl`SP

> zPy-

> M%&2gOL#31#rG%+bTB{eNQBQq;ICpRy@ps;AvtkLiqO%tPeXtbOdEel8Mj?wyY

> zv^_D}W*Ti5GK{vPNBat+eXG&_<7gilID#<RE*xzaj<yR&+l8a;!qKvDbPRcP%zboT

> XVRY^UIO8<hE*$M6kM@y?=pzFFfL+O&

> 

> literal 0

> HcmV?d00001

> 

> --

> 2.7.1.250.gff4ea60

> 

> _______________________________________________

> lng-odp mailing list

> lng-odp@lists.linaro.org

> https://lists.linaro.org/mailman/listinfo/lng-odp
Maxim Uvarov April 25, 2016, 1:18 p.m. | #2
On 04/25/16 16:15, Elo, Matias (Nokia - FI/Espoo) wrote:
> Some comments below.
>
> -Matias
>
>> -----Original Message-----
>> From: lng-odp [mailto:lng-odp-bounces@lists.linaro.org] On Behalf Of EXT Maxim
>> Uvarov
>> Sent: Wednesday, April 20, 2016 7:03 PM
>> To: lng-odp@lists.linaro.org
>> Subject: [lng-odp] [PATCHv2 2/2] example: packet make check tests
>>
>> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
>> ---
>>   example/packet/.gitignore   |   3 +++
>>   example/packet/Makefile.am  |   7 +++++++
>>   example/packet/pktio_run.sh |  48
>> ++++++++++++++++++++++++++++++++++++++++++++
>>   example/packet/udp64.pcap   | Bin 0 -> 7624 bytes
>>   4 files changed, 58 insertions(+)
>>   create mode 100755 example/packet/pktio_run.sh
>>   create mode 100644 example/packet/udp64.pcap
>>
>> diff --git a/example/packet/.gitignore b/example/packet/.gitignore
>> index 0a5c1ed..4610a19 100644
>> --- a/example/packet/.gitignore
>> +++ b/example/packet/.gitignore
>> @@ -1 +1,4 @@
>>   odp_pktio
>> +*.log
>> +*.trs
>> +pcapout.pcap
>> diff --git a/example/packet/Makefile.am b/example/packet/Makefile.am
>> index a811234..af729b0 100644
>> --- a/example/packet/Makefile.am
>> +++ b/example/packet/Makefile.am
>> @@ -8,3 +8,10 @@ noinst_HEADERS = \
>>   		  $(top_srcdir)/example/example_debug.h
>>
>>   dist_odp_pktio_SOURCES = odp_pktio.c
>> +
>> +if test_example
>> +if HAVE_PCAP
>> +TESTS = pktio_run.sh
>> +endif
>> +endif
>> +EXTRA_DIST = pktio_run.sh udp64.pcap
>> diff --git a/example/packet/pktio_run.sh b/example/packet/pktio_run.sh
>> new file mode 100755
>> index 0000000..737fcb9
>> --- /dev/null
>> +++ b/example/packet/pktio_run.sh
>> @@ -0,0 +1,48 @@
>> +#!/bin/bash
>> +#
>> +# Copyright (c) 2016, Linaro Limited
>> +# All rights reserved.
>> +#
>> +# SPDX-License-Identifier:     BSD-3-Clause
>> +#
>> +
>> +PCAP_IN=`find . ${TEST_DIR} $(dirname $0) -name udp64.pcap -print -quit`
>> +echo "using PCAP_IN = ${PCAP_IN}"
>> +
>> +# burst mode
>> +./odp_pktio -ipcap:in=${PCAP_IN} -t 5 -m 0
> I had to change the interface to ' -ipcap:in=${PCAP_IN}:out=pcapout.pcap' to produce an output file.

Interesting. I did that at initial version. Then found event if I did 
not specify out, that out file is created.

>> +STATUS=$?
>> +rm -f pcapout.pcap
> You could compare the size of the output file to the input file in the same manner as it is done in the l2fwd_simple and switch examples.
>
>> +
>> +if [ $STATUS -new 0 ]; then
> Should probably be '> +if [ $STATUS -ne 0 ]; then'.

yes definitely, looks like it was to late and added and copy paste -new 
everywhere.
>> +	exit $STATUS
>> +fi
>> +
>> +# queue mode
>> +./odp_pktio -ipcap:in=${PCAP_IN} -t 5 -m 1
>> +STATUS=$?
>> +rm -f pcapout.pcap
>> +
>> +if [ $STATUS -new 0 ]; then
> Same as above.
>
>> +	exit $STATUS
>> +fi
>> +
>> +# sched/queue mode
>> +./odp_pktio -ipcap:in=${PCAP_IN} -t 5 -m 1
>> +STATUS=$?
>> +rm -f pcapout.pcap
>> +
>> +if [ $STATUS -new 0 ]; then
> Same as above.
>
>> +	exit $STATUS
>> +fi
>> +
>> +# cpu number option test 1
>> +./odp_pktio -ipcap:in=${PCAP_IN} -t 5 -m 0 -c 1
>> +STATUS=$?
>> +rm -f pcapout.pcap
>> +
>> +if [ $STATUS -new 0 ]; then
> Same as above.
>
>> +	exit $STATUS
>> +fi
>> +
>> +exit 0
>> diff --git a/example/packet/udp64.pcap b/example/packet/udp64.pcap
>> new file mode 100644
>> index
>> 0000000000000000000000000000000000000000..45f9d6e6341a331125e1e3e49ab8a
>> d1e71b20712
>> GIT binary patch
>> literal 7624
>> zcmca|c+)~A1{MYw_+QV!zzF1AIDRVZQX4OW4Ui4OOdthJV3Lu8!IgnQ52VaNFl`SP
>> zPy-
>> M%&2gOL#31#rG%+bTB{eNQBQq;ICpRy@ps;AvtkLiqO%tPeXtbOdEel8Mj?wyY
>> zv^_D}W*Ti5GK{vPNBat+eXG&_<7gilID#<RE*xzaj<yR&+l8a;!qKvDbPRcP%zboT
>> XVRY^UIO8<hE*$M6kM@y?=pzFFfL+O&
>>
>> literal 0
>> HcmV?d00001
>>
>> --
>> 2.7.1.250.gff4ea60
>>
>> _______________________________________________
>> lng-odp mailing list
>> lng-odp@lists.linaro.org
>> https://lists.linaro.org/mailman/listinfo/lng-odp

Patch

diff --git a/example/packet/.gitignore b/example/packet/.gitignore
index 0a5c1ed..4610a19 100644
--- a/example/packet/.gitignore
+++ b/example/packet/.gitignore
@@ -1 +1,4 @@ 
 odp_pktio
+*.log
+*.trs
+pcapout.pcap
diff --git a/example/packet/Makefile.am b/example/packet/Makefile.am
index a811234..af729b0 100644
--- a/example/packet/Makefile.am
+++ b/example/packet/Makefile.am
@@ -8,3 +8,10 @@  noinst_HEADERS = \
 		  $(top_srcdir)/example/example_debug.h
 
 dist_odp_pktio_SOURCES = odp_pktio.c
+
+if test_example
+if HAVE_PCAP
+TESTS = pktio_run.sh
+endif
+endif
+EXTRA_DIST = pktio_run.sh udp64.pcap
diff --git a/example/packet/pktio_run.sh b/example/packet/pktio_run.sh
new file mode 100755
index 0000000..737fcb9
--- /dev/null
+++ b/example/packet/pktio_run.sh
@@ -0,0 +1,48 @@ 
+#!/bin/bash
+#
+# Copyright (c) 2016, Linaro Limited
+# All rights reserved.
+#
+# SPDX-License-Identifier:     BSD-3-Clause
+#
+
+PCAP_IN=`find . ${TEST_DIR} $(dirname $0) -name udp64.pcap -print -quit`
+echo "using PCAP_IN = ${PCAP_IN}"
+
+# burst mode
+./odp_pktio -ipcap:in=${PCAP_IN} -t 5 -m 0
+STATUS=$?
+rm -f pcapout.pcap
+
+if [ $STATUS -new 0 ]; then
+	exit $STATUS
+fi
+
+# queue mode
+./odp_pktio -ipcap:in=${PCAP_IN} -t 5 -m 1
+STATUS=$?
+rm -f pcapout.pcap
+
+if [ $STATUS -new 0 ]; then
+	exit $STATUS
+fi
+
+# sched/queue mode
+./odp_pktio -ipcap:in=${PCAP_IN} -t 5 -m 1
+STATUS=$?
+rm -f pcapout.pcap
+
+if [ $STATUS -new 0 ]; then
+	exit $STATUS
+fi
+
+# cpu number option test 1
+./odp_pktio -ipcap:in=${PCAP_IN} -t 5 -m 0 -c 1
+STATUS=$?
+rm -f pcapout.pcap
+
+if [ $STATUS -new 0 ]; then
+	exit $STATUS
+fi
+
+exit 0