diff options
author | Balakrishna Garapati <balakrishna.garapati@linaro.org> | 2016-10-20 16:18:23 +0200 |
---|---|---|
committer | Balakrishna Garapati <balakrishna.garapati@linaro.org> | 2016-10-20 16:48:57 +0200 |
commit | 7d7e70e7f4fc10cf582c429f4bf9a6506055a4a7 (patch) | |
tree | 051ec378aaa7bb56320ae3411e57a07e4dec8053 /platform | |
parent | d0cc871fb014e3f5b9d9622af1f351163d3b2b16 (diff) |
linux-dpdk: test: move tests into test suite
This is a Revert for the commit:
3549864cc186c61e468b9efbe19baa18ec75f410
and syncs with odp monarch_lts release
Signed-off-by: Balakrishna Garapati <balakrishna.garapati@linaro.org>
Diffstat (limited to 'platform')
-rw-r--r-- | platform/linux-dpdk/Makefile.inc | 2 | ||||
-rw-r--r-- | platform/linux-dpdk/m4/configure.m4 | 2 | ||||
-rw-r--r-- | platform/linux-dpdk/test/.gitignore | 3 | ||||
-rw-r--r-- | platform/linux-dpdk/test/Makefile.am | 53 | ||||
-rw-r--r-- | platform/linux-dpdk/test/Makefile.inc | 16 | ||||
l--------- | platform/linux-dpdk/test/pktio/.gitignore | 1 | ||||
-rw-r--r-- | platform/linux-dpdk/test/pktio/Makefile.am | 4 | ||||
l--------- | platform/linux-dpdk/test/pktio/pktio_env | 1 | ||||
-rwxr-xr-x | platform/linux-dpdk/test/pktio/pktio_run.sh | 111 | ||||
l--------- | platform/linux-dpdk/test/run-test | 1 | ||||
-rwxr-xr-x | platform/linux-dpdk/test/wrapper-script.sh | 73 |
11 files changed, 1 insertions, 266 deletions
diff --git a/platform/linux-dpdk/Makefile.inc b/platform/linux-dpdk/Makefile.inc index 45f7265e3..e933b93d1 100644 --- a/platform/linux-dpdk/Makefile.inc +++ b/platform/linux-dpdk/Makefile.inc @@ -1,4 +1,4 @@ AM_CFLAGS += -I$(top_srcdir)/platform/$(with_platform)/arch/$(ARCH_DIR) AM_CXXFLAGS += -I$(top_srcdir)/platform/$(with_platform)/arch/$(ARCH_DIR) AM_LDFLAGS += -R$(SDK_INSTALL_PATH)/lib -LOG_COMPILER = $(top_srcdir)/platform/linux-dpdk/test/wrapper-script.sh +LOG_COMPILER = $(top_srcdir)/test/platform/linux-dpdk/wrapper-script.sh diff --git a/platform/linux-dpdk/m4/configure.m4 b/platform/linux-dpdk/m4/configure.m4 index 1f1c67690..aeaebcd42 100644 --- a/platform/linux-dpdk/m4/configure.m4 +++ b/platform/linux-dpdk/m4/configure.m4 @@ -76,7 +76,5 @@ LDFLAGS=$OLD_LDFLAGS CPPFLAGS=$OLD_CPPFLAGS AC_CONFIG_FILES([platform/linux-dpdk/Makefile - platform/linux-dpdk/test/Makefile - platform/linux-dpdk/test/pktio/Makefile platform/linux-dpdk/include/odp/api/inlines.h]) diff --git a/platform/linux-dpdk/test/.gitignore b/platform/linux-dpdk/test/.gitignore deleted file mode 100644 index 5dabf91c1..000000000 --- a/platform/linux-dpdk/test/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -*.log -*.trs -tests-validation.env diff --git a/platform/linux-dpdk/test/Makefile.am b/platform/linux-dpdk/test/Makefile.am deleted file mode 100644 index a2edf0cb8..000000000 --- a/platform/linux-dpdk/test/Makefile.am +++ /dev/null @@ -1,53 +0,0 @@ -include $(top_srcdir)/test/Makefile.inc -TESTS_ENVIRONMENT += TEST_DIR=${top_builddir}/test/validation - -ODP_MODULES = pktio - -if test_vald -TESTS = pktio/pktio_run.sh \ - ${top_builddir}/test/validation/atomic/atomic_main$(EXEEXT) \ - ${top_builddir}/test/validation/barrier/barrier_main$(EXEEXT) \ - ${top_builddir}/test/validation/buffer/buffer_main$(EXEEXT) \ - ${top_builddir}/test/validation/classification/classification_main$(EXEEXT) \ - ${top_builddir}/test/validation/cpumask/cpumask_main$(EXEEXT) \ - ${top_builddir}/test/validation/crypto/crypto_main$(EXEEXT) \ - ${top_builddir}/test/validation/errno/errno_main$(EXEEXT) \ - ${top_builddir}/test/validation/hash/hash_main$(EXEEXT) \ - ${top_builddir}/test/validation/init/init_main_ok$(EXEEXT) \ - ${top_builddir}/test/validation/init/init_main_abort$(EXEEXT) \ - ${top_builddir}/test/validation/init/init_main_log$(EXEEXT) \ - ${top_builddir}/test/validation/lock/lock_main$(EXEEXT) \ - ${top_builddir}/test/validation/packet/packet_main$(EXEEXT) \ - ${top_builddir}/test/validation/pool/pool_main$(EXEEXT) \ - ${top_builddir}/test/validation/queue/queue_main$(EXEEXT) \ - ${top_builddir}/test/validation/random/random_main$(EXEEXT) \ - ${top_builddir}/test/validation/scheduler/scheduler_main$(EXEEXT) \ - ${top_builddir}/test/validation/std_clib/std_clib_main$(EXEEXT) \ - ${top_builddir}/test/validation/thread/thread_main$(EXEEXT) \ - ${top_builddir}/test/validation/time/time_main$(EXEEXT) \ - ${top_builddir}/test/validation/timer/timer_main$(EXEEXT) \ - ${top_builddir}/test/validation/traffic_mngr/traffic_mngr_main$(EXEEXT) \ - ${top_builddir}/test/validation/shmem/shmem_main$(EXEEXT) \ - ${top_builddir}/test/validation/system/system_main$(EXEEXT) - -SUBDIRS = $(ODP_MODULES) -endif - -dist_check_SCRIPTS = run-test tests-validation.env $(LOG_COMPILER) - -test_SCRIPTS = $(dist_check_SCRIPTS) - -tests-validation.env: - echo "TESTS=\"$(TESTS)\"" > $@ - echo "$(TESTS_ENVIRONMENT)" >> $@ - echo "$(LOG_COMPILER)" >> $@ - -if test_installdir -installcheck-local: - $(DESTDIR)/$(testdir)/run-test -endif - -#performance tests refer to pktio_env -if test_perf -SUBDIRS = pktio -endif diff --git a/platform/linux-dpdk/test/Makefile.inc b/platform/linux-dpdk/test/Makefile.inc deleted file mode 100644 index a54d17856..000000000 --- a/platform/linux-dpdk/test/Makefile.inc +++ /dev/null @@ -1,16 +0,0 @@ -# The following definitions may be used by platform tests that wish to -# build specific ODP applications, (i.e those whose do more than validation -# test wrapping) - -AM_LDFLAGS += -static - -LIBCUNIT_COMMON = $(top_builddir)/test/validation/common/libcunit_common.la -LIB = $(top_builddir)/lib -LIBODP = $(LIB)/libodphelper-linux.la $(LIB)/libodp-dpdk.la - -INCCUNIT_COMMON = -I$(top_srcdir)/test/validation/common -INCODP = -I$(top_srcdir)/test \ - -I$(top_srcdir)/platform/@with_platform@/include \ - -I$(top_srcdir)/platform/@with_platform@/arch/$(ARCH_DIR) \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/helper/include diff --git a/platform/linux-dpdk/test/pktio/.gitignore b/platform/linux-dpdk/test/pktio/.gitignore deleted file mode 120000 index 563cb9228..000000000 --- a/platform/linux-dpdk/test/pktio/.gitignore +++ /dev/null @@ -1 +0,0 @@ -../../../linux-generic/test/pktio/.gitignore
\ No newline at end of file diff --git a/platform/linux-dpdk/test/pktio/Makefile.am b/platform/linux-dpdk/test/pktio/Makefile.am deleted file mode 100644 index e401a29af..000000000 --- a/platform/linux-dpdk/test/pktio/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -dist_check_SCRIPTS = pktio_env \ - pktio_run.sh - -test_SCRIPTS = $(dist_check_SCRIPTS) diff --git a/platform/linux-dpdk/test/pktio/pktio_env b/platform/linux-dpdk/test/pktio/pktio_env deleted file mode 120000 index 6244f7156..000000000 --- a/platform/linux-dpdk/test/pktio/pktio_env +++ /dev/null @@ -1 +0,0 @@ -../../../../platform/linux-generic/test/pktio/pktio_env
\ No newline at end of file diff --git a/platform/linux-dpdk/test/pktio/pktio_run.sh b/platform/linux-dpdk/test/pktio/pktio_run.sh deleted file mode 100755 index 957c2bb44..000000000 --- a/platform/linux-dpdk/test/pktio/pktio_run.sh +++ /dev/null @@ -1,111 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2015, Linaro Limited -# All rights reserved. -# -# SPDX-License-Identifier: BSD-3-Clause -# - -# Proceed the pktio tests. This script expects at least one argument: -# setup) setup the pktio test environment -# cleanup) cleanup the pktio test environment -# run) run the pktio tests (setup, run, cleanup) -# extra arguments are passed unchanged to the test itself (pktio_main) -# Without arguments, "run" is assumed and no extra argument is passed to the -# test (legacy mode). -# - -# directories where pktio_main binary can be found: -# -in the validation dir when running make check (intree or out of tree) -# -in the script directory, when running after 'make install', or -# -in the validation when running standalone (./pktio_run) intree. -# -in the current directory. -# running stand alone out of tree requires setting PATH -PATH=${TEST_DIR}/pktio:$PATH -PATH=$(dirname $0):$PATH -PATH=$(dirname $0)/../../../../test/validation/pktio:$PATH -PATH=.:$PATH - -pktio_main_path=$(which pktio_main${EXEEXT}) -if [ -x "$pktio_main_path" ] ; then - echo "running with pktio_main: $pktio_run_path" -else - echo "cannot find pktio_main: please set you PATH for it." -fi - -# directory where platform test sources are, including scripts -TEST_SRC_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 -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." - echo "ODP_PLATFORM=\"$ODP_PLATFORM\"" - exit 1 -fi - -run_test() -{ - local ret=0 - - pktio_main${EXEEXT} $* - if [ $? -ne 0 ]; then - ret=1 - fi - if [ $ret -ne 0 ]; then - echo "!!! FAILED !!!" - fi - - return $ret -} - -run() -{ - echo "pktio: using 'loop' device" - $ODP_GDB pktio_main${EXEEXT} $* - loop_ret=$? - - # need to be root to run tests with real interfaces - if [ "$(id -u)" != "0" ]; then - exit $ret - fi - - if [ "$ODP_PKTIO_IF0" = "" ]; then - # no interfaces specified, use default veth interfaces - # setup by the pktio_env script - setup_pktio_env clean - if [ $? != 0 ]; then - echo "Failed to setup test environment, skipping test." - exit $TEST_SKIPPED - fi - export ODP_PLATFORM_PARAMS="-n 4 --vdev eth_pcap0,iface=$IF0 --vdev eth_pcap1,iface=$IF1" - export ODP_PKTIO_IF0=0 - export ODP_PKTIO_IF1=1 - fi - - run_test - ret=$? - - [ $ret = 0 ] && ret=$loop_ret - - exit $ret -} - -if [ $# != 0 ]; then - action=$1 - shift -fi - -case "$action" in - setup) setup_pktio_env ;; - cleanup) cleanup_pktio_env ;; - run) run ;; - *) run ;; -esac diff --git a/platform/linux-dpdk/test/run-test b/platform/linux-dpdk/test/run-test deleted file mode 120000 index 188283edb..000000000 --- a/platform/linux-dpdk/test/run-test +++ /dev/null @@ -1 +0,0 @@ -../../linux-generic/test/run-test
\ No newline at end of file diff --git a/platform/linux-dpdk/test/wrapper-script.sh b/platform/linux-dpdk/test/wrapper-script.sh deleted file mode 100755 index 79ef6ffba..000000000 --- a/platform/linux-dpdk/test/wrapper-script.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash - -export ODP_PLATFORM_PARAMS=${ODP_PLATFORM_PARAMS:--n 4} -# where to mount huge pages -export HUGEPAGEDIR=${HUGEPAGEDIR:-/mnt/huge} - -# Make sure huge pages are released when a unit test crashes "make check" -trap ctrl_c INT - -ctrl_c() { - echo "** Trapped CTRL-C" - if grep -qs "$HUGEPAGEDIR" /proc/mounts; then - echo "** Umounting hugetlbfs" - sleep 1 && sudo umount -a -t hugetlbfs - fi -} - -function mount_and_reserve() { - export PATH_NR="/sys/devices/system/node/node0/hugepages/hugepages-${SIZE_KB}kB/nr_hugepages" - export PATH_FREE="/sys/devices/system/node/node0/hugepages/hugepages-${SIZE_KB}kB/free_hugepages" - if grep -qs "$HUGEPAGEDIR" /proc/mounts; then - echo "Umounting hugetlbfs from previous use!" - sudo umount -a -t hugetlbfs - fi - echo "Trying $SIZE pages" - sudo mount -t hugetlbfs -o pagesize=$SIZE nodev $HUGEPAGEDIR 2>/dev/null - res=$? - if [ $res -ne 0 ]; then - echo "ERROR: can't mount hugepages" - return $res - fi - sudo sh -c "echo $RESERVE > $PATH_NR" - if [ `cat $PATH_NR` -lt 1 ]; then - echo "Failed to reserve at least 1 huge page!" - return 1 - else - echo "Total number: `cat $PATH_NR`" - echo "Free pages: `cat $PATH_FREE`" - fi -} - -if [ ! -d $HUGEPAGEDIR ]; then - sudo mkdir -p $HUGEPAGEDIR -fi -echo "Mounting hugetlbfs" -export SIZE=1G -export SIZE_KB=1048576 -export RESERVE=1 -mount_and_reserve -res=$? -if [ $res -ne 0 ]; then - export SIZE=2MB - export SIZE_KB=2048 - export RESERVE=256 - mount_and_reserve - res=$? - if [ $res -ne 0 ]; then - echo "ERROR: can't mount hugepages with any size" - exit $res - fi -fi -echo "running $1!" -if [ ${1: -3} == ".sh" ] -then - sudo ODP_PLATFORM_PARAMS="$ODP_PLATFORM_PARAMS" ODP_GDB=$ODP_GDB $1 -else - sudo ODP_PLATFORM_PARAMS="$ODP_PLATFORM_PARAMS" $ODP_GDB $1 -fi -res=$? -echo "Unmounting hugetlbfs" -sleep 0.3 && sudo umount -a -t hugetlbfs -exit $res - |