public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Matus Marhefka <mmarhefk@redhat.com>
To: git-commits@fedoraproject.org
Subject: [tests/openscap] main: Sanity/smoke-test: fix ShellCheck findings
Date: Mon, 02 Nov 2026 11:31:43 GMT	[thread overview]
Message-ID: <179361910376.1.4653015342496027400.tests-openscap-a5a772e72aa1@fedoraproject.org> (raw)

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

                 reply	other threads:[~2026-11-02 11:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179361910376.1.4653015342496027400.tests-openscap-a5a772e72aa1@fedoraproject.org \
    --to=mmarhefk@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox