From ab283f08b61502c98c618e8a68e831d5086303f0 Mon Sep 17 00:00:00 2001 From: Matus Marhefka Date: Dec 01 2020 11:02:15 +0000 Subject: Sanity/smoke-test: fix to work also with RHEL specfiles which use out of source builds into build dir --- diff --git a/Sanity/smoke-test/runtest.sh b/Sanity/smoke-test/runtest.sh index 060f16b..beab24c 100755 --- a/Sanity/smoke-test/runtest.sh +++ b/Sanity/smoke-test/runtest.sh @@ -96,11 +96,15 @@ rlJournalStart rlRun "export OSCAP_FULL_VALIDATION=1" rlRun "export CUSTOM_OSCAP=$(which oscap)" BUILD_DIR="$(rpm --eval %{_vpath_builddir})" + BUILD_DIR_PATH=$(readlink -f ${TOPDIR}/BUILD/${PACKAGE}*/${BUILD_DIR}) + if [ ! -d "$BUILD_DIR_PATH" ]; then + BUILD_DIR_PATH=$(readlink -f ${TOPDIR}/BUILD/${PACKAGE}*/build) + fi if rlIsFedora || rlIsRHEL ">=8"; then - rlRun -s "cmake --build $(readlink -f ${TOPDIR}/BUILD/${PACKAGE}*/${BUILD_DIR}) --target test" + rlRun -s "cmake --build $BUILD_DIR_PATH --target test" rv=$? # cmake output does not contain enough information, submit verbose output log - FILE="$TOPDIR/BUILD/openscap*/build/Testing/Temporary/LastTest.log" + FILE="${BUILD_DIR_PATH}/Testing/Temporary/LastTest.log" rlFileSubmit $(readlink -f $FILE) test_verbose_output.log else rlRun -s "make -C $(readlink -f ${TOPDIR}/BUILD/${PACKAGE}*) check" @@ -110,7 +114,7 @@ rlJournalStart # if we got error, submit file with result of particular test for easier debugging if [ $rv -ne 0 ]; then if rlIsFedora || rlIsRHEL ">=8"; then - FILE="${TOPDIR}/BUILD/${PACKAGE}*/${BUILD_DIR}/tests" + FILE="${BUILD_DIR_PATH}/tests" rlBundleLogs test_outputs_all $(readlink -f $FILE) elif grep "See tests/" $rlRun_LOG; then RESULT=`grep "See tests/" $rlRun_LOG | sed -e "s/See tests\(.*\)/tests\1/"`