diff options
author | Matias Elo <matias.elo@nokia.com> | 2018-02-02 14:17:28 +0200 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2018-02-02 15:49:38 +0200 |
commit | d169d0cb25f614bd07a6cc5ed288bd5c9f48410b (patch) | |
tree | c1d7cbd5faf62a4bf13310cab097a54a468ffede /platform/linux-dpdk/test | |
parent | fb6a1bdc107c576d1ca64271bda6fe2691ca6a97 (diff) |
linux-dpdk: enable running performance tests
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Diffstat (limited to 'platform/linux-dpdk/test')
-rw-r--r-- | platform/linux-dpdk/test/Makefile.am | 2 | ||||
-rwxr-xr-x | platform/linux-dpdk/test/wrapper-script.sh | 19 |
2 files changed, 12 insertions, 9 deletions
diff --git a/platform/linux-dpdk/test/Makefile.am b/platform/linux-dpdk/test/Makefile.am index 8cb27b14f..a872400e4 100644 --- a/platform/linux-dpdk/test/Makefile.am +++ b/platform/linux-dpdk/test/Makefile.am @@ -14,6 +14,8 @@ SUBDIRS += validation/api/pktio endif endif +TEST_EXTENSIONS = .sh + TESTNAME = linux-dpdk TESTENV = tests-$(TESTNAME).env diff --git a/platform/linux-dpdk/test/wrapper-script.sh b/platform/linux-dpdk/test/wrapper-script.sh index 0dc2d23c2..b0596291f 100755 --- a/platform/linux-dpdk/test/wrapper-script.sh +++ b/platform/linux-dpdk/test/wrapper-script.sh @@ -3,6 +3,8 @@ export ODP_PLATFORM_PARAMS=${ODP_PLATFORM_PARAMS:--n 4 --vdev "crypto_openssl"} # where to mount huge pages export HUGEPAGEDIR=${HUGEPAGEDIR:-/mnt/huge} +# exit codes expected by automake for skipped tests +TEST_SKIPPED=77 # Make sure huge pages are released when a unit test crashes "make check" trap ctrl_c INT @@ -42,6 +44,13 @@ function mount_and_reserve() { if [ ! -d $HUGEPAGEDIR ]; then sudo mkdir -p $HUGEPAGEDIR fi + +# Need to be root to use DPDK +if [ "$(id -u)" != "0" ]; then + echo "DPDK needs root privileges" + exit $TEST_SKIPPED +fi + echo "Mounting hugetlbfs" export SIZE=1G export SIZE_KB=1048576 @@ -60,15 +69,7 @@ if [ $res -ne 0 ]; then fi fi echo "running $1!" -if [ ${1: -3} == ".sh" ] -then - sudo TEST_DIR=${TEST_DIR} \ - ODP_PLATFORM_PARAMS="$ODP_PLATFORM_PARAMS" \ - ODP_GDB=$ODP_GDB $1 -else - sudo TEST_DIR=${TEST_DIR} ODP_PLATFORM_PARAMS="$ODP_PLATFORM_PARAMS" \ - $ODP_GDB $1 -fi +$1 res=$? echo "Unmounting hugetlbfs" sleep 0.3 && sudo umount -a -t hugetlbfs |