public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [tests/openscap] main: Sanity/smoke-test: fix ShellCheck findings
@ 2026-11-02 11:31 Matus Marhefka
0 siblings, 0 replies; only message in thread
From: Matus Marhefka @ 2026-11-02 11:31 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : tests/openscap
Branch : main
Commit : a5a772e72aa1a252ee6c32038c6906c858f88e87
Author : Matus Marhefka <mmarhefk@redhat.com>
Date : 2026-10-29T16:33:40+01:00
Stats : +23/-20 in 1 file(s)
URL : https://src.fedoraproject.org/tests/openscap/c/a5a772e72aa1a252ee6c32038c6906c858f88e87?branch=main
Log:
Sanity/smoke-test: fix ShellCheck findings
---
diff --git a/Sanity/smoke-test/runtest.sh b/Sanity/smoke-test/runtest.sh
index 0da0ae4..13cf0d9 100755
--- a/Sanity/smoke-test/runtest.sh
+++ b/Sanity/smoke-test/runtest.sh
@@ -26,6 +26,7 @@
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# shellcheck disable=SC1091
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="openscap"
@@ -39,6 +40,7 @@ rlJournalStart
RpmSnapshotCreate
CleanupRegister "RpmSnapshotRevert"
rlRun "TmpDir=\$(mktemp -d)" 0
+ # shellcheck disable=SC2154 # TmpDir is assigned by rlRun above
CleanupRegister "rlRun 'rm -r $TmpDir' 0 'Removing tmp directory'"
rlRun "cp fix_hugepages_err7.patch fix_hugepages_err.patch $TmpDir"
rlRun "pushd $TmpDir"
@@ -74,9 +76,9 @@ rlJournalStart
else
rlRun "dnf builddep -y $PACKAGE*"
fi
- TOPDIR=`rpm --eval %_topdir`
+ TOPDIR=$(rpm --eval %_topdir)
rlRun "rm -rf ${TOPDIR}/BUILD/${PACKAGE}*" 0-255
- rlRun "rpm -ihv `ls *.rpm`" 0 "Install $PACKAGE source RPM"
+ rlRun "rpm -ihv ./*.rpm" 0 "Install $PACKAGE source RPM"
rlPhaseEnd
rlPhaseStartSetup "Prepare upstream test suite (%prep and %build stages from the spec file)"
@@ -92,7 +94,7 @@ rlJournalStart
rlLogInfo "and is a known issue on RHEL >= 8:"
rlLogInfo "https://bugzilla.redhat.com/show_bug.cgi?id=1642995"
TEST_CWD=$(pwd)
- TREE_CWD=$(readlink -f ${TOPDIR}/BUILD/${PACKAGE}*)
+ TREE_CWD=$(readlink -f "${TOPDIR}/BUILD/${PACKAGE}"*)
if rlIsRHEL 7; then
HUGEPAGES_PATCH="fix_hugepages_err7.patch"
else
@@ -108,44 +110,45 @@ rlJournalStart
rlPhaseStartTest "Run upstream test suite against installed $PACKAGE"
rlRun "export OSCAP_FULL_VALIDATION=1"
rlRun "export CUSTOM_OSCAP=$(which oscap)"
- BUILD_DIR="$(rpm --eval %{_vpath_builddir})"
+ BUILD_DIR="$(rpm --eval '%{_vpath_builddir}')"
if rlIsFedora ">=41"; then
- BUILD_DIR_PATH=$(readlink -f ${TOPDIR}/BUILD/${PACKAGE}*/${PACKAGE}*/${BUILD_DIR})
+ BUILD_DIR_PATH=$(readlink -f "${TOPDIR}/BUILD/${PACKAGE}"*/"${PACKAGE}"*/"${BUILD_DIR}")
else
- BUILD_DIR_PATH=$(readlink -f ${TOPDIR}/BUILD/${PACKAGE}*/${BUILD_DIR})
+ 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)
+ BUILD_DIR_PATH=$(readlink -f "${TOPDIR}/BUILD/${PACKAGE}"*/build)
fi
fi
if rlIsRHEL "<=7"; then
- rlRun -s "make -C $(readlink -f ${TOPDIR}/BUILD/${PACKAGE}*) check"
+ rlRun -s "make -C $(readlink -f "${TOPDIR}/BUILD/${PACKAGE}"*) check"
rv=$?
else
rlRun -s "ctest --test-dir $BUILD_DIR_PATH --output-on-failure"
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
+ rlFileSubmit "$(readlink -f "$FILE")" test_verbose_output.log
fi
# if we got error, submit file with result of particular test for easier debugging
if [ $rv -ne 0 ]; then
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 $(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)
+ # shellcheck disable=SC2154 # rlRun_LOG is set by rlRun -s
+ if grep "See tests/" "$rlRun_LOG"; then
+ RESULT=$(grep "See tests/" "$rlRun_LOG" | sed -e "s/See tests\(.*\)/tests\1/")
+ FILE=$(readlink -f "${TOPDIR}/BUILD/${PACKAGE}"*/"${RESULT}")
+ cat "$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=$(readlink -f "${TOPDIR}/BUILD/${PACKAGE}"*/"${RESULT}")
+ cat "$FILE"
+ rlBundleLogs test_outputs_deep "$(dirname "$FILE")"
fi
fi
else
FILE="${BUILD_DIR_PATH}/tests"
- rlBundleLogs test_outputs_all $(readlink -f $FILE)
+ rlBundleLogs test_outputs_all "$(readlink -f "$FILE")"
fi
fi
rlPhaseEnd
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-02 11:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-02 11:31 [tests/openscap] main: Sanity/smoke-test: fix ShellCheck findings Matus Marhefka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox