]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
check,common{rc,preamble}: Decouple init_rc() call from sourcing common/rc
authorNirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com>
Wed, 9 Apr 2025 07:00:50 +0000 (07:00 +0000)
committerZorro Lang <zlang@kernel.org>
Thu, 10 Apr 2025 18:35:26 +0000 (02:35 +0800)
Silently executing scripts during sourcing common/rc isn't good practice
and also causes unnecessary script execution. Decouple init_rc() call
and call init_rc() explicitly where required.

Signed-off-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Zorro Lang <zlang@kernel.org>
check
common/preamble
common/rc

diff --git a/check b/check
index 3d621210d86a0f32473ceba499b876bf6676f6e1..9451c350bd1d567f028057e97513dedfd1bdc1d5 100755 (executable)
--- a/check
+++ b/check
@@ -364,6 +364,8 @@ if ! . ./common/rc; then
        exit 1
 fi
 
+init_rc
+
 # If the test config specified a soak test duration, see if there are any
 # unit suffixes that need converting to an integer seconds count.
 if [ -n "$SOAK_DURATION" ]; then
index 0c9ee2e0377dd527a6f021d62a65737b64836f64..c92e55bb486f6ef92a914c04f7d14db278234f16 100644 (file)
@@ -50,6 +50,7 @@ _begin_fstest()
        _register_cleanup _cleanup
 
        . ./common/rc
+       init_rc
 
        # remove previous $seqres.full before test
        rm -f $seqres.full $seqres.hints
index fe95787cf65085f6130dc7242de6f88cc41c0cc3..91747303d2ab7030957ee5597b203cca532c1888 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -5868,8 +5868,6 @@ _require_program() {
        _have_program "$1" || _notrun "$tag required"
 }
 
-init_rc
-
 ################################################################################
 # make sure this script returns success
 /bin/true