-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test script for running `odp_dmafwd` with a few different scenarios during `make check`. Signed-off-by: Tuomas Taipale <tuomas.taipale@nokia.com>
- Loading branch information
1 parent
6aa73d4
commit 576dd30
Showing
3 changed files
with
71 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#!/bin/bash | ||
# | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
# Copyright (c) 2023 Nokia | ||
|
||
TEST_SRC_DIR=$(dirname $0) | ||
TEST_DIR="${TEST_DIR:-$(dirname $0)}" | ||
PCAP_FILE=dmafwd.pcap | ||
PCAP_IN=`find . ${TEST_SRC_DIR} $(dirname $0) -name ${PCAP_FILE} -print -quit` | ||
PCAP_OUT=dmafwd_out.pcap | ||
BIN_NAME=odp_dmafwd | ||
BATCH=10 | ||
TIME=3 | ||
TESTS_RUN=0 | ||
VALIN=valin | ||
VALOUT=valout | ||
|
||
if [ ! -f ${PCAP_IN} ]; then | ||
echo "FAILURE: ${PCAP_FILE} not found, exiting" | ||
exit 1 | ||
fi | ||
|
||
check_result() | ||
{ | ||
if [ $1 -eq 0 ]; then | ||
TESTS_RUN=`expr $TESTS_RUN + 1` | ||
elif [ $1 -eq 1 ]; then | ||
echo "Test FAILED, exiting" | ||
exit 1 | ||
else | ||
echo "Test SKIPPED" | ||
return 0 | ||
fi | ||
|
||
tcpdump -r ${PCAP_IN} -t -x > ${VALIN} | ||
tcpdump -r ${PCAP_OUT} -t -x > ${VALOUT} | ||
diff ${VALIN} ${VALOUT} | ||
local RET=$? | ||
rm -f ${PCAP_OUT} | ||
rm -f ${VALIN} | ||
rm -f ${VALOUT} | ||
|
||
if [ $RET -ne 0 ]; then | ||
echo "FAILURE: input and output captures do not match, exiting" | ||
exit 1 | ||
fi | ||
} | ||
|
||
echo "${BIN_NAME}: SW copy" | ||
echo "===================" | ||
|
||
${TEST_DIR}/${BIN_NAME}${EXEEXT} -i pcap:in=${PCAP_IN}:out=${PCAP_OUT} -b ${BATCH} -T ${TIME} -t 0 | ||
|
||
check_result $? | ||
|
||
echo "${BIN_NAME}: DMA copy" | ||
echo "====================" | ||
|
||
${TEST_DIR}/${BIN_NAME}${EXEEXT} -i pcap:in=${PCAP_IN}:out=${PCAP_OUT} -b ${BATCH} -T ${TIME} -t 1 | ||
|
||
check_result $? | ||
|
||
if [ $TESTS_RUN -eq 0 ]; then | ||
exit 77 | ||
fi | ||
|
||
exit 0 |