xref: /spdk/test/external_code/test_make.sh (revision ba23cec1820104cc710ad776f0127e1cf82033aa)
1#!/usr/bin/env bash
2
3test_root=$(readlink -f $(dirname $0))
4rootdir="$test_root/../.."
5
6source "$rootdir/test/common/autotest_common.sh"
7
8set -e
9SPDK_DIR=$1
10
11# Skip all pci devices. These tests don't rely on them.
12sudo PCI_WHITELIST="NONE" HUGEMEM="$HUGEMEM" $SPDK_DIR/scripts/setup.sh
13
14$SPDK_DIR/configure --with-shared --without-isal --without-ocf --disable-asan
15make -C $SPDK_DIR -j$(nproc)
16
17export SPDK_HEADER_DIR="$SPDK_DIR/include"
18export SPDK_LIB_DIR="$SPDK_DIR/build/lib"
19export DPDK_LIB_DIR="$SPDK_DIR/dpdk/build/lib"
20
21# The default target is to make both the app and bdev and link them against the combined SPDK shared library libspdk.so.
22run_test "external_make_tc1" make -C $test_root hello_world_bdev_shared_combo
23
24LD_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
25
26make -C $test_root clean
27
28# Make just the application linked against the combined SPDK shared library libspdk.so.
29run_test "external_make_tc2" make -C $test_root hello_world_no_bdev_shared_combo
30
31LD_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
32
33make -C $test_root clean
34
35# Make both the application and bdev against individual SPDK shared libraries.
36run_test "external_make_tc3" make -C $test_root hello_world_bdev_shared_iso
37
38LD_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
39
40make -C $test_root clean
41
42# Make just the application linked against individual SPDK shared libraries.
43run_test "external_make_tc4" make -C $test_root hello_world_no_bdev_shared_iso
44
45LD_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
46
47make -C $test_root clean
48
49make -C $SPDK_DIR clean
50$SPDK_DIR/configure --without-shared --without-isal --without-ocf --disable-asan
51make -C $SPDK_DIR -j$(nproc)
52
53# Make both the application and bdev against individual SPDK archives.
54run_test "external_make_tc5" make -C $test_root hello_world_bdev_static
55
56LD_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
57
58make -C $test_root clean
59
60# Make just the application linked against individual SPDK archives.
61run_test "external_make_tc6" make -C $test_root hello_world_no_bdev_static
62
63LD_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
64
65make -C $test_root clean
66make -C $SPDK_DIR -j$(nproc) clean
67
68sudo PCI_WHITELIST="NONE" HUGEMEM="$HUGEMEM" $SPDK_DIR/scripts/setup.sh reset
69