@@ -1 +1,4 @@
odp_pktio
+*.log
+*.trs
+pcapout.pcap
@@ -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
new file mode 100755
@@ -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
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