[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/6] grub-shell: Allow specifying non-default trim line contents
From: |
Glenn Washburn |
Subject: |
[PATCH 3/6] grub-shell: Allow specifying non-default trim line contents |
Date: |
Tue, 10 Jan 2023 16:08:57 -0600 |
This will be useful for tests that have unwanted output from setup. This is
not documented because its only intended to be internal at the moment. Also,
--no-trim is allowed to explicitly turn off trim.
Signed-off-by: Glenn Washburn <development@efficientek.com>
---
tests/util/grub-shell.in | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/tests/util/grub-shell.in b/tests/util/grub-shell.in
index e5d34d1d35..585f0d066e 100644
--- a/tests/util/grub-shell.in
+++ b/tests/util/grub-shell.in
@@ -32,6 +32,7 @@ PATH="${builddir}:$PATH"
export PATH
trim=0
+trim_head=664cbea8-132f-4770-8aa4-1696d59ac35c
# Usage: usage
# Print the usage.
@@ -226,8 +227,13 @@ for option in "$@"; do
echo "$0 (GNU GRUB ${PACKAGE_VERSION})"
exit 0 ;;
--trim)
- trim=1
+ trim=1 ;;
+ --trim=*)
+ trim=2
+ trim_head=`echo "$option" | sed -e 's/--trim=//' -e 's/,/ /g'`
;;
+ --no-trim)
+ trim=0 ;;
--debug)
debug=1 ;;
--modules=*)
@@ -353,8 +359,6 @@ terminal_input ${term}
terminal_output ${term}
EOF
-trim_head=664cbea8-132f-4770-8aa4-1696d59ac35c
-
if [ $trim = 1 ]; then
echo "echo $trim_head" >>${cfgfile}
fi
@@ -479,8 +483,8 @@ fi
do_trim ()
{
- if [ $trim = 1 ]; then
- awk '{ if (have_head == 1) print $0; }
/664cbea8-132f-4770-8aa4-1696d59ac35c/ { have_head=1; }'
+ if [ $trim = 1 ] || [ $trim = 2 ]; then
+ awk '{ if (have_head == 1) print $0; } /'"$trim_head"'/ { have_head=1;
}'
else
cat
fi
--
2.34.1
- [PATCH 0/6] Cryptomount testing, Glenn Washburn, 2023/01/10
- [PATCH 1/6] grub-shell: Set exit status to qemu exit status, Glenn Washburn, 2023/01/10
- [PATCH 2/6] grub-shell: Only cleanup working directory file if QEMU does not fail or timeout, Glenn Washburn, 2023/01/10
- [PATCH 3/6] grub-shell: Allow specifying non-default trim line contents,
Glenn Washburn <=
- [PATCH 4/6] grub-shell: Trim line should always be matched from the beginning of the line, Glenn Washburn, 2023/01/10
- [PATCH 5/6] grub-shell: Add halt_cmd variable to testcase namespace, Glenn Washburn, 2023/01/10
- [PATCH 6/6] tests: Add cryptomount functional test, Glenn Washburn, 2023/01/10
- Re: [PATCH 0/6] Cryptomount testing, Daniel Kiper, 2023/01/12