[PATCH v5 11/22] test/telemetry: catch errors in subshell
Marat Khalili
marat.khalili at huawei.com
Thu Jul 24 13:50:07 CEST 2025
> -----Original Message-----
> From: David Marchand <david.marchand at redhat.com>
> Sent: Wednesday 23 July 2025 14:32
> To: dev at dpdk.org
> Cc: Bruce Richardson <bruce.richardson at intel.com>
> Subject: [PATCH v5 11/22] test/telemetry: catch errors in subshell
>
> This script relies on subshell and pipes to prepare a list of commands
> to pass to the telemetry script.
>
> However, errors are not propagated to the parent process and the test
> may still pass when an error occurs.
> There is no POSIX option to cleanly catch all errors, so rely on bash
> options (as some CI envs run with bash).
>
> Signed-off-by: David Marchand <david.marchand at redhat.com>
> ---
> app/test/suites/test_telemetry.sh | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/app/test/suites/test_telemetry.sh
> b/app/test/suites/test_telemetry.sh
> index 20806b43e4..3c5b629b63 100755
> --- a/app/test/suites/test_telemetry.sh
> +++ b/app/test/suites/test_telemetry.sh
> @@ -15,7 +15,7 @@ call_all_telemetry() {
> telemetry_script=$rootdir/usertools/dpdk-telemetry.py
> echo >$tmpoutput
> echo "Telemetry commands log:" >>$tmpoutput
> - for cmd in $(echo / | $telemetry_script | jq -r '.["/"][]')
> + echo / | $telemetry_script | jq -r '.["/"][]' | while read cmd
> do
> for input in $cmd $cmd,0 $cmd,z
> do
> @@ -25,4 +25,6 @@ call_all_telemetry() {
> done
> }
>
> +! set -o | grep -q errtrace || set -o errtrace
> +! set -o | grep -q pipefail || set -o pipefail
> (sleep 1 && call_all_telemetry && echo quit) | $@
> --
> 2.50.0
Acked-by: Marat Khalili <marat.khalili at huawei.com>
More information about the dev
mailing list