Spdk/test/external_code/test_make.sh
Darek Stojaczyk c965542795 test/external_code: use default HUGEMEM in setup.sh
Fixes #1382

System memory gets fragmented over time and repeated hugepage
allocations fail, giving us intermittent failures on CI. Linux
allocates those pages only when requested hugepage count is bigger
than current hugepage count, so in order to prevent any additional
allocations just stick to a single count all the time.

autotest_common.sh already exports HUGEMEM=8G for Linux systems
and 2G for BSD ones. `setup.sh reset` doesn't touch the hugepages,
so practically only the first `setup.sh` will allocate memory now.

The two setup.sh calls are run with sudo, so they need
HUGEMEM="$HUGEMEM" to work.

Change-Id: I48b4a720bad4e1da14e78313b4db0eb60a177c38
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2374
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Seth Howell <seth.howell@intel.com>
2020-06-02 09:47:48 +00:00

69 lines
2.9 KiB
Bash
Executable File

#!/usr/bin/env bash
test_root=$(readlink -f $(dirname $0))
rootdir="$test_root/../.."
source "$rootdir/test/common/autotest_common.sh"
set -e
SPDK_DIR=$1
# Skip all pci devices. These tests don't rely on them.
sudo PCI_WHITELIST="NONE" HUGEMEM="$HUGEMEM" $SPDK_DIR/scripts/setup.sh
$SPDK_DIR/configure --with-shared --without-isal --without-ocf --disable-asan
make -C $SPDK_DIR -j$(nproc)
export SPDK_HEADER_DIR="$SPDK_DIR/include"
export SPDK_LIB_DIR="$SPDK_DIR/build/lib"
export DPDK_LIB_DIR="$SPDK_DIR/dpdk/build/lib"
# The default target is to make both the app and bdev and link them against the combined SPDK shared library libspdk.so.
run_test "external_make_tc1" make -C $test_root hello_world_bdev_shared_combo
LD_LIBRARY_PATH=$SPDK_LIB_DIR:$DPDK_LIB_DIR:"$test_root/passthru" run_test "external_run_tc1" $test_root/hello_world/hello_bdev --json $test_root/hello_world/bdev_external.conf -b TestPT
make -C $test_root clean
# Make just the application linked against the combined SPDK shared library libspdk.so.
run_test "external_make_tc2" make -C $test_root hello_world_no_bdev_shared_combo
LD_LIBRARY_PATH=$SPDK_LIB_DIR:$DPDK_LIB_DIR run_test "external_run_tc2" $test_root/hello_world/hello_bdev --json $test_root/hello_world/bdev.conf -b Malloc0
make -C $test_root clean
# Make both the application and bdev against individual SPDK shared libraries.
run_test "external_make_tc3" make -C $test_root hello_world_bdev_shared_iso
LD_LIBRARY_PATH=$SPDK_LIB_DIR:$DPDK_LIB_DIR:"$test_root/passthru" run_test "external_run_tc3" $test_root/hello_world/hello_bdev --json $test_root/hello_world/bdev_external.conf -b TestPT
make -C $test_root clean
# Make just the application linked against individual SPDK shared libraries.
run_test "external_make_tc4" make -C $test_root hello_world_no_bdev_shared_iso
LD_LIBRARY_PATH=$SPDK_LIB_DIR:$DPDK_LIB_DIR run_test "external_run_tc4" $test_root/hello_world/hello_bdev --json $test_root/hello_world/bdev.conf -b Malloc0
make -C $test_root clean
make -C $SPDK_DIR clean
$SPDK_DIR/configure --without-shared --without-isal --without-ocf --disable-asan
make -C $SPDK_DIR -j$(nproc)
# Make both the application and bdev against individual SPDK archives.
run_test "external_make_tc5" make -C $test_root hello_world_bdev_static
LD_LIBRARY_PATH=$SPDK_LIB_DIR:$DPDK_LIB_DIR:"$test_root/passthru" run_test "external_run_tc5" $test_root/hello_world/hello_bdev --json $test_root/hello_world/bdev_external.conf -b TestPT
make -C $test_root clean
# Make just the application linked against individual SPDK archives.
run_test "external_make_tc6" make -C $test_root hello_world_no_bdev_static
LD_LIBRARY_PATH=$SPDK_LIB_DIR:$DPDK_LIB_DIR run_test "external_run_tc6" $test_root/hello_world/hello_bdev --json $test_root/hello_world/bdev.conf -b Malloc0
make -C $test_root clean
make -C $SPDK_DIR -j$(nproc) clean
sudo PCI_WHITELIST="NONE" HUGEMEM="$HUGEMEM" $SPDK_DIR/scripts/setup.sh reset