diff mbox

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

Message ID 1461594827-2205-3-git-send-email-maxim.uvarov@linaro.org
State Superseded
Headers show

Commit Message

Maxim Uvarov April 25, 2016, 2:33 p.m. UTC
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
---
 example/packet/.gitignore   |   3 +++
 example/packet/Makefile.am  |   7 ++++++
 example/packet/pktio_run.sh |  58 ++++++++++++++++++++++++++++++++++++++++++++
 example/packet/udp64.pcap   | Bin 0 -> 7624 bytes
 4 files changed, 68 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 26, 2016, 7:19 a.m. UTC | #1
Hi Maxim,

Couple small issues below.

-Matias

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

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

> Uvarov

> Sent: Monday, April 25, 2016 5:34 PM

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

> Subject: [lng-odp] [PATCHv4 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 |  58

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

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

>  4 files changed, 68 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..b3f0123

> --- /dev/null

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

> @@ -0,0 +1,58 @@

> +#!/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`

> +PCAP_OUT="pcapout.pcap"

> +PCAP_IN_SIZE=`stat -c %s ${PCAP_IN}`

> +echo "using PCAP in=${PCAP_IN}:out=${PCAP_OUT} size %${PCAP_IN_SIZE}"

> +

> +# burst mode

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

> +STATUS=$?

> +OUTSIZE=`stat -c %s ${PCAP_OUT}`


Should be PCAP_OUT_SIZE.

> +rm -f ${PCAP_OUT}

> +

> +if [ ${STATUS} -ne 0 ] || [ ${PCAP_IN_SIZE} -ne ${PCAP_OUT_SIZE} ]; then

> +	echo "Error: status ${STATUS}, in:${PCAP_IN_SIZE}

> out:${PCAP_OUT_SIZE}"

> +	exit 1

> +fi

> +

> +# queue mode

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

> +STATUS=$?

> +OUTSIZE=`stat -c %s ${PCAP_OUT}`


Should be PCAP_OUT_SIZE.

> +rm -f ${PCAP_OUT}

> +

> +if [ ${STATUS} -ne 0 ] || [ ${PCAP_IN_SIZE} -ne ${PCAP_OUT_SIZE} ]; then

> +	echo "Error: status ${STATUS}, in:${PCAP_IN_SIZE}

> out:${PCAP_OUT_SIZE}"

> +	exit 2

> +fi

> +

> +# sched/queue mode

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


Should be '-m 2'.

> +STATUS=$?

> +OUTSIZE=`stat -c %s ${PCAP_OUT}`


Should be PCAP_OUT_SIZE.

> +rm -f ${PCAP_OUT}

> +

> +if [ ${STATUS} -ne 0 ] || [ ${PCAP_IN_SIZE} -ne ${PCAP_OUT_SIZE} ]; then

> +	echo "Error: status ${STATUS}, in:${PCAP_IN_SIZE}

> out:${PCAP_OUT_SIZE}"

> +	exit 3

> +fi

> +

> +# cpu number option test 1

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

> +STATUS=$?

> +OUTSIZE=`stat -c %s ${PCAP_OUT}`


Should be PCAP_OUT_SIZE.

> +rm -f ${PCAP_OUT}

> +

> +if [ ${STATUS} -ne 0 ] || [ ${PCAP_IN_SIZE} -ne ${PCAP_OUT_SIZE} ]; then

> +	echo "Error: status ${STATUS}, in:${PCAP_IN_SIZE}

> out:${PCAP_OUT_SIZE}"

> +	exit 4

> +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 26, 2016, 8:53 a.m. UTC | #2
On 04/26/16 10:19, Elo, Matias (Nokia - FI/Espoo) wrote:
> Hi Maxim,
>
> Couple small issues below.
>
> -Matias

yes, thanks, a lot of copy pasted code :) Strange that it passed.

