From: Joao Eduardo Luis Date: Wed, 14 Feb 2018 20:57:57 +0000 (+0000) Subject: qa/standalone: deduplicate cleanup code X-Git-Tag: v13.1.0~393^2~4 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=f501458967954c0e074643ba4999653cea58d8d1;p=ceph.git qa/standalone: deduplicate cleanup code Signed-off-by: Joao Eduardo Luis --- diff --git a/qa/run-standalone.sh b/qa/run-standalone.sh index c69b3bf9c8ff0..8bd56d9253bf5 100755 --- a/qa/run-standalone.sh +++ b/qa/run-standalone.sh @@ -44,10 +44,14 @@ else COREPATTERN="core.%e.%p.%t" fi -function finish() { +function cleanup() { if [ -n "$precore" ]; then sudo sysctl -w ${KERNCORE}=${precore} fi +} + +function finish() { + cleanup exit 0 } @@ -135,9 +139,7 @@ do fi fi done -if [ -n "$precore" ]; then - sudo sysctl -w ${KERNCORE}="${precore}" -fi +cleanup if [ "$errors" != "0" ]; then echo "$errors TESTS FAILED, $count TOTAL TESTS"