diff mbox

[PATCHv2] linux-generic: add vlan insertion test

Message ID 1477943619-9712-1-git-send-email-maxim.uvarov@linaro.org
State New
Headers show

Commit Message

Maxim Uvarov Oct. 31, 2016, 7:53 p.m. UTC
Use vlan tagged traffic for example validation test
to add code coverage for pkt_mmap_vlan_insert() internal
function.

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

---
 v2: update to current master.

 test/common_plat/validation/api/.gitignore |   1 +
 test/linux-generic/Makefile.am             |   5 ++++
 test/linux-generic/m4/configure.m4         |   1 +
 test/linux-generic/pktio/Makefile.am       |   4 +++
 test/linux-generic/pktio/pktio_run_vlan.sh |  46 +++++++++++++++++++++++++++++
 test/linux-generic/pktio/vlan.pcap         | Bin 0 -> 9728 bytes
 6 files changed, 57 insertions(+)
 create mode 100644 test/linux-generic/pktio/Makefile.am
 create mode 100755 test/linux-generic/pktio/pktio_run_vlan.sh
 create mode 100644 test/linux-generic/pktio/vlan.pcap

diff --git a/test/linux-generic/pktio/vlan.pcap b/test/linux-generic/pktio/vlan.pcap
new file mode 100644
index 0000000000000000000000000000000000000000..106ccb682e51495b4025337518a0bce63c2c7681
GIT binary patch
literal 9728
zcmeHNeQXrR6@R<F^Iq)3b|{=(C16{8IUt}71RM^-2~wIU*pOl>ikyh3QAN~9xK+}$
z4T)^-QnlAgC4W>Yk*X>mRlo92km}Nw!c|oiNTn)LBLcyK0BKSYLZiA0xI}f|@6FEc
z&CT8}Zu4i?dS2hYnK$pf`MuxF&iVB}9(>lN6zOYfipb#)S3BqRK6jeva#{)P%KZ4H
z2`Z!uf1f`})Rm#nP<lLnYk>-l2Nx8d?iyv8ohr8v56pV)=ly+yzZvNmzS?$(tvQ({
zN`3H(bKv=xSCLCcs6x0O=6jaXv{mjz%{=NyEc#gk|LwB0u=KHqz1)uIAM9Usn@mg_
zk2Z3jR&?;MUcTp8vTSb+>k8B@8d$;SEO~No<@;@ZpT?k%M|X%lk9|?s`aqYWyx8+Z
z0ekoid$_k!Cq3-<X$<;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ih&fKFqf!Wckb+_euHkKzNjM0<@#!v|j%=L2j_
H$A|v_$relS

literal 0
HcmV?d00001

-- 
2.7.1.250.gff4ea60

Comments

Christophe Milard Nov. 1, 2016, 9:43 a.m. UTC | #1
On 31 October 2016 at 20:53, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
> Use vlan tagged traffic for example validation test

> to add code coverage for pkt_mmap_vlan_insert() internal

> function.

>

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

> ---

>  v2: update to current master.

>

>  test/common_plat/validation/api/.gitignore |   1 +

>  test/linux-generic/Makefile.am             |   5 ++++

>  test/linux-generic/m4/configure.m4         |   1 +

>  test/linux-generic/pktio/Makefile.am       |   4 +++

>  test/linux-generic/pktio/pktio_run_vlan.sh |  46 +++++++++++++++++++++++++++++

>  test/linux-generic/pktio/vlan.pcap         | Bin 0 -> 9728 bytes

>  6 files changed, 57 insertions(+)

>  create mode 100644 test/linux-generic/pktio/Makefile.am

>  create mode 100755 test/linux-generic/pktio/pktio_run_vlan.sh

>  create mode 100644 test/linux-generic/pktio/vlan.pcap

>

> diff --git a/test/common_plat/validation/api/.gitignore b/test/common_plat/validation/api/.gitignore

> index 7e563b8..5f75e14 100644

> --- a/test/common_plat/validation/api/.gitignore

> +++ b/test/common_plat/validation/api/.gitignore

> @@ -1,2 +1,3 @@

>  *.log

>  *.trs

> +*.pcap

> diff --git a/test/linux-generic/Makefile.am b/test/linux-generic/Makefile.am


Why is this test platform specific? are we doing the same as for IPC,
here, i.e. adding linux-only functions?.
Which is raising -again- the problem if platform vs OS difference...
is platform specific the same as linux specific?
I am not sure it is a good idea to continue having specific APIs for,
linux-gen: Why can't we agree to have pcap support on all platforms?
We already had a specific case for IPC, and it did not turn create concensus.

> index 4660cf0..c926c1f 100644

> --- a/test/linux-generic/Makefile.am

> +++ b/test/linux-generic/Makefile.am

> @@ -37,11 +37,16 @@ TESTS = validation/api/pktio/pktio_run.sh \

>

>  SUBDIRS += validation/api/pktio\

>            validation/api/shmem\

> +          pktio\


The logic would be to have all platform specific (if this is regarded
a such) pktio tests under pktio. But if you have pktio_ipc, why would
this one be oktio only?

>            pktio_ipc\

>            ring

>

>  if HAVE_PCAP

>  TESTS += validation/api/pktio/pktio_run_pcap.sh

> +if test_example


Why "if test_example"? this is not the example directory!

> +TESTS += pktio/pktio_run_vlan.sh

> +SUBDIRS += pktio

> +endif

>  endif

>  if netmap_support

>  TESTS += validation/api/pktio/pktio_run_netmap.sh

> diff --git a/test/linux-generic/m4/configure.m4 b/test/linux-generic/m4/configure.m4

> index 6b92201..7793b84 100644

> --- a/test/linux-generic/m4/configure.m4

> +++ b/test/linux-generic/m4/configure.m4

> @@ -3,6 +3,7 @@ m4_include([test/linux-generic/m4/performance.m4])

>  AC_CONFIG_FILES([test/linux-generic/Makefile

>                  test/linux-generic/validation/api/shmem/Makefile

>                  test/linux-generic/validation/api/pktio/Makefile

> +                test/linux-generic/pktio/Makefile

>                  test/linux-generic/pktio_ipc/Makefile

>                  test/linux-generic/ring/Makefile

>                  test/linux-generic/performance/Makefile])

> diff --git a/test/linux-generic/pktio/Makefile.am b/test/linux-generic/pktio/Makefile.am

> new file mode 100644

> index 0000000..978ca27

> --- /dev/null

> +++ b/test/linux-generic/pktio/Makefile.am

> @@ -0,0 +1,4 @@

> +dist_check_SCRIPTS = vlan.pcap\

> +                    pktio_run_vlan.sh

> +

> +test_SCRIPTS = $(dist_check_SCRIPTS)

> diff --git a/test/linux-generic/pktio/pktio_run_vlan.sh b/test/linux-generic/pktio/pktio_run_vlan.sh

> new file mode 100755

> index 0000000..b12e488

> --- /dev/null

> +++ b/test/linux-generic/pktio/pktio_run_vlan.sh

> @@ -0,0 +1,46 @@

> +#!/bin/sh

> +#

> +# Copyright (c) 2016, Linaro Limited

> +# All rights reserved.

> +#

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

> +#

> +

> +#

> +# This test is intend to test pkt_mmap_vlan_insert() feature for

> +# linux-generic packet mmap pktio.

> +#

> +#

> +

> +# any parameter passed as arguments to this script is passed unchanged to

> +# the test itself (pktio_main)

> +

> +# directories where pktio_main binary can be found:

> +# -in the validation dir when running make check (intree or out of tree)

> +# -in the script directory, when running after 'make install', or

> +# -in the validation when running standalone intree.

> +# -in the current directory.

> +# running stand alone out of tree requires setting PATH

> +PATH=${TEST_DIR}/pktio:$PATH

> +PATH=$(dirname $0):$PATH

> +PATH=../../example/packet:$PATH


Test and examples should be separated. We had many of this cross
references in the past, which was a nightmare to (try to) remove. we
should not keep creating them.

Christophe

> +PATH=../../../_inst/bin:$PATH

> +PATH=.:$PATH

> +

> +odp_pktio_path=$(which odp_pktio${EXEEXT})

> +if [ -x "$odp_pktio_path" ] ; then

> +       echo "running with $odp_pktio_path"

> +else

> +       pwd

> +       echo $PATH

> +       echo "cannot find odp_pktio${EXEEXT}: please set you PATH for it."

> +       exit 1

> +fi

> +

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

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

> +PCAP_OUT=vlan_out.pcap

> +odp_pktio${EXEEXT} -ipcap:in=${PCAP_IN}:out=${PCAP_OUT} -t 1 -m 0

> +ret=$?

> +rm -f ${PCAP_OUT}

> +exit $ret

> diff --git a/test/linux-generic/pktio/vlan.pcap b/test/linux-generic/pktio/vlan.pcap

> new file mode 100644

> index 0000000000000000000000000000000000000000..106ccb682e51495b4025337518a0bce63c2c7681

> GIT binary patch

> literal 9728

> zcmeHNeQXrR6@R<F^Iq)3b|{=(C16{8IUt}71RM^-2~wIU*pOl>ikyh3QAN~9xK+}$

> z4T)^-QnlAgC4W>Yk*X>mRlo92km}Nw!c|oiNTn)LBLcyK0BKSYLZiA0xI}f|@6FEc

> z&CT8}Zu4i?dS2hYnK$pf`MuxF&iVB}9(>lN6zOYfipb#)S3BqRK6jeva#{)P%KZ4H

> z2`Z!uf1f`})Rm#nP<lLnYk>-l2Nx8d?iyv8ohr8v56pV)=ly+yzZvNmzS?$(tvQ({

> zN`3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2TP<&N=BqfRS9F>k(Zw`a|6ku?bs}H2&4@V19<y

