Enable application testing using pcap pktio.

Signed-off-by: Matias Elo <matias....@nokia.com>
---
v5:
- Loop pcap input file LOOPS times to better test application throughput (Maxim)

 test/common_plat/performance/Makefile.am           |   1 +
 .../performance/odp_pktio_ordered_run.sh           |  42 +++++++++++++++++++++
 test/common_plat/performance/udp64.pcap            | Bin 0 -> 7624 bytes
 3 files changed, 43 insertions(+)
 create mode 100755 test/common_plat/performance/odp_pktio_ordered_run.sh
 create mode 100644 test/common_plat/performance/udp64.pcap

diff --git a/test/common_plat/performance/Makefile.am 
b/test/common_plat/performance/Makefile.am
index 790ddae..2de07aa 100644
--- a/test/common_plat/performance/Makefile.am
+++ b/test/common_plat/performance/Makefile.am
@@ -10,6 +10,7 @@ COMPILE_ONLY = odp_l2fwd$(EXEEXT) \
               odp_scheduling$(EXEEXT)
 
 TESTSCRIPTS = odp_l2fwd_run.sh \
+             odp_pktio_ordered_run.sh \
              odp_sched_latency_run.sh \
              odp_scheduling_run.sh
 
diff --git a/test/common_plat/performance/odp_pktio_ordered_run.sh 
b/test/common_plat/performance/odp_pktio_ordered_run.sh
new file mode 100755
index 0000000..d91211c
--- /dev/null
+++ b/test/common_plat/performance/odp_pktio_ordered_run.sh
@@ -0,0 +1,42 @@
+#!/bin/bash
+#
+# Copyright (c) 2016, Linaro Limited
+# All rights reserved.
+#
+# SPDX-License-Identifier:     BSD-3-Clause
+#
+
+DURATION=5
+LOG=odp_pktio_ordered.log
+LOOPS=100000000
+PASS_PPS=5000
+PCAP_IN=`find . ${TEST_DIR} $(dirname $0) -name udp64.pcap -print -quit`
+PCAP_OUT=/dev/null
+
+# This just turns off output buffering so that you still get periodic
+# output while piping to tee, as long as stdbuf is available.
+if [ "$(which stdbuf)" != "" ]; then
+       STDBUF="stdbuf -o 0"
+else
+       STDBUF=
+fi
+
+$STDBUF ./odp_pktio_ordered${EXEEXT} -i pcap:in=${PCAP_IN}:loops=$LOOPS,\
+pcap:out=${PCAP_OUT} -t $DURATION | tee $LOG
+
+ret=$?
+
+if [ ! -f $LOG ]; then
+       echo "FAIL: $LOG not found"
+       ret=1
+elif [ $ret -eq 0 ]; then
+       MAX_PPS=$(awk '/TEST RESULT/ {print $3}' $LOG)
+       if [ "$MAX_PPS" -lt "$PASS_PPS" ]; then
+               echo "FAIL: pps below threshold $MAX_PPS < $PASS_PPS"
+               ret=1
+       fi
+fi
+
+rm -f $LOG
+
+exit $ret
diff --git a/test/common_plat/performance/udp64.pcap 
b/test/common_plat/performance/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

-- 
2.7.4

Reply via email to