From c4beb5a4a0c9173d394a03235367d68ac6fd35d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B5=D0=BE=D0=BD=D0=B8=D0=B4=20=D0=AE=D1=80=D1=8C?= =?UTF-8?q?=D0=B5=D0=B2=20=28Leonid=20Yuriev=29?= Date: Thu, 13 Oct 2022 17:56:42 +0300 Subject: [PATCH] =?UTF-8?q?mdbx-test:=20=D0=BD=D0=B5=20=D0=B2=D1=8B=D0=B7?= =?UTF-8?q?=D1=8B=D0=B2=D0=B0=D0=B5=D0=BC=20`sudo`=20=D0=BF=D1=80=D0=B8=20?= =?UTF-8?q?=D0=BE=D1=82=D1=81=D1=83=D1=82=D1=81=D1=82=D0=B2=D0=B8=D0=B8.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/long_stochastic.sh | 6 +++++- test/stochastic_small.sh | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/test/long_stochastic.sh b/test/long_stochastic.sh index 29e70949..d75607ec 100755 --- a/test/long_stochastic.sh +++ b/test/long_stochastic.sh @@ -275,7 +275,11 @@ case ${UNAME} in ulimit -c unlimited if [ "$(cat /proc/sys/kernel/core_pattern)" != "core.%p" ]; then echo "core.%p > /proc/sys/kernel/core_pattern" >&2 - echo "core.%p" | sudo tee /proc/sys/kernel/core_pattern || true + if [ $(id -u) -ne 0 -a -n "$(which sudo 2>/dev/null)" ]; then + echo "core.%p" | sudo tee /proc/sys/kernel/core_pattern || true + else + (echo "core.%p" > /proc/sys/kernel/core_pattern) || true + fi fi ;; diff --git a/test/stochastic_small.sh b/test/stochastic_small.sh index 5e216ced..b0aa1cb7 100755 --- a/test/stochastic_small.sh +++ b/test/stochastic_small.sh @@ -213,7 +213,11 @@ case ${UNAME} in ulimit -c unlimited if [ "$(cat /proc/sys/kernel/core_pattern)" != "core.%p" ]; then echo "core.%p > /proc/sys/kernel/core_pattern" >&2 - echo "core.%p" | sudo tee /proc/sys/kernel/core_pattern || true + if [ $(id -u) -ne 0 -a -n "$(which sudo 2>/dev/null)" ]; then + echo "core.%p" | sudo tee /proc/sys/kernel/core_pattern || true + else + (echo "core.%p" > /proc/sys/kernel/core_pattern) || true + fi fi ;;