> zID}Ini24?e_AhE5T`)?NmT%$iQtg$F&ri|}c4@KSDc;0y{aiISvdwh*S?0(k1@)&>

> zQ7plIU*=6|dR#J=D<oFhda1NSH5ognGq!{Y*RQl!v7!LwU*O1E{OJDRV*$_b-zLDq

> zQO3ei&J^yz0(2S+l^`1m3)&VifIih&fKFqf!Wckb+_euHkKzNjM0<@#!v|j%=L2j_

> H$A|v_$relS

>

> literal 0

> HcmV?d00001

>

> --

> 2.7.1.250.gff4ea60

>
Maxim Uvarov Nov. 1, 2016, 10:29 a.m. UTC | #2
On 1 November 2016 at 12:43, Christophe Milard <christophe.milard@linaro.org
> wrote:


> On 31 October 2016 at 20:53, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:

> > Use vlan tagged traffic for example validation test

> > to add code coverage for pkt_mmap_vlan_insert() internal

> > function.

> >

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

> > ---

> >  v2: update to current master.

> >

> >  test/common_plat/validation/api/.gitignore |   1 +

> >  test/linux-generic/Makefile.am             |   5 ++++

> >  test/linux-generic/m4/configure.m4         |   1 +

> >  test/linux-generic/pktio/Makefile.am       |   4 +++

