summaryrefslogtreecommitdiff
path: root/test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test.sh')
-rwxr-xr-xtest.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/test.sh b/test.sh
index c72bcb0..a518db7 100755
--- a/test.sh
+++ b/test.sh
@@ -5,9 +5,16 @@ REDIS_PORT=${REDIS_PORT:-56379}
REDIS_SSL_PORT=${REDIS_SSL_PORT:-56443}
TEST_SSL=${TEST_SSL:-0}
SKIPS_AS_FAILS=${SKIPS_AS_FAILS-:0}
+ENABLE_DEBUG_CMD=
SSL_TEST_ARGS=
SKIPS_ARG=
+# We need to enable the DEBUG command for redis-server >= 7.0.0
+REDIS_MAJOR_VERSION="$(redis-server --version|awk -F'[^0-9]+' '{ print $2 }')"
+if [ "$REDIS_MAJOR_VERSION" -gt "6" ]; then
+ ENABLE_DEBUG_CMD="enable-debug-command local"
+fi
+
tmpdir=$(mktemp -d)
PID_FILE=${tmpdir}/hiredis-test-redis.pid
SOCK_FILE=${tmpdir}/hiredis-test-redis.sock
@@ -49,8 +56,10 @@ cleanup() {
}
trap cleanup INT TERM EXIT
+
cat > ${tmpdir}/redis.conf <<EOF
daemonize yes
+${ENABLE_DEBUG_CMD}
pidfile ${PID_FILE}
port ${REDIS_PORT}
bind 127.0.0.1