From 258801182333e0c0e1b3bec2720a9ca1959230fc Mon Sep 17 00:00:00 2001 From: Jan Michalski Date: Fri, 14 Jul 2023 17:03:34 -0400 Subject: [PATCH] common: move PKG-specific variables out of the testconfig generating script Signed-off-by: Jan Michalski --- utils/docker/configure-tests.sh | 13 +------------ utils/docker/prepare-for-build.sh | 2 +- utils/docker/run-build-package.sh | 18 +++++++++++++++++- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/utils/docker/configure-tests.sh b/utils/docker/configure-tests.sh index abe2a1f74bc..bc061e0e53c 100755 --- a/utils/docker/configure-tests.sh +++ b/utils/docker/configure-tests.sh @@ -22,19 +22,8 @@ ENABLE_SUDO_TESTS=y TM=1 EOF -if [[ "${1}" == "PKG" ]]; then - #Append variables exclusively for PKG tests: - if [ $OS = opensuse/leap ] || [ $OS = rockylinux/rockylinux ]; then - echo "PMDK_LIB_PATH_NONDEBUG=/usr/lib64" >> $WORKDIR/src/test/testconfig.sh - echo "PMDK_LIB_PATH_DEBUG=/usr/lib64/pmdk_debug" >> $WORKDIR/src/test/testconfig.sh - elif [ $OS = ubuntu ]; then - echo "PMDK_LIB_PATH_NONDEBUG=/lib/x86_64-linux-gnu" >> $WORKDIR/src/test/testconfig.sh - echo "PMDK_LIB_PATH_DEBUG=/lib/x86_64-linux-gnu/pmdk_dbg" >> $WORKDIR/src/test/testconfig.sh - fi -fi - # Configure python tests - cat << EOF >> $WORKDIR/src/test/testconfig.py +cat << EOF > $WORKDIR/src/test/testconfig.py config = { 'unittest_log_level': 1, 'cacheline_fs_dir': '/tmp', diff --git a/utils/docker/prepare-for-build.sh b/utils/docker/prepare-for-build.sh index 332605cd89d..94ecf95ed33 100755 --- a/utils/docker/prepare-for-build.sh +++ b/utils/docker/prepare-for-build.sh @@ -21,5 +21,5 @@ fi # should be preserved KEEP_TEST_CONFIG=${KEEP_TEST_CONFIG:-0} if [[ "$KEEP_TEST_CONFIG" == 0 ]]; then - ./configure-tests.sh $@ + ./configure-tests.sh fi diff --git a/utils/docker/run-build-package.sh b/utils/docker/run-build-package.sh index 4af76ef8328..5a52aa41f18 100755 --- a/utils/docker/run-build-package.sh +++ b/utils/docker/run-build-package.sh @@ -65,7 +65,23 @@ make -j$(nproc) # Prepare test config once more. Now, with path to PMDK set in the OS # (rather than in the git tree) - for testing packages installed in the system. -$SCRIPTSDIR/configure-tests.sh PKG +$SCRIPTSDIR/configure-tests.sh + +# Append variables exclusively for PKG tests +case "$OS" in +"opensuse/leap" | "rockylinux/rockylinux") + PMDK_LIB_PATH_NONDEBUG=/usr/lib64 + ;; +"ubuntu") + PMDK_LIB_PATH_NONDEBUG=/lib/x86_64-linux-gnu + ;; +esac + +cat << EOF >> $WORKDIR/src/test/testconfig.sh +PMDK_LIB_PATH_NONDEBUG=$PMDK_LIB_PATH_NONDEBUG +PMDK_LIB_PATH_DEBUG=$PMDK_LIB_PATH_NONDEBUG/pmdk_debug +EOF + ./RUNTESTS.sh -t check popd