]> granicus.if.org Git - strace/commit
tests: fix shell errors in detach tests
authorMike Frysinger <vapier@gentoo.org>
Mon, 11 Aug 2014 05:31:23 +0000 (01:31 -0400)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 11 Aug 2014 17:22:38 +0000 (17:22 +0000)
commit2b5bfeb2a84b325e706c6b77f6fb012c2a7e69e8
treeae863c561029fe5f6250747fa2d9f9c0ca683536
parent6673ac74dc998fe3070276ddb9c242f1f913c944
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.
tests/detach-running.test
tests/detach-sleeping.test
tests/detach-stopped.test