@@ -6,7 +6,7 @@ EXECUTABLES = odp_atomic
COMPILE_ONLY = odp_scheduling odp_l2fwd
-TESTSCRIPTS = odp_scheduling_run
+TESTSCRIPTS = odp_scheduling_run odp_l2fwd_run
if test_perf
TESTS = $(EXECUTABLES) $(TESTSCRIPTS)
new file mode 100755
@@ -0,0 +1,63 @@
+#!/bin/sh
+#
+# Copyright (c) 2015, Linaro Limited
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+
+TEST_DIR=$(dirname $0)
+
+# exit codes expected by automake for skipped tests
+TEST_SKIPPED=77
+
+# Use installed pktio env or for make check take it from platform directory
+if [ -f "./pktio_env" ]; then
+ . ./pktio_env
+else if [ "$ODP_PLATFORM" = "" ]; then
+ echo "$0: error: ODP_PLATFORM must be defined"
+ # not skipped as this should never happen via "make check"
+ exit 1
+else if [ -f ${TEST_DIR}/../../platform/$ODP_PLATFORM/test/pktio_env ]; then
+ . ${TEST_DIR}/../../platform/$ODP_PLATFORM/test/pktio_env
+else
+ echo "BUG: unable to find pktio_env!"
+ echo "pktio_env has to be in current directory or in platform/\$ODP_PLATFORM/test."
+ echo "ODP_PLATFORM=\"$ODP_PLATFORM\""
+ exit 1
+ fi
+fi
+fi
+
+run_l2fwd()
+{
+ setup_pktio_env
+ if [ $? -ne 0 ]; then
+ echo "setup_pktio_env error $?"
+ exit $TEST_SKIPPED
+ fi
+
+ #@todo: limit odp_generator to cores
+ #https://bugs.linaro.org/show_bug.cgi?id=1398
+ ($TEST_DIR/../../example/generator/odp_generator -I $IF0 \
+ --srcmac fe:0f:97:c9:e0:44 --dstmac 32:cb:9b:27:2f:1a \
+ --srcip 192.168.0.1 --dstip 192.168.0.2 -m u 2>&1 > /dev/null) \
+ 2>&1 > /dev/null &
+
+ echo "Run ./odp_l2fwd -i $IF1,$IF2 -m 0 -t 30 -c 2"
+ ./odp_l2fwd -i $IF1,$IF2 -m 0 -t 30 -c 2
+
+ cleanup_pktio_env
+ if [ $? -ne 0 ]; then
+ echo "cleanup_pktio_env error $?"
+ exit $TEST_SKIPPED
+ fi
+
+ exit 0
+}
+
+case "$1" in
+ setup) setup_pktio_env ;;
+ cleanup) cleanup_pktio_env ;;
+ *) run_l2fwd ;;
+esac
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> --- test/performance/Makefile.am | 2 +- test/performance/odp_l2fwd_run | 63 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100755 test/performance/odp_l2fwd_run