aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/test/performance/dmafwd/pktio_env
diff options
context:
space:
mode:
Diffstat (limited to 'platform/linux-generic/test/performance/dmafwd/pktio_env')
-rw-r--r--platform/linux-generic/test/performance/dmafwd/pktio_env57
1 files changed, 57 insertions, 0 deletions
diff --git a/platform/linux-generic/test/performance/dmafwd/pktio_env b/platform/linux-generic/test/performance/dmafwd/pktio_env
new file mode 100644
index 000000000..91075973e
--- /dev/null
+++ b/platform/linux-generic/test/performance/dmafwd/pktio_env
@@ -0,0 +1,57 @@
+#!/bin/sh
+#
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2023 Nokia
+
+PCAP_IN=`find . ${TEST_DIR} $(dirname $0) -name udp64.pcap -print -quit`
+PCAP_OUT=dmafwd_out.pcap
+IF0=pcap:in=${PCAP_IN}:out=${PCAP_OUT}
+DUMP=tcpdump
+
+if [ "$0" = "$BASH_SOURCE" ]; then
+ echo "ERROR: Platform specific env file has to be sourced."
+fi
+
+validate_result()
+{
+ local RET=0
+
+ if command -v ${DUMP}; then
+ local VALIN=valin
+ local VALOUT=valout
+
+ ${DUMP} -r ${PCAP_IN} -t -x > ${VALIN}
+ ${DUMP} -r ${PCAP_OUT} -t -x > ${VALOUT}
+ diff ${VALIN} ${VALOUT}
+ RET=$?
+ rm -f ${VALIN}
+ rm -f ${VALOUT}
+ else
+ echo "WARNING: No ${DUMP} available, using \"stat\" for diff"
+ local SZIN=$(stat -c %s ${PCAP_IN})
+ local SZOUT=$(stat -c %s ${PCAP_OUT})
+
+ if [ ${SZIN} -ne ${SZOUT} ]; then
+ RET=1
+ fi
+ fi
+
+ rm -f ${PCAP_OUT}
+
+ if [ $RET -ne 0 ]; then
+ echo "ERROR: Input and output captures do not match, exiting"
+ exit 1
+ fi
+
+ return 0
+}
+
+setup_interfaces()
+{
+ return 0
+}
+
+cleanup_interfaces()
+{
+ return 0
+}