]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/standalone: deduplicate cleanup code
authorJoao Eduardo Luis <joao@suse.de>
Wed, 14 Feb 2018 20:57:57 +0000 (20:57 +0000)
committerJoao Eduardo Luis <joao@suse.de>
Fri, 6 Apr 2018 03:18:22 +0000 (04:18 +0100)
Signed-off-by: Joao Eduardo Luis <joao@suse.de>
qa/run-standalone.sh

index c69b3bf9c8ff0a035d2f4af1f13d748ef523cc02..8bd56d9253bf52cd809e39c1829c88fbd6b16074 100755 (executable)
@@ -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"