From: Glenn Washburn <development@efficientek.com>
To: grub-devel@gnu.org, Daniel Kiper <dkiper@net-space.pl>
Cc: Glenn Washburn <development@efficientek.com>
Subject: [PATCH 1/3] tests: Allow turning on shell tracing from environment variables
Date: Sat, 21 Jan 2023 00:10:44 -0600 [thread overview]
Message-ID: <20230121061046.1619695-2-development@efficientek.com> (raw)
In-Reply-To: <20230121061046.1619695-1-development@efficientek.com>
This allows turning on shell tracing for grub-shell and grub-fs-tester when
its not practical or not possible to use commandline arguments (eg. from
`make check`). Turn on tracing when the envvar is an integer greater than 1,
since these can generate a lot of output. Since this change uses the
environment variables to set the default value for debug in grub-shell, this
allows enabling grub-shell's debug mode which will preserve various
generated output files that are helpful for debugging tests.
Signed-off-by: Glenn Washburn <development@efficientek.com>
---
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 cd63941a5f..c9c2d79f22 100644
--- a/tests/util/grub-fs-tester.in
+++ b/tests/util/grub-fs-tester.in
@@ -6,6 +6,8 @@ export BLKID_FILE=/dev/null
# We can't have this set, or filesystem tests will fail.
unset SOURCE_DATE_EPOCH
+[ "${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 f5a6e822fd..60494bcf1d 100644
--- a/tests/util/grub-shell.in
+++ b/tests/util/grub-shell.in
@@ -216,6 +216,7 @@ esac
timeout=60
mkimage_extra_arg=
+debug=${GRUB_SHELL_DEFAULT_DEBUG:-$GRUB_TEST_DEFAULT_DEBUG}
# Check the arguments.
for option in "$@"; do
@@ -235,7 +236,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" ;;
@@ -320,6 +321,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.34.1
next prev parent reply other threads:[~2023-01-21 6:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-21 6:10 [PATCH 0/3] Allow easy re-running of grub-shell from failed tests Glenn Washburn
2023-01-21 6:10 ` Glenn Washburn [this message]
2023-01-21 6:10 ` [PATCH 2/3] grub-shell: Create run.sh in working directory for easily running test again Glenn Washburn
2023-01-21 6:10 ` [PATCH 3/3] grub-shell: Add $GRUB_QEMU_OPTS to run.sh to easily see unofficial QEMU arguments Glenn Washburn
2023-01-25 17:26 ` [PATCH 0/3] Allow easy re-running of grub-shell from failed tests Daniel Kiper
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=20230121061046.1619695-2-development@efficientek.com \
--to=development@efficientek.com \
--cc=dkiper@net-space.pl \
--cc=grub-devel@gnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.