@@ -35,9 +35,10 @@ function build_dpdk()
DPDK_OPTS="$DPDK_OPTS -Ddeveloper_mode=disabled"
# OVS compilation and "normal" unit tests (run in the CI) do not depend on
- # any DPDK driver being present.
- # We can disable all drivers to save compilation time.
- DPDK_OPTS="$DPDK_OPTS -Ddisable_drivers=*/*"
+ # any DPDK driver.
+ # check-dpdk unit tests requires testpmd and some net/ driver.
+ DPDK_OPTS="$DPDK_OPTS -Denable_apps=test-pmd"
+ DPDK_OPTS="$DPDK_OPTS -Denable_drivers=net/null,net/tap,net/virtio"
# Install DPDK using prefix.
DPDK_OPTS="$DPDK_OPTS --prefix=$(pwd)/build"
@@ -22,6 +22,9 @@ function install_dpdk()
# Export the following path for pkg-config to find the .pc file.
export PKG_CONFIG_PATH=$DPDK_LIB/pkgconfig/:$PKG_CONFIG_PATH
+ # Expose dpdk binaries.
+ export PATH=$(pwd)/dpdk-dir/build/bin:$PATH
+
if [ ! -f "${VERSION_FILE}" ]; then
echo "Could not find DPDK in $(pwd)/dpdk-dir"
return 1
@@ -113,7 +116,7 @@ fi
OPTS="${EXTRA_OPTS} ${OPTS} $*"
-if [ "$TESTSUITE" ]; then
+if [ "$TESTSUITE" = 'test' ]; then
# 'distcheck' will reconfigure with required options.
# Now we only need to prepare the Makefile without sparse-wrapped CC.
configure_ovs
@@ -123,6 +126,16 @@ if [ "$TESTSUITE" ]; then
TESTSUITEFLAGS=-j4 RECHECK=yes
else
build_ovs
+ for testsuite in $TESTSUITE; do
+ run_as_root=
+ if [ "${testsuite##*dpdk}" != "$testsuite" ]; then
+ sudo sh -c 'echo 1024 > /proc/sys/vm/nr_hugepages' || true
+ [ "$(cat /proc/sys/vm/nr_hugepages)" = '1024' ]
+ export DPDK_EAL_OPTIONS="--lcores 0@1,1@1,2@1"
+ run_as_root="sudo -E PATH=$PATH"
+ fi
+ $run_as_root make $testsuite TESTSUITEFLAGS=-j4 RECHECK=yes
+ done
fi
exit 0
@@ -123,10 +123,10 @@ jobs:
opts: --enable-shared
- compiler: gcc
- testsuite: test
+ testsuite: check check-dpdk
dpdk: dpdk
- compiler: clang
- testsuite: test
+ testsuite: check check-dpdk
dpdk: dpdk
- compiler: gcc
@@ -213,7 +213,8 @@ jobs:
mkdir logs
cp config.log ./logs/
cp -r ./*/_build/sub/tests/testsuite.* ./logs/ || true
- tar -czvf logs.tgz logs/
+ sudo cp -r ./tests/*testsuite.* ./logs/ || true
+ sudo tar -czvf logs.tgz logs/
- name: upload logs on failure
if: failure() || cancelled()
@@ -94,7 +94,7 @@ m4_define([OVS_DPDK_CHECK_TESTPMD],
m4_define([OVS_DPDK_START_TESTPMD],
[AT_CHECK([lscpu], [], [stdout])
AT_CHECK([cat stdout | grep "NUMA node(s)" | awk '{c=1; while (c++<$(3)) {printf "512,"}; print "512"}' > NUMA_NODE])
- eal_options="--in-memory --socket-mem="$(cat NUMA_NODE)" --single-file-segments --no-pci"
+ eal_options="$DPDK_EAL_OPTIONS --in-memory --socket-mem="$(cat NUMA_NODE)" --single-file-segments --no-pci"
options="$1"
test "$options" != "${options%% -- *}" || options="$options -- "
eal_options="$eal_options ${options%% -- *}"