Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1n3sA8-0008Eq-KF for mharc-grub-devel@gnu.org; Sat, 01 Jan 2022 23:08:04 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41666) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3s9v-00080L-LU for grub-devel@gnu.org; Sat, 01 Jan 2022 23:07:52 -0500 Received: from [2607:f8b0:4864:20::f2e] (port=46739 helo=mail-qv1-xf2e.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n3s9u-0002Dd-6N for grub-devel@gnu.org; Sat, 01 Jan 2022 23:07:51 -0500 Received: by mail-qv1-xf2e.google.com with SMTP id r6so27960423qvr.13 for ; Sat, 01 Jan 2022 20:07:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SB1zEtKutFFSX+KO2GENRyXvLiKEcleKE2Y28Rehz0Y=; b=MQUNtna3fAPSrXsBiCvQlk82CpmsxZ4pGHiCRHeQ5E20iSX8HKyIcUvoLdVHXJjom5 6mGjuw4oku696hyJqHL9blPWRRisgyczWJijvCLQj4ZPwc+FdZVtKn2bKNNYCxWTlFDb YgQ7IkpWgEKIUDz83U03+3rFa+SRtxxvKNlb6dUhZidcrywOfLdME3KjMyz3ru5a0UNu xCqjvJfJWLhX2PciEyd3h3vgzodiWuUxFwKmIxLzsUMq2SJTaxhqn1+elI2HdtIyRaJn 8Ux7eDg5dlfgvephtxHX89l7nL3S4x1AKJ0j6cbuiJ6bvSEav+48lgKpmysmNuZTvz+E Ndqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SB1zEtKutFFSX+KO2GENRyXvLiKEcleKE2Y28Rehz0Y=; b=D4fSMPCJ9yCmtocgnlu0AZVE/NGWJ4lEnu+hKdHsIYtzF9ZYaNaG5jZWR9LpYgLT89 fSQrv78ZkYkJ3VfAbNcxhUXKdhjUDfiwUOzaRACpfMpFfMD2gtsG3b1Zs5WFKkuDzGEM xYJGppUQX6uIS8mvzIzvHXyC87YKlI0+HUwDJXV+VSSSOrR+UZIaQlB7eJp1VsOP0rCB YiYNQNwd66kJ4TAuoHB/aWZIv9vMkbtwkBmPFCdNxpkvZqwUV2Vv2yTTsvTphHX+SEfx pBGcXZb5Rro7NMqvQTYmKCirLmBcKSMxjvE2fO3OxkNU9VVWqIRLghGMTXmawA/oyPgB uVJA== X-Gm-Message-State: AOAM530yJTi+ksCvDdpbFsv69ZLY/GJAKmWFrQGWptPVqkZY5LS+jXlg VSHs/yeTV8apvWgCQuWeI2zfg1Q9STfOBA== X-Google-Smtp-Source: ABdhPJxcenqYe98QEuCr0i0ZNTwOMQBIAycORcdV4pWsmw8MvQ/AaXne9aOYQbnQrDhW2XCqcrib8g== X-Received: by 2002:ad4:4ee3:: with SMTP id dv3mr37192982qvb.8.1641096469510; Sat, 01 Jan 2022 20:07:49 -0800 (PST) Received: from localhost.localdomain ([37.218.244.251]) by smtp.gmail.com with ESMTPSA id 137sm22660725qkm.69.2022.01.01.20.07.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Jan 2022 20:07:49 -0800 (PST) From: Glenn Washburn To: Daniel Kiper , grub-devel@gnu.org Cc: Glenn Washburn Subject: [PATCH v2 08/12] tests: Allow turning on shell tracing from environment variables Date: Sat, 1 Jan 2022 22:07:18 -0600 Message-Id: X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::f2e (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::f2e; envelope-from=development@efficientek.com; helo=mail-qv1-xf2e.google.com X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jan 2022 04:07:52 -0000 This allows turning on shell tracing when its not practical or not possible to use commandline arguments. Turn on tracing when the envvar is an integer greater than 1, since these can log a lot of messages. Signed-off-by: Glenn Washburn --- tests/util/grub-fs-tester.in | 2 ++ tests/util/grub-shell.in | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/util/grub-fs-tester.in b/tests/util/grub-fs-tester.in index 2dcd09f5e..6b8028f9b 100644 --- a/tests/util/grub-fs-tester.in +++ b/tests/util/grub-fs-tester.in @@ -2,6 +2,8 @@ set -e +[ "${GRUB_TEST_DEFAULT_DEBUG:-0}" -gt 1 ] && set -x + fs="$1" GRUBFSTEST="@builddir@/grub-fstest" diff --git a/tests/util/grub-shell.in b/tests/util/grub-shell.in index f4b733858..78f27339f 100644 --- a/tests/util/grub-shell.in +++ b/tests/util/grub-shell.in @@ -215,6 +215,7 @@ esac timeout=${GRUB_SHELL_DEFAULT_TIMEOUT:-60} mkimage_extra_arg= +debug=${GRUB_SHELL_DEFAULT_DEBUG:-$GRUB_TEST_DEFAULT_DEBUG} # Check the arguments. for option in "$@"; do @@ -234,7 +235,7 @@ for option in "$@"; do --no-trim) trim=0 ;; --debug) - debug=1 ;; + debug=$((debug+1)) ;; --modules=*) ms=`echo "$option" | sed -e 's/--modules=//' -e 's/,/ /g'` modules="$modules $ms" ;; @@ -319,6 +320,8 @@ for option in "$@"; do esac done +[ "${debug:-0}" -gt 1 ] && set -x + if [ "x${source}" = x ] ; then tmpfile="$work_directory/testcase.cfg" while read REPLY; do -- 2.27.0