> >  test/linux-generic/pktio/pktio_run_vlan.sh |  46

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

> >  test/linux-generic/pktio/vlan.pcap         | Bin 0 -> 9728 bytes

> >  6 files changed, 57 insertions(+)

> >  create mode 100644 test/linux-generic/pktio/Makefile.am

> >  create mode 100755 test/linux-generic/pktio/pktio_run_vlan.sh

> >  create mode 100644 test/linux-generic/pktio/vlan.pcap

> >

> > diff --git a/test/common_plat/validation/api/.gitignore

> b/test/common_plat/validation/api/.gitignore

> > index 7e563b8..5f75e14 100644

> > --- a/test/common_plat/validation/api/.gitignore

> > +++ b/test/common_plat/validation/api/.gitignore

> > @@ -1,2 +1,3 @@

> >  *.log

> >  *.trs

> > +*.pcap

> > diff --git a/test/linux-generic/Makefile.am

> b/test/linux-generic/Makefile.am

>

> Why is this test platform specific? are we doing the same as for IPC,

> here, i.e. adding linux-only functions?.

> Which is raising -again- the problem if platform vs OS difference...

> is platform specific the same as linux specific?

> I am not sure it is a good idea to continue having specific APIs for,

> linux-gen: Why can't we agree to have pcap support on all platforms?

> We already had a specific case for IPC, and it did not turn create

> concensus.

>

> > index 4660cf0..c926c1f 100644

> > --- a/test/linux-generic/Makefile.am

> > +++ b/test/linux-generic/Makefile.am

> > @@ -37,11 +37,16 @@ TESTS = validation/api/pktio/pktio_run.sh \

> >

> >  SUBDIRS += validation/api/pktio\

> >            validation/api/shmem\

> > +          pktio\

>

> The logic would be to have all platform specific (if this is regarded

> a such) pktio tests under pktio. But if you have pktio_ipc, why would

