From 69bdf04c98c3152f1d6c700593e7400dcf43b619 Mon Sep 17 00:00:00 2001 From: "Nirjhar Roy (IBM)" Date: Wed, 9 Apr 2025 07:00:50 +0000 Subject: [PATCH] check,common{rc,preamble}: Decouple init_rc() call from sourcing common/rc 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) Reviewed-by: Dave Chinner Reviewed-by: Ritesh Harjani (IBM) Reviewed-by: Darrick J. Wong Signed-off-by: Zorro Lang --- check | 2 ++ common/preamble | 1 + common/rc | 2 -- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/check b/check index 3d621210..9451c350 100755 --- 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 diff --git a/common/preamble b/common/preamble index 0c9ee2e0..c92e55bb 100644 --- a/common/preamble +++ b/common/preamble @@ -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 diff --git a/common/rc b/common/rc index fe95787c..91747303 100644 --- 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 -- 2.39.5