2020-01-21 17:18:46 +00:00
|
|
|
#!/usr/bin/env bash
|
2022-11-02 15:49:40 +00:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
# Copyright (C) 2020 Intel Corporation
|
|
|
|
# All rights reserved.
|
|
|
|
#
|
2020-01-21 17:18:46 +00:00
|
|
|
test_root=$(readlink -f $(dirname $0))
|
|
|
|
rootdir="$test_root/../.."
|
|
|
|
|
|
|
|
source "$rootdir/test/common/autotest_common.sh"
|
|
|
|
|
|
|
|
set -e
|
|
|
|
SPDK_DIR=$1
|
|
|
|
|
2020-12-21 20:30:32 +00:00
|
|
|
if [ -z "$EXTERNAL_MAKE_HUGEMEM" ]; then
|
|
|
|
EXTERNAL_MAKE_HUGEMEM=$HUGEMEM
|
|
|
|
fi
|
|
|
|
|
2021-02-24 13:28:10 +00:00
|
|
|
sudo HUGEMEM="$EXTERNAL_MAKE_HUGEMEM" $SPDK_DIR/scripts/setup.sh
|
2020-05-02 04:49:36 +00:00
|
|
|
|
2021-08-17 13:46:25 +00:00
|
|
|
if [ -n "$SPDK_RUN_EXTERNAL_DPDK" ]; then
|
|
|
|
WITH_DPDK="--with-dpdk=$SPDK_RUN_EXTERNAL_DPDK"
|
|
|
|
fi
|
2020-10-29 19:25:50 +00:00
|
|
|
make -C $SPDK_DIR clean
|
2022-09-06 17:48:39 +00:00
|
|
|
$SPDK_DIR/configure --with-shared --without-ocf --disable-asan $WITH_DPDK
|
2020-01-21 17:18:46 +00:00
|
|
|
make -C $SPDK_DIR -j$(nproc)
|
|
|
|
|
|
|
|
export SPDK_HEADER_DIR="$SPDK_DIR/include"
|
2021-02-19 14:37:17 +00:00
|
|
|
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"$test_root/passthru"
|
2022-03-11 09:25:08 +00:00
|
|
|
_sudo="sudo -E --preserve-env=PATH LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
|
2020-01-21 17:18:46 +00:00
|
|
|
|
|
|
|
# The default target is to make both the app and bdev and link them against the combined SPDK shared library libspdk.so.
|
2021-03-08 10:20:23 +00:00
|
|
|
run_test "external_make_hello_bdev_shared_combo" make -C $test_root hello_world_bdev_shared_combo
|
2022-03-11 09:25:08 +00:00
|
|
|
run_test "external_run_hello_bdev_shared_combo" $_sudo $test_root/hello_world/hello_bdev \
|
2021-03-08 10:20:23 +00:00
|
|
|
--json $test_root/hello_world/bdev_external.json -b TestPT
|
2020-01-21 17:18:46 +00:00
|
|
|
|
|
|
|
make -C $test_root clean
|
|
|
|
|
|
|
|
# Make just the application linked against the combined SPDK shared library libspdk.so.
|
2021-03-08 10:20:23 +00:00
|
|
|
run_test "external_make_hello_no_bdev_shared_combo" make -C $test_root hello_world_no_bdev_shared_combo
|
2022-03-11 09:25:08 +00:00
|
|
|
run_test "external_run_hello_no_bdev_shared_combo" $_sudo $test_root/hello_world/hello_bdev \
|
2021-03-08 10:20:23 +00:00
|
|
|
--json $test_root/hello_world/bdev.json -b Malloc0
|
2020-01-21 17:18:46 +00:00
|
|
|
|
|
|
|
make -C $test_root clean
|
|
|
|
|
|
|
|
# Make both the application and bdev against individual SPDK shared libraries.
|
2021-03-08 10:20:23 +00:00
|
|
|
run_test "external_make_hello_bdev_shared_iso" make -C $test_root hello_world_bdev_shared_iso
|
2022-03-11 09:25:08 +00:00
|
|
|
run_test "external_run_hello_bdev_shared_iso" $_sudo $test_root/hello_world/hello_bdev \
|
2021-03-08 10:20:23 +00:00
|
|
|
--json $test_root/hello_world/bdev_external.json -b TestPT
|
2020-01-21 17:18:46 +00:00
|
|
|
|
|
|
|
make -C $test_root clean
|
|
|
|
|
|
|
|
# Make just the application linked against individual SPDK shared libraries.
|
2021-03-08 10:20:23 +00:00
|
|
|
run_test "external_make_hello_no_bdev_shared_iso" make -C $test_root hello_world_no_bdev_shared_iso
|
2022-03-11 09:25:08 +00:00
|
|
|
run_test "external_run_hello_no_bdev_shared_iso" $_sudo $test_root/hello_world/hello_bdev \
|
2021-03-08 10:20:23 +00:00
|
|
|
--json $test_root/hello_world/bdev.json -b Malloc0
|
2020-01-21 17:18:46 +00:00
|
|
|
|
2021-02-25 10:52:04 +00:00
|
|
|
# Make the basic NVMe driver linked against individual shared SPDK libraries.
|
|
|
|
run_test "external_make_nvme_shared" make -C $test_root nvme_shared
|
2022-03-11 09:25:08 +00:00
|
|
|
run_test "external_run_nvme_shared" $_sudo $test_root/nvme/identify.sh
|
2021-02-25 10:52:04 +00:00
|
|
|
|
2020-01-21 17:18:46 +00:00
|
|
|
make -C $test_root clean
|
|
|
|
|
|
|
|
make -C $SPDK_DIR clean
|
2022-09-06 17:48:39 +00:00
|
|
|
$SPDK_DIR/configure --without-shared --without-ocf --disable-asan $WITH_DPDK
|
2020-01-21 17:18:46 +00:00
|
|
|
make -C $SPDK_DIR -j$(nproc)
|
|
|
|
|
|
|
|
# Make both the application and bdev against individual SPDK archives.
|
2021-03-08 10:20:23 +00:00
|
|
|
run_test "external_make_hello_bdev_static" make -C $test_root hello_world_bdev_static
|
2022-03-11 09:25:08 +00:00
|
|
|
run_test "external_run_hello_bdev_static" $_sudo $test_root/hello_world/hello_bdev \
|
2021-03-08 10:20:23 +00:00
|
|
|
--json $test_root/hello_world/bdev_external.json -b TestPT
|
2020-01-21 17:18:46 +00:00
|
|
|
|
|
|
|
make -C $test_root clean
|
|
|
|
|
|
|
|
# Make just the application linked against individual SPDK archives.
|
2021-03-08 10:20:23 +00:00
|
|
|
run_test "external_make_hello_no_bdev_static" make -C $test_root hello_world_no_bdev_static
|
2022-03-11 09:25:08 +00:00
|
|
|
run_test "external_run_hello_no_bdev_static" $_sudo $test_root/hello_world/hello_bdev \
|
2021-03-08 10:20:23 +00:00
|
|
|
--json $test_root/hello_world/bdev.json -b Malloc0
|
2020-01-21 17:18:46 +00:00
|
|
|
|
2021-02-25 10:52:04 +00:00
|
|
|
# Make the basic NVMe driver statically linked against individual SPDK archives.
|
|
|
|
run_test "external_make_nvme_static" make -C $test_root nvme_static
|
2022-03-11 09:25:08 +00:00
|
|
|
run_test "external_run_nvme_static" $_sudo $test_root/nvme/identify.sh
|
2021-02-25 10:52:04 +00:00
|
|
|
|
2020-01-21 17:18:46 +00:00
|
|
|
make -C $test_root clean
|
|
|
|
make -C $SPDK_DIR -j$(nproc) clean
|
2020-05-02 04:49:36 +00:00
|
|
|
|
2021-02-24 13:28:10 +00:00
|
|
|
sudo HUGEMEM="$HUGEMEM" $SPDK_DIR/scripts/setup.sh reset
|