> this one be oktio only?

>

> >            pktio_ipc\

> >            ring

> >

> >  if HAVE_PCAP

> >  TESTS += validation/api/pktio/pktio_run_pcap.sh

> > +if test_example

>

> Why "if test_example"? this is not the example directory!

>

> > +TESTS += pktio/pktio_run_vlan.sh

> > +SUBDIRS += pktio

> > +endif

> >  endif

> >  if netmap_support

> >  TESTS += validation/api/pktio/pktio_run_netmap.sh

> > diff --git a/test/linux-generic/m4/configure.m4 b/test/linux-generic/m4/

> configure.m4

> > index 6b92201..7793b84 100644

> > --- a/test/linux-generic/m4/configure.m4

> > +++ b/test/linux-generic/m4/configure.m4

> > @@ -3,6 +3,7 @@ m4_include([test/linux-generic/m4/performance.m4])

> >  AC_CONFIG_FILES([test/linux-generic/Makefile

> >                  test/linux-generic/validation/api/shmem/Makefile

> >                  test/linux-generic/validation/api/pktio/Makefile

> > +                test/linux-generic/pktio/Makefile

> >                  test/linux-generic/pktio_ipc/Makefile

> >                  test/linux-generic/ring/Makefile

> >                  test/linux-generic/performance/Makefile])

> > diff --git a/test/linux-generic/pktio/Makefile.am

> b/test/linux-generic/pktio/Makefile.am

> > new file mode 100644

> > index 0000000..978ca27

> > --- /dev/null

> > +++ b/test/linux-generic/pktio/Makefile.am

> > @@ -0,0 +1,4 @@

> > +dist_check_SCRIPTS = vlan.pcap\

> > +                    pktio_run_vlan.sh

> > +

> > +test_SCRIPTS = $(dist_check_SCRIPTS)

> > diff --git a/test/linux-generic/pktio/pktio_run_vlan.sh

> b/test/linux-generic/pktio/pktio_run_vlan.sh

> > new file mode 100755

> > index 0000000..b12e488

> > --- /dev/null

> > +++ b/test/linux-generic/pktio/pktio_run_vlan.sh

> > @@ -0,0 +1,46 @@

> > +#!/bin/sh

> > +#

> > +# Copyright (c) 2016, Linaro Limited

> > +# All rights reserved.

> > +#

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

> > +#

> > +

> > +#

> > +# This test is intend to test pkt_mmap_vlan_insert() feature for

> > +# linux-generic packet mmap pktio.

> > +#

> > +#

> > +

> > +# any parameter passed as arguments to this script is passed unchanged

> to

> > +# the test itself (pktio_main)

> > +

> > +# directories where pktio_main binary can be found:

> > +# -in the validation dir when running make check (intree or out of tree)

> > +# -in the script directory, when running after 'make install', or

> > +# -in the validation when running standalone intree.

> > +# -in the current directory.

> > +# running stand alone out of tree requires setting PATH

> > +PATH=${TEST_DIR}/pktio:$PATH

> > +PATH=$(dirname $0):$PATH

> > +PATH=../../example/packet:$PATH

>

> Test and examples should be separated. We had many of this cross

> references in the past, which was a nightmare to (try to) remove. we

> should not keep creating them.

>

> Christophe

>

>


In general I 'play' pcap file with standard odp_pktio example. But I can
duplicate this code, not a problem.
It's linux-generic internal tests for code coverage. It should not touch
other platforms.

Maxim.



> > +PATH=../../../_inst/bin:$PATH

> > +PATH=.:$PATH

> > +

> > +odp_pktio_path=$(which odp_pktio${EXEEXT})

> > +if [ -x "$odp_pktio_path" ] ; then

> > +       echo "running with $odp_pktio_path"

> > +else

> > +       pwd

> > +       echo $PATH

> > +       echo "cannot find odp_pktio${EXEEXT}: please set you PATH for

> it."

> > +       exit 1

> > +fi

> > +

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

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

> > +PCAP_OUT=vlan_out.pcap

> > +odp_pktio${EXEEXT} -ipcap:in=${PCAP_IN}:out=${PCAP_OUT} -t 1 -m 0

> > +ret=$?

> > +rm -f ${PCAP_OUT}

> > +exit $ret

> > diff --git a/test/linux-generic/pktio/vlan.pcap

> b/test/linux-generic/pktio/vlan.pcap

> > new file mode 100644

