From 5aaa207a05b3c8c86fc5c6f68dc510e97ed05a69 Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Thu, 1 Dec 2022 14:49:50 +0100 Subject: [PATCH] tests: Run make clean only when SPDK was configured Otherwise the cmd fails due to the lack of config.mk. This forces autopackage.sh, test_make.sh, etc. to be executed in the environment where SPDK was already built which shouldn't be really a hard requirement as they always re-build the SPDK for their own purposes. Signed-off-by: Michal Berger Change-Id: Ie3971acbf354734ed9c5c72d49bb93fc2ccc45f8 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15743 Tested-by: SPDK CI Jenkins Reviewed-by: Tomasz Zawadzki Reviewed-by: Jim Harris Reviewed-by: Kamil Godzwon Reviewed-by: Pawel Piatek --- autopackage.sh | 4 +++- test/external_code/test_make.sh | 4 +++- test/make/check_so_deps.sh | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/autopackage.sh b/autopackage.sh index 5caf865b8..418762f0a 100755 --- a/autopackage.sh +++ b/autopackage.sh @@ -24,7 +24,9 @@ MAKEFLAGS=${MAKEFLAGS:--j16} cd $rootdir timing_enter porcelain_check -$MAKE clean +if [[ -e $rootdir/mk/config.mk ]]; then + $MAKE clean +fi if [ $(git status --porcelain --ignore-submodules | wc -l) -ne 0 ]; then echo make clean left the following files: diff --git a/test/external_code/test_make.sh b/test/external_code/test_make.sh index 3e2150bca..90e78ffea 100755 --- a/test/external_code/test_make.sh +++ b/test/external_code/test_make.sh @@ -20,7 +20,9 @@ sudo HUGEMEM="$EXTERNAL_MAKE_HUGEMEM" $SPDK_DIR/scripts/setup.sh if [ -n "$SPDK_RUN_EXTERNAL_DPDK" ]; then WITH_DPDK="--with-dpdk=$SPDK_RUN_EXTERNAL_DPDK" fi -make -C $SPDK_DIR clean +if [[ -e $SPDK_DIR/mk/config.mk ]]; then + make -C $SPDK_DIR clean +fi $SPDK_DIR/configure --with-shared --without-ocf --disable-asan $WITH_DPDK make -C $SPDK_DIR -j$(nproc) diff --git a/test/make/check_so_deps.sh b/test/make/check_so_deps.sh index dc34762a1..1c91facbd 100755 --- a/test/make/check_so_deps.sh +++ b/test/make/check_so_deps.sh @@ -305,7 +305,7 @@ if [ "$SPDK_TEST_OCF" -eq 1 ]; then config_params="$config_params --with-ocf=$rootdir/ocf.a" fi -if [[ -f $rootdir/mk/spdk.common.mk ]]; then +if [[ -f $rootdir/mk/config.mk ]]; then $MAKE $MAKEFLAGS clean fi