diff options
| author | Mark Wielaard <[email protected]> | 2021-09-09 21:51:51 +0200 |
|---|---|---|
| committer | Mark Wielaard <[email protected]> | 2021-09-09 22:53:05 +0200 |
| commit | bbf0dc0162e82770f296b2ecda77a2b5bd6f7405 (patch) | |
| tree | a906b556d2b96df60b448c129521f1a240116a68 /tests/debuginfod-subr.sh | |
| parent | b561b51a472779a083f4b109b9821bc7963a6ff4 (diff) | |
tests: Don't fail run-debuginfod-fd-prefetch-caches.sh if grep -c fails
The set -o errtrace made run-debuginfod-fd-prefetch-caches.sh
fail. On some systems. Add set -o functrace to make it fail consistently.
The failure is because the grep -c for in the log file fails (it
returns zero). Fix this by using || true. But this is only a
workaround. It makes the test pass, but only because all values are
always zero. The test doesn't currently test anything.
Also make sure that err and cleanup are only executed once.
Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'tests/debuginfod-subr.sh')
| -rwxr-xr-x | tests/debuginfod-subr.sh | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/debuginfod-subr.sh b/tests/debuginfod-subr.sh index c21b7b8a..59033f35 100755 --- a/tests/debuginfod-subr.sh +++ b/tests/debuginfod-subr.sh @@ -17,6 +17,7 @@ # sourced from run-debuginfod-*.sh tests (must be bash scripts) # We trap ERR and like commands that fail in function to also trap +set -o functrace set -o errtrace . $srcdir/test-subr.sh # includes set -e @@ -30,6 +31,9 @@ echo "zstd=$zstd bsdtar=`bsdtar --version`" cleanup() { + # No more cleanups after this cleanup + trap - 0 + if [ $PID1 -ne 0 ]; then kill $PID1 || : ; wait $PID1 || :; fi if [ $PID2 -ne 0 ]; then kill $PID2 || : ; wait $PID2 || :; fi rm -rf F R D L Z ${PWD}/foobar ${PWD}/mocktree ${PWD}/.client_cache* ${PWD}/tmp* @@ -41,6 +45,9 @@ trap cleanup 0 errfiles_list= err() { + # Don't trap any new errors from now on + trap - ERR + echo ERROR REPORTS for port in $PORT1 $PORT2 do |
