From 3bc0002511d8032ce3f04c7a4d97647e4a8d965f Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Wed, 24 Feb 2021 16:28:36 +0100 Subject: [PATCH] autobuild: Add test for building SPDK RPMs Signed-off-by: Michal Berger Change-Id: Iea87c87367d2ed49b00e896df046e0572fecec98 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6549 Tested-by: SPDK CI Jenkins Reviewed-by: Tomasz Zawadzki Reviewed-by: Jim Harris --- autopackage.sh | 35 +++++++++++++++++++++++++++++++++++ test/common/skipped_tests.txt | 1 + 2 files changed, 36 insertions(+) diff --git a/autopackage.sh b/autopackage.sh index 81cfd6ab7..5cccf076e 100755 --- a/autopackage.sh +++ b/autopackage.sh @@ -13,6 +13,37 @@ source "$1" rootdir=$(readlink -f $(dirname $0)) source "$rootdir/test/common/autotest_common.sh" +function build_rpms() ( + local version rpms + + # Make sure linker will not attempt to look under DPDK's repo dir to get the libs + unset -v LD_LIBRARY_PATH + + install_uninstall_rpms() { + rpms=("$HOME/rpmbuild/RPMS/x86_64/"spdk{,-devel,{,-dpdk}-libs}-$version-1.x86_64.rpm) + + sudo rpm -i "${rpms[@]}" + rpms=("${rpms[@]##*/}") rpms=("${rpms[@]%.rpm}") + # Check if we can find one of the apps in the PATH now and verify if it doesn't miss + # any libs. + LIST_LIBS=yes "$rootdir/rpmbuild/rpm-deps.sh" "${SPDK_APP[@]##*/}" + sudo rpm -e "${rpms[@]}" + } + + build_rpm() { + MAKEFLAGS="$MAKEFLAGS" SPDK_VERSION="$version" DEPS=no "$rootdir/rpmbuild/rpm.sh" "$@" + install_uninstall_rpms + } + + version="test_shared" + run_test "build_shared_rpm" build_rpm --with-shared + + if [[ -n $SPDK_TEST_NATIVE_DPDK ]]; then + version="test_shared_native_dpdk" + run_test "build_shared_native_dpdk_rpm" build_rpm --with-shared --with-dpdk="$SPDK_RUN_EXTERNAL_DPDK" + fi +) + out=$PWD MAKEFLAGS=${MAKEFLAGS:--j16} @@ -28,6 +59,10 @@ if [ $(git status --porcelain --ignore-submodules | wc -l) -ne 0 ]; then fi timing_exit porcelain_check +if [[ $SPDK_TEST_RELEASE_BUILD -eq 1 ]]; then + run_test "build_rpms" build_rpms +fi + if [[ $RUN_NIGHTLY -eq 0 ]]; then timing_finish exit 0 diff --git a/test/common/skipped_tests.txt b/test/common/skipped_tests.txt index c5f00a00c..5357c46b4 100644 --- a/test/common/skipped_tests.txt +++ b/test/common/skipped_tests.txt @@ -40,6 +40,7 @@ bdev_fio_rw_verify_ext bdev_fio_trim_ext bdev_reset build_native_dpdk +build_shared_native_dpdk_rpm iscsi_tgt_digest iscsi_tgt_data_digest iscsi_tgt_pmem