> > index 0000000000000000000000000000000000000000..

> 106ccb682e51495b4025337518a0bce63c2c7681

> > GIT binary patch

> > literal 9728

> > zcmeHNeQXrR6@R<F^Iq)3b|{=(C16{8IUt}71RM^-2~wIU*pOl>ikyh3QAN~9xK+}$

> > z4T)^-QnlAgC4W>Yk*X>mRlo92km}Nw!c|oiNTn)LBLcyK0BKSYLZiA0xI}f|@6FEc

> > z&CT8}Zu4i?dS2hYnK$pf`MuxF&iVB}9(>lN6zOYfipb#)S3BqRK6jeva#{)P%KZ4H

> > z2`Z!uf1f`})Rm#nP<lLnYk>-l2Nx8d?iyv8ohr8v56pV)=ly+yzZvNmzS?$(tvQ({

> > zN`3H(bKv=xSCLCcs6x0O=6jaXv{mjz%{=NyEc#gk|LwB0u=KHqz1)uIAM9Usn@mg_

> > zk2Z3jR&?;MUcTp8vTSb+>k8B@8d$;SEO~No<@;@ZpT?k%M|X%lk9|?s`aqYWyx8+Z

> > z0ekoid$_k!Cq3-<X$<;!oI~ik=uuzyOrT5ATGkaPBO2JlXV}BNmHltQH1XBQqGIxB

> > zljw+U^mWzt`dC-+XBzhK8TN2Tj(!$l@3W%oreFHHd@xpu)``6eKOy$gmCxBdp4?km

> > zcOk;wono&-@A$eG`7XZiNzwWmd-x3haEHC`0}y;QvZ#0!b{bfxaRTgY=FeI7XemDg

> > zrt~v(2bR#*#*@ZM8*9~NW2GVr#A;%NVz9F1ZjF^e?ya$>uoBL#iIo(6N4XHj>S(MG

> > zeb3ib&#l6WQUqAxJ_;+1G%sQ<6jmy<(AQPlQ&<V@nONzj-$&R}SgBCO*Ck?w=N1@3

> > ztzC_<r?BGDHD4ECg)ywKqF4*@npnxu3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~d`YNjsQ!0+vN*2Ln_T-HGxxocg<Z{H-n@T)WE2V0J`$8Y@1

> > z4RoIL>tx#yoVIkz`Sa8B9XijSA(4^2mR}>0-BJ_Tss29B7e_YvoEaIu-^}r7-=$^F

> > z6~cGXX+DRoz`pSeQC2_O!0pfvZ7;gZocCA|HJ+)q%N#r>S}s!E9?#x$mpi>Ywi-))

> > zzlqPPulkI+{1I<Q$9P~!WW+Dz^Aho(8Sz_>=!jps-HaGs&hb6xvm83*LP+jfr{?Bf

> > zI_W|jxoaKf2D63d>gQgWH`vr!f<1NJC-ZiBu|or#2S`*D&f5H1L^1ZenkfFNqp0wI

> > zSNQ)QAvgyjv46|5;Cj<-r46np&s0uZI3frlYYB8{@6ZhP9)c)li1)B%M;7X4_~V3;

