From: David Zafman Date: Fri, 18 Aug 2017 17:00:10 +0000 (-0700) Subject: tests: run-standalone.sh skip core_pattern if already set X-Git-Tag: v12.2.0~31^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F16985%2Fhead;p=ceph.git tests: run-standalone.sh skip core_pattern if already set If sudo requires a password it is nice to be able to avoid sudo sysctl by setting core_pattern ahead of time. Signed-off-by: David Zafman (cherry picked from commit 599d7622dd0bd7f73145cc229b576d5de7f04fda) --- diff --git a/qa/run-standalone.sh b/qa/run-standalone.sh index d470e0401acc..3be6121f6ff3 100755 --- a/qa/run-standalone.sh +++ b/qa/run-standalone.sh @@ -55,7 +55,12 @@ count=0 errors=0 userargs="" precore="$(sysctl -n $KERNCORE)" -sudo sysctl -w ${KERNCORE}=${COREPATTERN} +# If corepattern already set, avoid having to use sudo +if [ "$precore" = "$COREPATTERN" ]; then + precore="" +else + sudo sysctl -w ${KERNCORE}=${COREPATTERN} +fi ulimit -c unlimited for f in $(cd $location ; find . -perm $exec_mode -type f) do @@ -105,7 +110,9 @@ do fi fi done -sudo sysctl -w ${KERNCORE}=${precore} +if [ -n "$precore" ]; then + sudo sysctl -w ${KERNCORE}=${precore} +fi if [ "$errors" != "0" ]; then echo "$errors TESTS FAILED, $count TOTAL TESTS"