diff --git a/testing/btest/Files/redis.conf b/testing/btest/Files/redis.conf deleted file mode 100644 index 875c46f9f7..0000000000 --- a/testing/btest/Files/redis.conf +++ /dev/null @@ -1,73 +0,0 @@ -bind 127.0.0.1 -port %REDIS_PORT% -pidfile %RUN_PATH%/redis.pid -loglevel verbose -logfile %RUN_PATH%/redis.log -dir %RUN_PATH% -daemonize no -databases 1 - -# All of the values from here down are the default values in the sample config file -# that comes with redis-server v7.2.7. -protected-mode yes -tcp-backlog 511 -timeout 0 -always-show-logo no -set-proc-title yes -proc-title-template "{title} {listen-addr} {server-mode}" -stop-writes-on-bgsave-error yes -rdbcompression yes -rdbchecksum yes -dbfilename dump.rdb -rdb-del-sync-files no -replica-serve-stale-data yes -replica-read-only yes -repl-diskless-sync yes -repl-diskless-sync-delay 5 -repl-diskless-sync-max-replicas 0 -repl-diskless-load disabled -repl-disable-tcp-nodelay no -replica-priority 100 -acllog-max-len 128 -lazyfree-lazy-eviction no -lazyfree-lazy-expire no -lazyfree-lazy-server-del no -replica-lazy-flush no -lazyfree-lazy-user-del no -lazyfree-lazy-user-flush no -oom-score-adj no -oom-score-adj-values 0 200 800 -disable-thp yes -appendonly no -appendfilename "appendonly.aof" -appenddirname "appendonlydir" -appendfsync everysec -no-appendfsync-on-rewrite no -auto-aof-rewrite-percentage 100 -auto-aof-rewrite-min-size 64mb -aof-load-truncated yes -aof-use-rdb-preamble yes -aof-timestamp-enabled no -slowlog-log-slower-than 10000 -slowlog-max-len 128 -latency-monitor-threshold 0 -notify-keyspace-events "" -hash-max-listpack-entries 512 -hash-max-listpack-value 64 -list-max-listpack-size -2 -list-compress-depth 0 -set-max-intset-entries 512 -zset-max-listpack-entries 128 -zset-max-listpack-value 64 -hll-sparse-max-bytes 3000 -stream-node-max-bytes 4096 -stream-node-max-entries 100 -activerehashing yes -client-output-buffer-limit normal 0 0 0 -client-output-buffer-limit replica 256mb 64mb 60 -client-output-buffer-limit pubsub 32mb 8mb 60 -hz 10 -dynamic-hz yes -aof-rewrite-incremental-fsync yes -rdb-save-incremental-fsync yes -jemalloc-bg-thread yes \ No newline at end of file diff --git a/testing/btest/scripts/base/frameworks/storage/redis-async-reading-pcap.zeek b/testing/btest/scripts/base/frameworks/storage/redis-async-reading-pcap.zeek index fba38d3e59..c79e2383bf 100644 --- a/testing/btest/scripts/base/frameworks/storage/redis-async-reading-pcap.zeek +++ b/testing/btest/scripts/base/frameworks/storage/redis-async-reading-pcap.zeek @@ -3,10 +3,7 @@ # @TEST-REQUIRES: have-redis # @TEST-PORT: REDIS_PORT -# Generate a redis.conf file with the port defined above, but without the /tcp at the end of -# it. This also sets some paths in the conf to the testing directory. -# @TEST-EXEC: cat $FILES/redis.conf | sed "s|%REDIS_PORT%|${REDIS_PORT%/tcp}|g" | sed "s|%RUN_PATH%|$(pwd)|g" > ./redis.conf -# @TEST-EXEC: btest-bg-run redis redis-server ../redis.conf +# @TEST-EXEC: btest-bg-run redis-server run-redis-server ${REDIS_PORT%/tcp} # @TEST-EXEC: zeek -r $TRACES/http/get.trace -b %INPUT > out # @TEST-EXEC: btest-bg-wait -k 0 diff --git a/testing/btest/scripts/base/frameworks/storage/redis-async.zeek b/testing/btest/scripts/base/frameworks/storage/redis-async.zeek index 7923aa6f46..c58596eff3 100644 --- a/testing/btest/scripts/base/frameworks/storage/redis-async.zeek +++ b/testing/btest/scripts/base/frameworks/storage/redis-async.zeek @@ -3,10 +3,7 @@ # @TEST-REQUIRES: have-redis # @TEST-PORT: REDIS_PORT -# Generate a redis.conf file with the port defined above, but without the /tcp at the end of -# it. This also sets some paths in the conf to the testing directory. -# @TEST-EXEC: cat $FILES/redis.conf | sed "s|%REDIS_PORT%|${REDIS_PORT%/tcp}|g" | sed "s|%RUN_PATH%|$(pwd)|g" > ./redis.conf -# @TEST-EXEC: btest-bg-run redis redis-server ../redis.conf +# @TEST-EXEC: btest-bg-run redis-server run-redis-server ${REDIS_PORT%/tcp} # @TEST-EXEC: zeek -b %INPUT > out # @TEST-EXEC: btest-bg-wait -k 0 diff --git a/testing/btest/scripts/base/frameworks/storage/redis-cluster.zeek b/testing/btest/scripts/base/frameworks/storage/redis-cluster.zeek index 7c4996f7f7..ecc0476066 100644 --- a/testing/btest/scripts/base/frameworks/storage/redis-cluster.zeek +++ b/testing/btest/scripts/base/frameworks/storage/redis-cluster.zeek @@ -6,11 +6,7 @@ # @TEST-PORT: BROKER_PORT2 # @TEST-PORT: BROKER_PORT3 -# Generate a redis.conf file with the port defined above, but without the /tcp at the end of -# it. This also sets some paths in the conf to the testing directory. -# @TEST-EXEC: cat $FILES/redis.conf | sed "s|%REDIS_PORT%|${REDIS_PORT%/tcp}|g" | sed "s|%RUN_PATH%|$(pwd)|g" > ./redis.conf -# @TEST-EXEC: btest-bg-run redis redis-server ../redis.conf - +# @TEST-EXEC: btest-bg-run redis-server run-redis-server ${REDIS_PORT%/tcp} # @TEST-EXEC: btest-bg-run manager-1 ZEEKPATH=$ZEEKPATH:.. CLUSTER_NODE=manager-1 zeek -b %INPUT # @TEST-EXEC: btest-bg-run worker-1 ZEEKPATH=$ZEEKPATH:.. CLUSTER_NODE=worker-1 zeek -b %INPUT # @TEST-EXEC: btest-bg-run worker-2 ZEEKPATH=$ZEEKPATH:.. CLUSTER_NODE=worker-2 zeek -b %INPUT diff --git a/testing/btest/scripts/base/frameworks/storage/redis-expiration.zeek b/testing/btest/scripts/base/frameworks/storage/redis-expiration.zeek index 59ff5b540c..c7223c4277 100644 --- a/testing/btest/scripts/base/frameworks/storage/redis-expiration.zeek +++ b/testing/btest/scripts/base/frameworks/storage/redis-expiration.zeek @@ -3,10 +3,7 @@ # @TEST-REQUIRES: have-redis # @TEST-PORT: REDIS_PORT -# Generate a redis.conf file with the port defined above, but without the /tcp at the end of -# it. This also sets some paths in the conf to the testing directory. -# @TEST-EXEC: cat $FILES/redis.conf | sed "s|%REDIS_PORT%|${REDIS_PORT%/tcp}|g" | sed "s|%RUN_PATH%|$(pwd)|g" > ./redis.conf -# @TEST-EXEC: btest-bg-run redis redis-server ../redis.conf +# @TEST-EXEC: btest-bg-run redis-server run-redis-server ${REDIS_PORT%/tcp} # @TEST-EXEC: zcat <$TRACES/echo-connections.pcap.gz | zeek -B storage -b -Cr - %INPUT > out # @TEST-EXEC: btest-bg-wait -k 1 diff --git a/testing/btest/scripts/base/frameworks/storage/redis-sync.zeek b/testing/btest/scripts/base/frameworks/storage/redis-sync.zeek index 42f2b8d0f5..f3d5d4b684 100644 --- a/testing/btest/scripts/base/frameworks/storage/redis-sync.zeek +++ b/testing/btest/scripts/base/frameworks/storage/redis-sync.zeek @@ -3,10 +3,7 @@ # @TEST-REQUIRES: have-redis # @TEST-PORT: REDIS_PORT -# Generate a redis.conf file with the port defined above, but without the /tcp at the end of -# it. This also sets some paths in the conf to the testing directory. -# @TEST-EXEC: cat $FILES/redis.conf | sed "s|%REDIS_PORT%|${REDIS_PORT%/tcp}|g" | sed "s|%RUN_PATH%|$(pwd)|g" > ./redis.conf -# @TEST-EXEC: btest-bg-run redis redis-server ../redis.conf +# @TEST-EXEC: btest-bg-run redis-server run-redis-server ${REDIS_PORT%/tcp} # @TEST-EXEC: zeek -b %INPUT > out # @TEST-EXEC: btest-bg-wait -k 0 diff --git a/testing/scripts/run-redis-server b/testing/scripts/run-redis-server new file mode 100755 index 0000000000..ae11c36b13 --- /dev/null +++ b/testing/scripts/run-redis-server @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +set -eux + +if ! redis-server --version; then + exit 1 +fi + +if [ $# -ne 1 ]; then + echo "Usage $0 " >2 + exit 1 +fi + +listen_port=$1 + +exec redis-server \ + --bind 127.0.0.1 \ + --port ${listen_port} \ + --loglevel verbose \ + --logfile redis.log \ + --pidfile redis.pid \ + --databases 1