[PATCH v4 11/22] test/telemetry: catch errors in subshell
David Marchand
david.marchand at redhat.com
Wed Jul 16 15:01:58 CEST 2025
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
More information about the dev
mailing list