Maxim.
>
>> -----Original Message-----
>> From: lng-odp [mailto:lng-odp-bounces@lists.linaro.org] On Behalf Of EXT Maxim
>> Uvarov
>> Sent: Monday, April 25, 2016 5:34 PM
>> To: lng-odp@lists.linaro.org
>> Subject: [lng-odp] [PATCHv4 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 |  58
>> ++++++++++++++++++++++++++++++++++++++++++++
>>   example/packet/udp64.pcap   | Bin 0 -> 7624 bytes
>>   4 files changed, 68 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..b3f0123
>> --- /dev/null
>> +++ b/example/packet/pktio_run.sh
>> @@ -0,0 +1,58 @@
>> +#!/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`
>> +PCAP_OUT="pcapout.pcap"
>> +PCAP_IN_SIZE=`stat -c %s ${PCAP_IN}`
>> +echo "using PCAP in=${PCAP_IN}:out=${PCAP_OUT} size %${PCAP_IN_SIZE}"
>> +
>> +# burst mode
>> +./odp_pktio -ipcap:in=${PCAP_IN}:out=${PCAP_OUT} -t 5 -m 0
>> +STATUS=$?
>> +OUTSIZE=`stat -c %s ${PCAP_OUT}`
> Should be PCAP_OUT_SIZE.
>
>> +rm -f ${PCAP_OUT}
>> +
>> +if [ ${STATUS} -ne 0 ] || [ ${PCAP_IN_SIZE} -ne ${PCAP_OUT_SIZE} ]; then
>> +	echo "Error: status ${STATUS}, in:${PCAP_IN_SIZE}
>> out:${PCAP_OUT_SIZE}"
>> +	exit 1
>> +fi
>> +
>> +# queue mode
>> +./odp_pktio -ipcap:in=${PCAP_IN}:out=${PCAP_OUT} -t 5 -m 1
>> +STATUS=$?
>> +OUTSIZE=`stat -c %s ${PCAP_OUT}`
> Should be PCAP_OUT_SIZE.
>
>> +rm -f ${PCAP_OUT}
>> +
>> +if [ ${STATUS} -ne 0 ] || [ ${PCAP_IN_SIZE} -ne ${PCAP_OUT_SIZE} ]; then
>> +	echo "Error: status ${STATUS}, in:${PCAP_IN_SIZE}
>> out:${PCAP_OUT_SIZE}"
>> +	exit 2
>> +fi
>> +
>> +# sched/queue mode
>> +./odp_pktio -ipcap:in=${PCAP_IN}:out=${PCAP_OUT} -t 5 -m 1
> Should be '-m 2'.
>
>> +STATUS=$?
>> +OUTSIZE=`stat -c %s ${PCAP_OUT}`
> Should be PCAP_OUT_SIZE.
>
>> +rm -f ${PCAP_OUT}
>> +
>> +if [ ${STATUS} -ne 0 ] || [ ${PCAP_IN_SIZE} -ne ${PCAP_OUT_SIZE} ]; then
>> +	echo "Error: status ${STATUS}, in:${PCAP_IN_SIZE}
>> out:${PCAP_OUT_SIZE}"
>> +	exit 3
>> +fi
>> +
>> +# cpu number option test 1
>> +./odp_pktio -ipcap:in=${PCAP_IN}:out=${PCAP_OUT} -t 5 -m 0 -c 1
>> +STATUS=$?
>> +OUTSIZE=`stat -c %s ${PCAP_OUT}`
> Should be PCAP_OUT_SIZE.
>
>> +rm -f ${PCAP_OUT}
>> +
>> +if [ ${STATUS} -ne 0 ] || [ ${PCAP_IN_SIZE} -ne ${PCAP_OUT_SIZE} ]; then
>> +	echo "Error: status ${STATUS}, in:${PCAP_IN_SIZE}
>> out:${PCAP_OUT_SIZE}"
>> +	exit 4
>> +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
diff mbox

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..b3f0123
--- /dev/null
+++ b/example/packet/pktio_run.sh
@@ -0,0 +1,58 @@ 
+#!/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`
+PCAP_OUT="pcapout.pcap"
+PCAP_IN_SIZE=`stat -c %s ${PCAP_IN}`
+echo "using PCAP in=${PCAP_IN}:out=${PCAP_OUT} size %${PCAP_IN_SIZE}"
+
+# burst mode
+./odp_pktio -ipcap:in=${PCAP_IN}:out=${PCAP_OUT} -t 5 -m 0
+STATUS=$?
+OUTSIZE=`stat -c %s ${PCAP_OUT}`
+rm -f ${PCAP_OUT}
+
+if [ ${STATUS} -ne 0 ] || [ ${PCAP_IN_SIZE} -ne ${PCAP_OUT_SIZE} ]; then
+	echo "Error: status ${STATUS}, in:${PCAP_IN_SIZE} out:${PCAP_OUT_SIZE}"
+	exit 1
+fi
+
+# queue mode
+./odp_pktio -ipcap:in=${PCAP_IN}:out=${PCAP_OUT} -t 5 -m 1
+STATUS=$?
+OUTSIZE=`stat -c %s ${PCAP_OUT}`
+rm -f ${PCAP_OUT}
+
+if [ ${STATUS} -ne 0 ] || [ ${PCAP_IN_SIZE} -ne ${PCAP_OUT_SIZE} ]; then
+	echo "Error: status ${STATUS}, in:${PCAP_IN_SIZE} out:${PCAP_OUT_SIZE}"
+	exit 2
+fi
+
+# sched/queue mode
+./odp_pktio -ipcap:in=${PCAP_IN}:out=${PCAP_OUT} -t 5 -m 1
+STATUS=$?
+OUTSIZE=`stat -c %s ${PCAP_OUT}`
+rm -f ${PCAP_OUT}
+
+if [ ${STATUS} -ne 0 ] || [ ${PCAP_IN_SIZE} -ne ${PCAP_OUT_SIZE} ]; then
+	echo "Error: status ${STATUS}, in:${PCAP_IN_SIZE} out:${PCAP_OUT_SIZE}"
+	exit 3
+fi
+
+# cpu number option test 1
+./odp_pktio -ipcap:in=${PCAP_IN}:out=${PCAP_OUT} -t 5 -m 0 -c 1
+STATUS=$?
+OUTSIZE=`stat -c %s ${PCAP_OUT}`
+rm -f ${PCAP_OUT}
+
+if [ ${STATUS} -ne 0 ] || [ ${PCAP_IN_SIZE} -ne ${PCAP_OUT_SIZE} ]; then
+	echo "Error: status ${STATUS}, in:${PCAP_IN_SIZE} out:${PCAP_OUT_SIZE}"
+	exit 4
+fi
+
+exit 0