From: Andrew Jones <andrew.jones@linux.dev>
To: Thomas Huth <thuth@redhat.com>
Cc: kvm@vger.kernel.org, "Claudio Imbrenda" <imbrenda@linux.ibm.com>,
"Janosch Frank" <frankja@linux.ibm.com>,
"Nico Böhr" <nrb@linux.ibm.com>
Subject: Re: [kvm-unit-tests PATCH v2] scripts/arch-run.bash: Drop the dependency on "jq"
Date: Tue, 9 Sep 2025 11:05:31 -0500 [thread overview]
Message-ID: <20250909-007d720ee7bacfea514e5f19@orel> (raw)
In-Reply-To: <20250909045855.71512-1-thuth@redhat.com>
On Tue, Sep 09, 2025 at 06:58:55AM +0200, Thomas Huth wrote:
> From: Thomas Huth <thuth@redhat.com>
>
> For checking whether a panic event occurred, a simple "grep"
> for the related text in the output is enough - it's very unlikely
> that the output of QEMU will change. This way we can drop the
> dependency on the program "jq" which might not be installed on
> some systems.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> v2: Change the regular expression according to Claudio's suggestion
>
> scripts/arch-run.bash | 8 +-------
> 1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash
> index 36222355..16417a1e 100644
> --- a/scripts/arch-run.bash
> +++ b/scripts/arch-run.bash
> @@ -296,11 +296,6 @@ do_migration ()
>
> run_panic ()
> {
> - if ! command -v jq >/dev/null 2>&1; then
> - echo "${FUNCNAME[0]} needs jq" >&2
> - return 77
> - fi
> -
> trap 'trap - TERM ; kill 0 ; exit 2' INT TERM
> trap 'rm -f ${qmp}.in ${qmp}.out' RETURN EXIT
>
> @@ -312,8 +307,7 @@ run_panic ()
> -mon chardev=mon,mode=control -S &
> echo '{ "execute": "qmp_capabilities" }{ "execute": "cont" }' > ${qmp}.in
>
> - panic_event_count=$(jq -c 'select(.event == "GUEST_PANICKED")' < ${qmp}.out | wc -l)
> - if [ "$panic_event_count" -lt 1 ]; then
> + if ! grep -E -q '"event"[[:blank:]]*:[[:blank:]]*"GUEST_PANICKED"' ${qmp}.out ; then
> echo "FAIL: guest did not panic"
> ret=3
> else
> --
> 2.51.0
>
Reviewed-by: Andrew Jones <andrew.jones@linux.dev>
next prev parent reply other threads:[~2025-09-09 16:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-09 4:58 [kvm-unit-tests PATCH v2] scripts/arch-run.bash: Drop the dependency on "jq" Thomas Huth
2025-09-09 13:49 ` Claudio Imbrenda
2025-09-09 16:05 ` Andrew Jones [this message]
2025-09-10 7:57 ` Nico Boehr
2025-09-10 9:00 ` Claudio Imbrenda
2025-09-10 9:06 ` Thomas Huth
2025-09-10 11:36 ` Nico Boehr
-- strict thread matches above, loose matches on Subject: below --
2025-07-31 11:05 Thomas Huth
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=20250909-007d720ee7bacfea514e5f19@orel \
--to=andrew.jones@linux.dev \
--cc=frankja@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=nrb@linux.ibm.com \
--cc=thuth@redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox