From a77c80605fbc73878b58276851ec602b2962276e Mon Sep 17 00:00:00 2001 From: Matus Marhefka Date: Fri, 18 Mar 2022 11:17:03 +0100 Subject: [PATCH] Sanity/smoke-test: update test to work on CentOS Stream --- Sanity/smoke-test/runtest.sh | 38 +++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/Sanity/smoke-test/runtest.sh b/Sanity/smoke-test/runtest.sh index 5200a5a..8010ef2 100755 --- a/Sanity/smoke-test/runtest.sh +++ b/Sanity/smoke-test/runtest.sh @@ -64,10 +64,10 @@ rlJournalStart fi rlFetchSrcForInstalled $PACKAGE - if rlIsFedora || rlIsRHEL ">=8"; then - rlRun "dnf builddep -y $PACKAGE*" - else + if rlIsRHEL "<=7"; then rlRun "yum-builddep -y $PACKAGE*" + else + rlRun "dnf builddep -y $PACKAGE*" fi TOPDIR=`rpm --eval %_topdir` rlRun "rm -rf ${TOPDIR}/BUILD/${PACKAGE}*" 0-255 @@ -108,33 +108,35 @@ rlJournalStart if [ ! -d "$BUILD_DIR_PATH" ]; then BUILD_DIR_PATH=$(readlink -f ${TOPDIR}/BUILD/${PACKAGE}*/build) fi - if rlIsFedora || rlIsRHEL ">=8"; then + if rlIsRHEL "<=7"; then + rlRun -s "make -C $(readlink -f ${TOPDIR}/BUILD/${PACKAGE}*) check" + rv=$? + else rlRun -s "cmake --build $BUILD_DIR_PATH --target test" rv=$? # cmake output does not contain enough information, submit verbose output 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" - rv=$? fi # 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="${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/"` - FILE="${TOPDIR}/BUILD/${PACKAGE}*/${RESULT}" - cat $(readlink -f $FILE) - rlBundleLogs test_outputs $(dirname $FILE) - if grep "See tests/" $FILE; then # we need to go deeper ... - RESULT=`grep "See tests/" $FILE | sed -e "s/See tests\(.*\)/tests\1/"` + if rlIsRHEL "<=7"; then + if grep "See tests/" $rlRun_LOG; then + RESULT=`grep "See tests/" $rlRun_LOG | sed -e "s/See tests\(.*\)/tests\1/"` FILE="${TOPDIR}/BUILD/${PACKAGE}*/${RESULT}" cat $(readlink -f $FILE) - rlBundleLogs test_outputs_deep $(dirname $FILE) + rlBundleLogs test_outputs $(dirname $FILE) + if grep "See tests/" $FILE; then # we need to go deeper ... + RESULT=`grep "See tests/" $FILE | sed -e "s/See tests\(.*\)/tests\1/"` + FILE="${TOPDIR}/BUILD/${PACKAGE}*/${RESULT}" + cat $(readlink -f $FILE) + rlBundleLogs test_outputs_deep $(dirname $FILE) + fi fi + else + FILE="${BUILD_DIR_PATH}/tests" + rlBundleLogs test_outputs_all $(readlink -f $FILE) fi fi rlPhaseEnd