> -----Original Message-----
> From: David Marchand <david.march...@redhat.com>
> Sent: Wednesday 23 July 2025 14:32
> To: dev@dpdk.org
> Cc: Bruce Richardson <bruce.richard...@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.march...@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.khal...@huawei.com>

Reply via email to