summaryrefslogtreecommitdiff
path: root/tests/detach-stopped.test
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2014-08-11 01:31:23 -0400
committerDmitry V. Levin <ldv@altlinux.org>2014-08-11 17:22:38 +0000
commit2b5bfeb2a84b325e706c6b77f6fb012c2a7e69e8 (patch)
treeae863c561029fe5f6250747fa2d9f9c0ca683536 /tests/detach-stopped.test
parent6673ac74dc998fe3070276ddb9c242f1f913c944 (diff)
downloadstrace-2b5bfeb2a84b325e706c6b77f6fb012c2a7e69e8.tar.gz
tests: fix shell errors in detach tests
The current detach test code does: set -e ... cleanup() { set +e kill ... wait ... } ... cleanup exit 0 The problem is that while `set -e` is disabled for the body of the cleanup function, it isn't necessarily disabled in the caller scope. So if the return value of the cleanup function (`wait` in this case) is non-zero, the script ends up failing overall. Add an explicit return 0 to the cleanup function so that we don't kill the overall test pipeline. * tests/detach-running.test (cleanup): Add return 0. * tests/detach-sleeping.test (cleanup): Likewise. * tests/detach-stopped.test (cleanup): Likewise.
Diffstat (limited to 'tests/detach-stopped.test')
-rwxr-xr-xtests/detach-stopped.test1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/detach-stopped.test b/tests/detach-stopped.test
index 81fd30314..88499bfcf 100755
--- a/tests/detach-stopped.test
+++ b/tests/detach-stopped.test
@@ -27,6 +27,7 @@ cleanup()
kill $tracee_pid
kill -CONT $tracee_pid
wait $tracee_pid 2> /dev/null
+ return 0
}
rm -f $LOG