@@ -297,6 +297,7 @@ AC_CONFIG_FILES([Makefile
helper/test/Makefile
pkgconfig/libodp.pc
platform/linux-generic/Makefile
+ platform/linux-generic/test/pktio/Makefile
test/Makefile
test/api_test/Makefile
test/performance/Makefile
new file mode 100644
@@ -0,0 +1,2 @@
+*.log
+*.trs
@@ -1 +1,7 @@
-dist_bin_SCRIPTS = $(srcdir)/pktio_env
+
+if test_vald
+TESTS = pktio/pktio_run
+endif
+
+ODP_MODULES = pktio
+SUBDIRS = $(ODP_MODULES)
new file mode 100644
@@ -0,0 +1,2 @@
+*.log
+*.trs
new file mode 100644
@@ -0,0 +1,2 @@
+dist_bin_SCRIPTS = pktio_env \
+ pktio_run
similarity index 100%
rename from platform/linux-generic/test/pktio_env
rename to platform/linux-generic/test/pktio/pktio_env
similarity index 71%
rename from test/validation/pktio/pktio_run
rename to platform/linux-generic/test/pktio/pktio_run
@@ -13,15 +13,10 @@
# 1. user build ODP in the same dir as the source (most likely)
# here the user can simply call pktio_run
# 2. user may have built ODP in a separate build dir (like bitbake usually does)
-# here the user has to do something like $ODP/test/validation/pktio_run
-#
-# In both situations the script assumes that the user is in the directory where
-# pktio_main exists. If that's not true, then the user has to specify the path
-# to it and run:
-# TEST_DIR=$builddir $ODP/test/validation/pktio_run
+# here the user has to do something like $ODP/platform/linux-generic/test/pktio/pktio_run
# directory where test binaries have been built
-TEST_DIR="${TEST_DIR:-$PWD}"
+TEST_DIR="${TEST_DIR:-$PWD}/../../../test/validation/pktio"
# directory where test sources are, including scripts
TEST_SRC_DIR=$(dirname $0)
@@ -33,12 +28,8 @@ TEST_SKIPPED=77
# Use installed pktio env or for make check take it from platform directory
if [ -f "./pktio_env" ]; then
. ./pktio_env
-elif [ "$ODP_PLATFORM" = "" ]; then
- echo "$0: error: ODP_PLATFORM must be defined"
- # not skipped as this should never happen via "make check"
- exit 1
-elif [ -f ${TEST_SRC_DIR}/../../../platform/$ODP_PLATFORM/test/pktio_env ]; then
- . ${TEST_SRC_DIR}/../../../platform/$ODP_PLATFORM/test/pktio_env
+elif [ -f ${TEST_SRC_DIR}/pktio_env ]; then
+ . ${TEST_SRC_DIR}/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."
@@ -61,7 +52,7 @@ run_test()
if [ "$disabletype" != "SKIP" ]; then
export ODP_PKTIO_DISABLE_SOCKET_${distype}=y
fi
- ${TEST_DIR}/pktio/pktio_main
+ ${TEST_DIR}/pktio_main
if [ $? -ne 0 ]; then
ret=1
fi
@@ -76,9 +67,10 @@ run_test()
run()
{
- if [ "$ODP_PLATFORM" != "linux-generic" -o "$(id -u)" != "0" ]; then
+ #need to be root to set the interface: if not, run with default loopback.
+ if [ "$(id -u)" != "0" ]; then
echo "pktio: using 'loop' device"
- ${TEST_DIR}/pktio/pktio_main
+ ${TEST_DIR}/pktio_main
exit $?
fi
@@ -37,8 +37,8 @@ elif [ "$ODP_PLATFORM" = "" ]; then
echo "$0: error: ODP_PLATFORM must be defined"
# not skipped as this should never happen via "make check"
exit 1
-elif [ -f ${TEST_SRC_DIR}/../../platform/$ODP_PLATFORM/test/pktio_env ]; then
- . ${TEST_SRC_DIR}/../../platform/$ODP_PLATFORM/test/pktio_env
+elif [ -f ${TEST_SRC_DIR}/../../platform/$ODP_PLATFORM/test/pktio/pktio_env ]; then
+ . ${TEST_SRC_DIR}/../../platform/$ODP_PLATFORM/test/pktio/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."
@@ -25,10 +25,8 @@ EXECUTABLES = odp_buffer \
odp_thread \
odp_ver_abt_log_dbg
-TESTSCRIPTS = pktio/pktio_run
-
if test_vald
-TESTS = $(EXECUTABLES) $(TESTSCRIPTS)
+TESTS = $(EXECUTABLES)
endif
bin_PROGRAMS = $(EXECUTABLES) $(COMPILE_ONLY)
@@ -1,7 +1,5 @@
include ../Makefile.inc
-dist_bin_SCRIPTS = pktio_run
-
noinst_LIBRARIES = libpktio.a
libpktio_a_SOURCES = pktio.c
The platform specific scripts for pktio are now moved from the validation to the platform side. Pktio tests are now initiated from the platform side. Signed-off-by: Christophe Milard <christophe.milard@linaro.org> --- configure.ac | 1 + platform/linux-generic/test/.gitignore | 2 ++ platform/linux-generic/test/Makefile.am | 8 +++++++- platform/linux-generic/test/pktio/.gitignore | 2 ++ platform/linux-generic/test/pktio/Makefile.am | 2 ++ platform/linux-generic/test/{ => pktio}/pktio_env | 0 .../linux-generic/test}/pktio/pktio_run | 24 ++++++++-------------- test/performance/odp_l2fwd_run | 4 ++-- test/validation/Makefile.am | 4 +--- test/validation/pktio/Makefile.am | 2 -- 10 files changed, 25 insertions(+), 24 deletions(-) create mode 100644 platform/linux-generic/test/.gitignore create mode 100644 platform/linux-generic/test/pktio/.gitignore create mode 100644 platform/linux-generic/test/pktio/Makefile.am rename platform/linux-generic/test/{ => pktio}/pktio_env (100%) rename {test/validation => platform/linux-generic/test}/pktio/pktio_run (71%)