> > zweY?r!UwhjTaiBax{uQbVC0ia6YITCFtX0f?z#7McFRAtvy0s`aDWT^itOSU<``9e

> > z*o8Q9*E$t7pW+Ae-z3@9wtyG(Q9m~XI#usY+z*2OO@f;?E}jJRuan5`F(W(w6&+cA

> > zwHX;uyoe*XMIvi=PPq_Zq+RM4y2TP<&N=BqfRS9F>k(Zw`a|6ku?bs}H2&4@V19<y

> > zID}Ini24?e_AhE5T`)?NmT%$iQtg$F&ri|}c4@KSDc;0y{aiISvdwh*S?0(k1@)&>

> > zQ7plIU*=6|dR#J=D<oFhda1NSH5ognGq!{Y*RQl!v7!LwU*O1E{OJDRV*$_b-zLDq

> > zQO3ei&J^yz0(2S+l^`1m3)&VifIih&fKFqf!Wckb+_euHkKzNjM0<@#!v|j%=L2j_

> > H$A|v_$relS

> >

> > literal 0

> > HcmV?d00001

> >

> > --

> > 2.7.1.250.gff4ea60

> >

>
diff mbox

Patch

diff --git a/test/common_plat/validation/api/.gitignore b/test/common_plat/validation/api/.gitignore
index 7e563b8..5f75e14 100644
--- a/test/common_plat/validation/api/.gitignore
+++ b/test/common_plat/validation/api/.gitignore
@@ -1,2 +1,3 @@ 
 *.log
 *.trs
+*.pcap
diff --git a/test/linux-generic/Makefile.am b/test/linux-generic/Makefile.am
index 4660cf0..c926c1f 100644
--- a/test/linux-generic/Makefile.am
+++ b/test/linux-generic/Makefile.am
@@ -37,11 +37,16 @@  TESTS = validation/api/pktio/pktio_run.sh \
 
 SUBDIRS += validation/api/pktio\
 	   validation/api/shmem\
+	   pktio\
 	   pktio_ipc\
 	   ring
 
 if HAVE_PCAP
 TESTS += validation/api/pktio/pktio_run_pcap.sh
+if test_example
+TESTS += pktio/pktio_run_vlan.sh
+SUBDIRS += pktio
+endif
 endif
 if netmap_support
 TESTS += validation/api/pktio/pktio_run_netmap.sh
diff --git a/test/linux-generic/m4/configure.m4 b/test/linux-generic/m4/configure.m4
index 6b92201..7793b84 100644
--- a/test/linux-generic/m4/configure.m4
+++ b/test/linux-generic/m4/configure.m4
@@ -3,6 +3,7 @@  m4_include([test/linux-generic/m4/performance.m4])
 AC_CONFIG_FILES([test/linux-generic/Makefile
 		 test/linux-generic/validation/api/shmem/Makefile
 		 test/linux-generic/validation/api/pktio/Makefile
+		 test/linux-generic/pktio/Makefile
 		 test/linux-generic/pktio_ipc/Makefile
 		 test/linux-generic/ring/Makefile
 		 test/linux-generic/performance/Makefile])
diff --git a/test/linux-generic/pktio/Makefile.am b/test/linux-generic/pktio/Makefile.am
new file mode 100644
index 0000000..978ca27
--- /dev/null
+++ b/test/linux-generic/pktio/Makefile.am
@@ -0,0 +1,4 @@ 
+dist_check_SCRIPTS = vlan.pcap\
+		     pktio_run_vlan.sh
+
+test_SCRIPTS = $(dist_check_SCRIPTS)
diff --git a/test/linux-generic/pktio/pktio_run_vlan.sh b/test/linux-generic/pktio/pktio_run_vlan.sh
new file mode 100755
index 0000000..b12e488
--- /dev/null
+++ b/test/linux-generic/pktio/pktio_run_vlan.sh
@@ -0,0 +1,46 @@ 
+#!/bin/sh
+#
+# Copyright (c) 2016, Linaro Limited
+# All rights reserved.
+#
+# SPDX-License-Identifier:	BSD-3-Clause
+#
+
+#
+# This test is intend to test pkt_mmap_vlan_insert() feature for
+# linux-generic packet mmap pktio.
+#
+#
+
+# any parameter passed as arguments to this script is passed unchanged to
+# the test itself (pktio_main)
+
+# directories where pktio_main binary can be found:
+# -in the validation dir when running make check (intree or out of tree)
+# -in the script directory, when running after 'make install', or
+# -in the validation when running standalone intree.
+# -in the current directory.
+# running stand alone out of tree requires setting PATH
+PATH=${TEST_DIR}/pktio:$PATH
+PATH=$(dirname $0):$PATH
+PATH=../../example/packet:$PATH
+PATH=../../../_inst/bin:$PATH
+PATH=.:$PATH
+
+odp_pktio_path=$(which odp_pktio${EXEEXT})
+if [ -x "$odp_pktio_path" ] ; then
+	echo "running with $odp_pktio_path"
+else
+	pwd
+	echo $PATH
+	echo "cannot find odp_pktio${EXEEXT}: please set you PATH for it."
+	exit 1
+fi
+
+PCAP_IN=`find . ${TEST_DIR} $(dirname $0) -name vlan.pcap -print -quit`
+echo "using PCAP_IN = ${PCAP_IN}"
+PCAP_OUT=vlan_out.pcap
+odp_pktio${EXEEXT} -ipcap:in=${PCAP_IN}:out=${PCAP_OUT} -t 1 -m 0
+ret=$?
+rm -f ${PCAP_OUT}
+exit $ret