Thread (47 messages) 47 messages, 4 authors, 2d ago

Re: [PATCH v3 15/17] selftests/verification: Fix wrong errexit assumption

From: Wen Yang <hidden>
Date: 2026-07-09 17:10:47
Also in: linux-kselftest, lkml


On 6/25/26 20:14, Gabriele Monaco wrote:
RV selftest rely on bash errexit (set -e) to terminate with error, when
a step is expected to return false, the following syntax is used:

   ! cmd

This however prevents the test from exiting when cmd is false (desired)
but doesn't exit if cmd is true, since commands prefixed with ! are
explicitly excluded from errexit.

Use the syntax

   ! cmd || false

Which ends up checking the exit value of ! cmd and supplies a false
command for errexit to evaluate.

Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>

Reviewed-by: Wen Yang <redacted>


--
Best wishes,
Wen
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help