From bf870a56116dc457f6e57583417e228ea8484715 Mon Sep 17 00:00:00 2001 From: dvora-h Date: Tue, 11 Jan 2022 03:27:38 +0200 Subject: [PATCH 01/25] add redis5 and redis4 dockers --- docker/base/Dockerfile.cluster4 | 9 +++++++++ docker/base/Dockerfile.cluster5 | 9 +++++++++ docker/base/Dockerfile.sentinel4 | 4 ++++ docker/base/Dockerfile.sentinel5 | 4 ++++ docker/base/Dockerfile.v4.0 | 4 ++++ docker/base/Dockerfile.v5.0 | 4 ++++ docker/base/create_cluster.sh | 0 docker/base/create_cluster4.sh | 26 ++++++++++++++++++++++++++ docker/base/create_cluster5.sh | 26 ++++++++++++++++++++++++++ docker/redis4/redis.conf | 2 ++ docker/redis4_sentinel/sentinel_1.conf | 6 ++++++ docker/redis4_sentinel/sentinel_2.conf | 6 ++++++ docker/redis4_sentinel/sentinel_3.conf | 6 ++++++ docker/redis5/redis.conf | 2 ++ docker/redis5_replica/redis.conf | 3 +++ docker/redis5_sentinel/sentinel_1.conf | 6 ++++++ docker/redis5_sentinel/sentinel_2.conf | 6 ++++++ docker/redis5_sentinel/sentinel_3.conf | 6 ++++++ 18 files changed, 129 insertions(+) create mode 100644 docker/base/Dockerfile.cluster4 create mode 100644 docker/base/Dockerfile.cluster5 create mode 100644 docker/base/Dockerfile.sentinel4 create mode 100644 docker/base/Dockerfile.sentinel5 create mode 100644 docker/base/Dockerfile.v4.0 create mode 100644 docker/base/Dockerfile.v5.0 mode change 100644 => 100755 docker/base/create_cluster.sh create mode 100755 docker/base/create_cluster4.sh create mode 100755 docker/base/create_cluster5.sh create mode 100644 docker/redis4/redis.conf create mode 100644 docker/redis4_sentinel/sentinel_1.conf create mode 100644 docker/redis4_sentinel/sentinel_2.conf create mode 100644 docker/redis4_sentinel/sentinel_3.conf create mode 100644 docker/redis5/redis.conf create mode 100644 docker/redis5_replica/redis.conf create mode 100644 docker/redis5_sentinel/sentinel_1.conf create mode 100644 docker/redis5_sentinel/sentinel_2.conf create mode 100644 docker/redis5_sentinel/sentinel_3.conf diff --git a/docker/base/Dockerfile.cluster4 b/docker/base/Dockerfile.cluster4 new file mode 100644 index 0000000000..3158d6edd4 --- /dev/null +++ b/docker/base/Dockerfile.cluster4 @@ -0,0 +1,9 @@ +# produces redisfab/redis-py-cluster:4.0 +FROM redis:4.0-buster + +COPY create_cluster4.sh /create_cluster4.sh +RUN chmod +x /create_cluster4.sh + +EXPOSE 16391 16392 16393 16394 16395 16396 + +CMD [ "/create_cluster4.sh"] \ No newline at end of file diff --git a/docker/base/Dockerfile.cluster5 b/docker/base/Dockerfile.cluster5 new file mode 100644 index 0000000000..3becfc853a --- /dev/null +++ b/docker/base/Dockerfile.cluster5 @@ -0,0 +1,9 @@ +# produces redisfab/redis-py-cluster:5.0 +FROM redis:5.0-buster + +COPY create_cluster5.sh /create_cluster5.sh +RUN chmod +x /create_cluster5.sh + +EXPOSE 16385 16386 16387 16388 16389 16390 + +CMD [ "/create_cluster5.sh"] \ No newline at end of file diff --git a/docker/base/Dockerfile.sentinel4 b/docker/base/Dockerfile.sentinel4 new file mode 100644 index 0000000000..45bb03e88e --- /dev/null +++ b/docker/base/Dockerfile.sentinel4 @@ -0,0 +1,4 @@ +# produces redisfab/redis-py-sentinel:4.0 +FROM redis:4.0-buster + +CMD ["redis-sentinel", "/sentinel.conf"] \ No newline at end of file diff --git a/docker/base/Dockerfile.sentinel5 b/docker/base/Dockerfile.sentinel5 new file mode 100644 index 0000000000..6958154e46 --- /dev/null +++ b/docker/base/Dockerfile.sentinel5 @@ -0,0 +1,4 @@ +# produces redisfab/redis-py-sentinel:5.0 +FROM redis:5.0-buster + +CMD ["redis-sentinel", "/sentinel.conf"] \ No newline at end of file diff --git a/docker/base/Dockerfile.v4.0 b/docker/base/Dockerfile.v4.0 new file mode 100644 index 0000000000..7528ac1631 --- /dev/null +++ b/docker/base/Dockerfile.v4.0 @@ -0,0 +1,4 @@ +# produces redisfab/redis-py:4.0 +FROM redis:4.0-buster + +CMD ["redis-server", "/redis.conf"] \ No newline at end of file diff --git a/docker/base/Dockerfile.v5.0 b/docker/base/Dockerfile.v5.0 new file mode 100644 index 0000000000..6bcbe20bfc --- /dev/null +++ b/docker/base/Dockerfile.v5.0 @@ -0,0 +1,4 @@ +# produces redisfab/redis-py:5.0 +FROM redis:5.0-buster + +CMD ["redis-server", "/redis.conf"] \ No newline at end of file diff --git a/docker/base/create_cluster.sh b/docker/base/create_cluster.sh old mode 100644 new mode 100755 diff --git a/docker/base/create_cluster4.sh b/docker/base/create_cluster4.sh new file mode 100755 index 0000000000..a39da58784 --- /dev/null +++ b/docker/base/create_cluster4.sh @@ -0,0 +1,26 @@ +#! /bin/bash +mkdir -p /nodes +touch /nodes/nodemap +for PORT in $(seq 16391 16396); do + mkdir -p /nodes/$PORT + if [[ -e /redis.conf ]]; then + cp /redis.conf /nodes/$PORT/redis.conf + else + touch /nodes/$PORT/redis.conf + fi + cat << EOF >> /nodes/$PORT/redis.conf +port ${PORT} +cluster-enabled yes +daemonize yes +logfile /redis.log +dir /nodes/$PORT +EOF + redis-server /nodes/$PORT/redis.conf + if [ $? -ne 0 ]; then + echo "Redis failed to start, exiting." + exit 3 + fi + echo 127.0.0.1:$PORT >> /nodes/nodemap +done +echo yes | redis-cli --cluster create $(seq -f 127.0.0.1:%g 16391 16396) --cluster-replicas 1 +tail -f /redis.log \ No newline at end of file diff --git a/docker/base/create_cluster5.sh b/docker/base/create_cluster5.sh new file mode 100755 index 0000000000..0c63d8e910 --- /dev/null +++ b/docker/base/create_cluster5.sh @@ -0,0 +1,26 @@ +#! /bin/bash +mkdir -p /nodes +touch /nodes/nodemap +for PORT in $(seq 16385 16390); do + mkdir -p /nodes/$PORT + if [[ -e /redis.conf ]]; then + cp /redis.conf /nodes/$PORT/redis.conf + else + touch /nodes/$PORT/redis.conf + fi + cat << EOF >> /nodes/$PORT/redis.conf +port ${PORT} +cluster-enabled yes +daemonize yes +logfile /redis.log +dir /nodes/$PORT +EOF + redis-server /nodes/$PORT/redis.conf + if [ $? -ne 0 ]; then + echo "Redis failed to start, exiting." + exit 3 + fi + echo 127.0.0.1:$PORT >> /nodes/nodemap +done +echo yes | redis-cli --cluster create $(seq -f 127.0.0.1:%g 16385 16390) --cluster-replicas 1 +tail -f /redis.log \ No newline at end of file diff --git a/docker/redis4/redis.conf b/docker/redis4/redis.conf new file mode 100644 index 0000000000..eb304b1685 --- /dev/null +++ b/docker/redis4/redis.conf @@ -0,0 +1,2 @@ +port 6376 +save "" diff --git a/docker/redis4_sentinel/sentinel_1.conf b/docker/redis4_sentinel/sentinel_1.conf new file mode 100644 index 0000000000..d4dd9054a3 --- /dev/null +++ b/docker/redis4_sentinel/sentinel_1.conf @@ -0,0 +1,6 @@ +port 26385 + +sentinel myid 5700bea6dd90f330c4cc264cc19933404e40013a +sentinel deny-scripts-reconfig yes +sentinel monitor redis-py-test 127.0.0.1 6376 2 +sentinel down-after-milliseconds redis-py-test 5000 diff --git a/docker/redis4_sentinel/sentinel_2.conf b/docker/redis4_sentinel/sentinel_2.conf new file mode 100644 index 0000000000..e19b847abe --- /dev/null +++ b/docker/redis4_sentinel/sentinel_2.conf @@ -0,0 +1,6 @@ +port 26386 + +sentinel myid 5700bea6dd90f330c4cc264cc19933404e40013a +sentinel deny-scripts-reconfig yes +sentinel monitor redis-py-test 127.0.0.1 6376 2 +sentinel down-after-milliseconds redis-py-test 5000 \ No newline at end of file diff --git a/docker/redis4_sentinel/sentinel_3.conf b/docker/redis4_sentinel/sentinel_3.conf new file mode 100644 index 0000000000..6b174c25ac --- /dev/null +++ b/docker/redis4_sentinel/sentinel_3.conf @@ -0,0 +1,6 @@ +port 26387 + +sentinel myid 5700bea6dd90f330c4cc264cc19933404e40013a +sentinel deny-scripts-reconfig yes +sentinel monitor redis-py-test 127.0.0.1 6376 2 +sentinel down-after-milliseconds redis-py-test 5000 \ No newline at end of file diff --git a/docker/redis5/redis.conf b/docker/redis5/redis.conf new file mode 100644 index 0000000000..aa369e8a35 --- /dev/null +++ b/docker/redis5/redis.conf @@ -0,0 +1,2 @@ +port 6377 +save "" diff --git a/docker/redis5_replica/redis.conf b/docker/redis5_replica/redis.conf new file mode 100644 index 0000000000..d59148025c --- /dev/null +++ b/docker/redis5_replica/redis.conf @@ -0,0 +1,3 @@ +port 6375 +save "" +replicaof master 6377 diff --git a/docker/redis5_sentinel/sentinel_1.conf b/docker/redis5_sentinel/sentinel_1.conf new file mode 100644 index 0000000000..3a7102cafd --- /dev/null +++ b/docker/redis5_sentinel/sentinel_1.conf @@ -0,0 +1,6 @@ +port 26382 + +sentinel myid 5700bea6dd90f330c4cc264cc19933404e40013a +sentinel deny-scripts-reconfig yes +sentinel monitor redis-py-test 127.0.0.1 6377 2 +sentinel down-after-milliseconds redis-py-test 5000 diff --git a/docker/redis5_sentinel/sentinel_2.conf b/docker/redis5_sentinel/sentinel_2.conf new file mode 100644 index 0000000000..7656e9ecba --- /dev/null +++ b/docker/redis5_sentinel/sentinel_2.conf @@ -0,0 +1,6 @@ +port 26383 + +sentinel myid 5700bea6dd90f330c4cc264cc19933404e40013a +sentinel deny-scripts-reconfig yes +sentinel monitor redis-py-test 127.0.0.1 6377 2 +sentinel down-after-milliseconds redis-py-test 5000 \ No newline at end of file diff --git a/docker/redis5_sentinel/sentinel_3.conf b/docker/redis5_sentinel/sentinel_3.conf new file mode 100644 index 0000000000..96416ebdfa --- /dev/null +++ b/docker/redis5_sentinel/sentinel_3.conf @@ -0,0 +1,6 @@ +port 26384 + +sentinel myid 5700bea6dd90f330c4cc264cc19933404e40013a +sentinel deny-scripts-reconfig yes +sentinel monitor redis-py-test 127.0.0.1 6377 2 +sentinel down-after-milliseconds redis-py-test 5000 \ No newline at end of file From 258cbf4081274b9df078485b15365dafa58aebbf Mon Sep 17 00:00:00 2001 From: dvora-h Date: Thu, 13 Jan 2022 09:57:32 +0200 Subject: [PATCH 02/25] redis versions testenv --- docker/redis4/{ => master}/redis.conf | 0 .../sentinel}/sentinel_1.conf | 4 +- docker/redis4/sentinel/sentinel_2.conf | 6 + docker/redis4/sentinel/sentinel_3.conf | 6 + docker/redis4_sentinel/sentinel_2.conf | 6 - docker/redis4_sentinel/sentinel_3.conf | 6 - docker/redis5/{ => master}/redis.conf | 0 .../replica}/redis.conf | 0 .../sentinel}/sentinel_1.conf | 4 +- docker/redis5/sentinel/sentinel_2.conf | 6 + docker/redis5/sentinel/sentinel_3.conf | 6 + docker/redis5_sentinel/sentinel_2.conf | 6 - docker/redis5_sentinel/sentinel_3.conf | 6 - docker/{ => redis6-2}/master/redis.conf | 0 docker/{ => redis6-2}/replica/redis.conf | 0 .../sentinel/sentinel_1.conf} | 0 .../sentinel/sentinel_2.conf} | 0 .../sentinel/sentinel_3.conf} | 0 docker/{ => redis6-2}/stunnel/conf/redis.conf | 0 docker/{ => redis6-2}/stunnel/create_certs.sh | 0 docker/redis6-2/stunnel/keys/ca-cert.pem | 21 +++ docker/redis6-2/stunnel/keys/ca-key.pem | 27 +++ docker/redis6-2/stunnel/keys/client-cert.pem | 21 +++ docker/redis6-2/stunnel/keys/client-key.pem | 28 +++ docker/redis6-2/stunnel/keys/client-req.pem | 17 ++ docker/redis6-2/stunnel/keys/server-cert.pem | 21 +++ docker/redis6-2/stunnel/keys/server-key.pem | 28 +++ docker/redis6-2/stunnel/keys/server-req.pem | 17 ++ tox.ini | 176 +++++++++++++++++- 29 files changed, 377 insertions(+), 35 deletions(-) rename docker/redis4/{ => master}/redis.conf (100%) rename docker/{redis4_sentinel => redis4/sentinel}/sentinel_1.conf (55%) create mode 100644 docker/redis4/sentinel/sentinel_2.conf create mode 100644 docker/redis4/sentinel/sentinel_3.conf delete mode 100644 docker/redis4_sentinel/sentinel_2.conf delete mode 100644 docker/redis4_sentinel/sentinel_3.conf rename docker/redis5/{ => master}/redis.conf (100%) rename docker/{redis5_replica => redis5/replica}/redis.conf (100%) rename docker/{redis5_sentinel => redis5/sentinel}/sentinel_1.conf (55%) create mode 100644 docker/redis5/sentinel/sentinel_2.conf create mode 100644 docker/redis5/sentinel/sentinel_3.conf delete mode 100644 docker/redis5_sentinel/sentinel_2.conf delete mode 100644 docker/redis5_sentinel/sentinel_3.conf rename docker/{ => redis6-2}/master/redis.conf (100%) rename docker/{ => redis6-2}/replica/redis.conf (100%) rename docker/{sentinel_1/sentinel.conf => redis6-2/sentinel/sentinel_1.conf} (100%) rename docker/{sentinel_2/sentinel.conf => redis6-2/sentinel/sentinel_2.conf} (100%) rename docker/{sentinel_3/sentinel.conf => redis6-2/sentinel/sentinel_3.conf} (100%) rename docker/{ => redis6-2}/stunnel/conf/redis.conf (100%) rename docker/{ => redis6-2}/stunnel/create_certs.sh (100%) create mode 100644 docker/redis6-2/stunnel/keys/ca-cert.pem create mode 100644 docker/redis6-2/stunnel/keys/ca-key.pem create mode 100644 docker/redis6-2/stunnel/keys/client-cert.pem create mode 100644 docker/redis6-2/stunnel/keys/client-key.pem create mode 100644 docker/redis6-2/stunnel/keys/client-req.pem create mode 100644 docker/redis6-2/stunnel/keys/server-cert.pem create mode 100644 docker/redis6-2/stunnel/keys/server-key.pem create mode 100644 docker/redis6-2/stunnel/keys/server-req.pem diff --git a/docker/redis4/redis.conf b/docker/redis4/master/redis.conf similarity index 100% rename from docker/redis4/redis.conf rename to docker/redis4/master/redis.conf diff --git a/docker/redis4_sentinel/sentinel_1.conf b/docker/redis4/sentinel/sentinel_1.conf similarity index 55% rename from docker/redis4_sentinel/sentinel_1.conf rename to docker/redis4/sentinel/sentinel_1.conf index d4dd9054a3..c0adf379b2 100644 --- a/docker/redis4_sentinel/sentinel_1.conf +++ b/docker/redis4/sentinel/sentinel_1.conf @@ -1,6 +1,6 @@ port 26385 -sentinel myid 5700bea6dd90f330c4cc264cc19933404e40013a -sentinel deny-scripts-reconfig yes sentinel monitor redis-py-test 127.0.0.1 6376 2 sentinel down-after-milliseconds redis-py-test 5000 +sentinel failover-timeout redis-py-test 60000 +sentinel parallel-syncs redis-py-test 1 diff --git a/docker/redis4/sentinel/sentinel_2.conf b/docker/redis4/sentinel/sentinel_2.conf new file mode 100644 index 0000000000..6652630236 --- /dev/null +++ b/docker/redis4/sentinel/sentinel_2.conf @@ -0,0 +1,6 @@ +port 26386 + +sentinel monitor redis-py-test 127.0.0.1 6376 2 +sentinel down-after-milliseconds redis-py-test 5000 +sentinel failover-timeout redis-py-test 60000 +sentinel parallel-syncs redis-py-test 1 \ No newline at end of file diff --git a/docker/redis4/sentinel/sentinel_3.conf b/docker/redis4/sentinel/sentinel_3.conf new file mode 100644 index 0000000000..f835f6a773 --- /dev/null +++ b/docker/redis4/sentinel/sentinel_3.conf @@ -0,0 +1,6 @@ +port 26387 + +sentinel monitor redis-py-test 127.0.0.1 6376 2 +sentinel down-after-milliseconds redis-py-test 5000 +sentinel failover-timeout redis-py-test 60000 +sentinel parallel-syncs redis-py-test 1 \ No newline at end of file diff --git a/docker/redis4_sentinel/sentinel_2.conf b/docker/redis4_sentinel/sentinel_2.conf deleted file mode 100644 index e19b847abe..0000000000 --- a/docker/redis4_sentinel/sentinel_2.conf +++ /dev/null @@ -1,6 +0,0 @@ -port 26386 - -sentinel myid 5700bea6dd90f330c4cc264cc19933404e40013a -sentinel deny-scripts-reconfig yes -sentinel monitor redis-py-test 127.0.0.1 6376 2 -sentinel down-after-milliseconds redis-py-test 5000 \ No newline at end of file diff --git a/docker/redis4_sentinel/sentinel_3.conf b/docker/redis4_sentinel/sentinel_3.conf deleted file mode 100644 index 6b174c25ac..0000000000 --- a/docker/redis4_sentinel/sentinel_3.conf +++ /dev/null @@ -1,6 +0,0 @@ -port 26387 - -sentinel myid 5700bea6dd90f330c4cc264cc19933404e40013a -sentinel deny-scripts-reconfig yes -sentinel monitor redis-py-test 127.0.0.1 6376 2 -sentinel down-after-milliseconds redis-py-test 5000 \ No newline at end of file diff --git a/docker/redis5/redis.conf b/docker/redis5/master/redis.conf similarity index 100% rename from docker/redis5/redis.conf rename to docker/redis5/master/redis.conf diff --git a/docker/redis5_replica/redis.conf b/docker/redis5/replica/redis.conf similarity index 100% rename from docker/redis5_replica/redis.conf rename to docker/redis5/replica/redis.conf diff --git a/docker/redis5_sentinel/sentinel_1.conf b/docker/redis5/sentinel/sentinel_1.conf similarity index 55% rename from docker/redis5_sentinel/sentinel_1.conf rename to docker/redis5/sentinel/sentinel_1.conf index 3a7102cafd..93c3ac67f7 100644 --- a/docker/redis5_sentinel/sentinel_1.conf +++ b/docker/redis5/sentinel/sentinel_1.conf @@ -1,6 +1,6 @@ port 26382 -sentinel myid 5700bea6dd90f330c4cc264cc19933404e40013a -sentinel deny-scripts-reconfig yes sentinel monitor redis-py-test 127.0.0.1 6377 2 sentinel down-after-milliseconds redis-py-test 5000 +sentinel failover-timeout redis-py-test 60000 +sentinel parallel-syncs redis-py-test 1 diff --git a/docker/redis5/sentinel/sentinel_2.conf b/docker/redis5/sentinel/sentinel_2.conf new file mode 100644 index 0000000000..9439fc219c --- /dev/null +++ b/docker/redis5/sentinel/sentinel_2.conf @@ -0,0 +1,6 @@ +port 26383 + +sentinel monitor redis-py-test 127.0.0.1 6377 2 +sentinel down-after-milliseconds redis-py-test 5000 +sentinel failover-timeout redis-py-test 60000 +sentinel parallel-syncs redis-py-test 1 \ No newline at end of file diff --git a/docker/redis5/sentinel/sentinel_3.conf b/docker/redis5/sentinel/sentinel_3.conf new file mode 100644 index 0000000000..a468fd5efa --- /dev/null +++ b/docker/redis5/sentinel/sentinel_3.conf @@ -0,0 +1,6 @@ +port 26384 + +sentinel monitor redis-py-test 127.0.0.1 6377 2 +sentinel down-after-milliseconds redis-py-test 5000 +sentinel failover-timeout redis-py-test 60000 +sentinel parallel-syncs redis-py-test 1 \ No newline at end of file diff --git a/docker/redis5_sentinel/sentinel_2.conf b/docker/redis5_sentinel/sentinel_2.conf deleted file mode 100644 index 7656e9ecba..0000000000 --- a/docker/redis5_sentinel/sentinel_2.conf +++ /dev/null @@ -1,6 +0,0 @@ -port 26383 - -sentinel myid 5700bea6dd90f330c4cc264cc19933404e40013a -sentinel deny-scripts-reconfig yes -sentinel monitor redis-py-test 127.0.0.1 6377 2 -sentinel down-after-milliseconds redis-py-test 5000 \ No newline at end of file diff --git a/docker/redis5_sentinel/sentinel_3.conf b/docker/redis5_sentinel/sentinel_3.conf deleted file mode 100644 index 96416ebdfa..0000000000 --- a/docker/redis5_sentinel/sentinel_3.conf +++ /dev/null @@ -1,6 +0,0 @@ -port 26384 - -sentinel myid 5700bea6dd90f330c4cc264cc19933404e40013a -sentinel deny-scripts-reconfig yes -sentinel monitor redis-py-test 127.0.0.1 6377 2 -sentinel down-after-milliseconds redis-py-test 5000 \ No newline at end of file diff --git a/docker/master/redis.conf b/docker/redis6-2/master/redis.conf similarity index 100% rename from docker/master/redis.conf rename to docker/redis6-2/master/redis.conf diff --git a/docker/replica/redis.conf b/docker/redis6-2/replica/redis.conf similarity index 100% rename from docker/replica/redis.conf rename to docker/redis6-2/replica/redis.conf diff --git a/docker/sentinel_1/sentinel.conf b/docker/redis6-2/sentinel/sentinel_1.conf similarity index 100% rename from docker/sentinel_1/sentinel.conf rename to docker/redis6-2/sentinel/sentinel_1.conf diff --git a/docker/sentinel_2/sentinel.conf b/docker/redis6-2/sentinel/sentinel_2.conf similarity index 100% rename from docker/sentinel_2/sentinel.conf rename to docker/redis6-2/sentinel/sentinel_2.conf diff --git a/docker/sentinel_3/sentinel.conf b/docker/redis6-2/sentinel/sentinel_3.conf similarity index 100% rename from docker/sentinel_3/sentinel.conf rename to docker/redis6-2/sentinel/sentinel_3.conf diff --git a/docker/stunnel/conf/redis.conf b/docker/redis6-2/stunnel/conf/redis.conf similarity index 100% rename from docker/stunnel/conf/redis.conf rename to docker/redis6-2/stunnel/conf/redis.conf diff --git a/docker/stunnel/create_certs.sh b/docker/redis6-2/stunnel/create_certs.sh similarity index 100% rename from docker/stunnel/create_certs.sh rename to docker/redis6-2/stunnel/create_certs.sh diff --git a/docker/redis6-2/stunnel/keys/ca-cert.pem b/docker/redis6-2/stunnel/keys/ca-cert.pem new file mode 100644 index 0000000000..460354d9ad --- /dev/null +++ b/docker/redis6-2/stunnel/keys/ca-cert.pem @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDaDCCAlACCQCui7X/vxmwGjANBgkqhkiG9w0BAQsFADB1MQswCQYDVQQGEwJD +QTERMA8GA1UECAwIV2lubmlwZWcxETAPBgNVBAcMCE1hbml0b2JhMRIwEAYDVQQK +DAlTb21lIENvcnAxFjAUBgNVBAsMDUlUIERlcGFydG1lbnQxFDASBgNVBAMMC2V4 +YW1wbGUuY29tMCAXDTIyMDExMjE0NTQyMVoYDzMwMjEwNTE1MTQ1NDIxWjB1MQsw +CQYDVQQGEwJDQTERMA8GA1UECAwIV2lubmlwZWcxETAPBgNVBAcMCE1hbml0b2Jh +MRIwEAYDVQQKDAlTb21lIENvcnAxFjAUBgNVBAsMDUlUIERlcGFydG1lbnQxFDAS +BgNVBAMMC2V4YW1wbGUuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC +AQEAtSqof5fXyN/Y6GSLBBNA/zhrqw2qcBW4va6+Wc24WTaBXcP0w13njz+j1b5V +9rbpz0i7WUkg3bBPecFFuCFyQnvn2JaE9b7kX1lLmszanrYfWQ9bYQyecox3HuYq +eu330S+bD0liYh5rV7oEanuSCJW+a/dgEl3l/+Qb0zo2ZNEAXRuBv6lNmvBSsdIt +lc5n/P06ntJ6Ia/7rO0ZEiBb6hLFKfiIo/XvDrGNlYulJEcDmC3PkzzJRGnA7R2F +7Vggj4l4pGE/3EtnA4C/rd0Shf9TIPQFA2HOx3oYsrOonuBYM2urciNeojP5XGY/ +Zdau7hzgFBgF8tWsLU6bKyZ3NwIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQBJwnf3 +FARRxQF1Q2jIXQdyUS/lqq74C+PZF5IKOKb2K3dT1BFJlBgduvj4Ih5KUakImhMB +SdaiwKzgB9APXNVAgrzSCb49PzXzvmaIFhPmBXSITFFfGupxpo0ZStwI03B0KZBs +l3Zd0SzjKqZNVtTnxyDyWnYNFJtuCGanTjyPcCAFvVwzDQyzZ14liyM389WM950a +ANM7H0iv6U/h7lWhnvBOlRfj89JChBvEROlWuYfyyELZpAXsmuwWdh0pwgGpqMI/ +EtLas2sbX5apE8P1S2Uxc+dS4IjoA/TrnP21rXwJ8AWzrntsZalSx9uueb1qhPp8 +EL7asG4+G3BpQrL1 +-----END CERTIFICATE----- diff --git a/docker/redis6-2/stunnel/keys/ca-key.pem b/docker/redis6-2/stunnel/keys/ca-key.pem new file mode 100644 index 0000000000..64db528c48 --- /dev/null +++ b/docker/redis6-2/stunnel/keys/ca-key.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEogIBAAKCAQEAtSqof5fXyN/Y6GSLBBNA/zhrqw2qcBW4va6+Wc24WTaBXcP0 +w13njz+j1b5V9rbpz0i7WUkg3bBPecFFuCFyQnvn2JaE9b7kX1lLmszanrYfWQ9b +YQyecox3HuYqeu330S+bD0liYh5rV7oEanuSCJW+a/dgEl3l/+Qb0zo2ZNEAXRuB +v6lNmvBSsdItlc5n/P06ntJ6Ia/7rO0ZEiBb6hLFKfiIo/XvDrGNlYulJEcDmC3P +kzzJRGnA7R2F7Vggj4l4pGE/3EtnA4C/rd0Shf9TIPQFA2HOx3oYsrOonuBYM2ur +ciNeojP5XGY/Zdau7hzgFBgF8tWsLU6bKyZ3NwIDAQABAoIBACq8mWsgAsNcKusH +bNPVRuvt/1gmrSIrvZzhb/33TZmeBf58j2zW5h0gwiFV+SluFNHVMnzph1tEkDsE +oNHC8hVE7XhmaY8fLPhhNDicQqZWCCcWPFQ0idwzzpX3beX55Q/vzwBYK2FCE8hq +FUiZReXIjVci0AMFK5Cl2vqFLPezAGvaZ4/M1reOF3vCgWl8IXTwYOs4EYd1CJt7 +bMwO9Q6P8V0BVhJO2tdwIe5XL5X086sMMPYXqMuwX9m3vZFQFpsZobmoAyYLVY+h +IMoQZdh4O4sFYPQBPzhZXluFDl8rX6G5A9jUPxDfeVz+799RXi31jTYeH01OwM89 +/0BNryECgYEA15hU0qDAnM7fBiTTGbRUT/QPOmEUOPcnWfLWOyJsovAVLL1X0jmt +GFm+FkTtOlcTVgDHXeHNw81zrgDDuW7fwaKloPeyWhyO6rp2jntAz/OayfA5UYOf +REhXdQH7rMAkGgy1t7zKGHTYAslHjD2dOikCuHH/13otSJS4wNvTaZUCgYEA1x6L +abxYDpR7jn2Yym0CbIiZ6tqShtqLi4eNF7PDVe3rUM7gYU767UFSKPvRpsq+BFwf +LLRFgpggNRDrZWoK0ZekHD1x8pCJF+O4pj/Fhra4uI+hInycRQ4xsj9VU/WftxQ4 +aOojB28F0fBO56T90caQVSR09DGNmElSQFcw4psCgYApf8n8DTNmO6/UV+xGi16b +UUhJHXyuBm0NtF+mXFb6+impRf0Mm0uFX2jmknfzfeVb7aRyns9jvD1jJgSGwh/R +/wPQuz0aeVrNNf0yKels3eBStKnj1eknVKF5BVuzgfyxAvdLmcxw7rTRvHrINOf5 +1QEQDemISZ1D1lTF0sqcDQKBgCmE6rGAuZouzF4nHZtMSOB7yQFMKGXAvpgylGfT +uUrXfch99U6yuLmcFuh0GfXQQbaDtTyimpvnEqhLWLOdMPNdCj6tGVYQ0XT77cKg +olYq5CIzDo2icWLep3bYxHZM/QOP8odFUXd41S287O3GqXqYkXjtbWlIOyT+WdKz +QWsrAoGALnac4Vh2s12Cv3YiQbkPtBRe8oxI0h6DEIdBciPDGq6WXq6O2PXXuBhM +X47mObUsSuzI6hI4/vd4/tXD7TM3fS1YDdZXj7d51ZjT/jmlTVxAHa3DJ8i7o+rH +Fqv/lh6MB6FGkXZ9vAGQe5RwUbDD16QO/1mz7fg0YBA9A8plM8s= +-----END RSA PRIVATE KEY----- diff --git a/docker/redis6-2/stunnel/keys/client-cert.pem b/docker/redis6-2/stunnel/keys/client-cert.pem new file mode 100644 index 0000000000..5c48eb8b3d --- /dev/null +++ b/docker/redis6-2/stunnel/keys/client-cert.pem @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDYDCCAkgCAQEwDQYJKoZIhvcNAQEFBQAwdTELMAkGA1UEBhMCQ0ExETAPBgNV +BAgMCFdpbm5pcGVnMREwDwYDVQQHDAhNYW5pdG9iYTESMBAGA1UECgwJU29tZSBD +b3JwMRYwFAYDVQQLDA1JVCBEZXBhcnRtZW50MRQwEgYDVQQDDAtleGFtcGxlLmNv +bTAgFw0yMjAxMTIxNDU0MjFaGA8zMDIxMDUxNTE0NTQyMVowdTELMAkGA1UEBhMC +Q0ExETAPBgNVBAgMCFdpbm5pcGVnMREwDwYDVQQHDAhNYW5pdG9iYTESMBAGA1UE +CgwJU29tZSBDb3JwMRYwFAYDVQQLDA1JVCBEZXBhcnRtZW50MRQwEgYDVQQDDAtl +eGFtcGxlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALwWezv2 +WHf6fCyiLYHmi3+Qf/33VmdNAapWzpOZ0Xmuzf8SSoEep/YotvnmIBe8DqspjzBW +eeg+n7qre+qawGv1AOANlStLKeNvnXhWS0bdoAKMP68Q8jvU+YSmJNZTRkg/39MA +YNqxYABYamoIQ7qX+g91HsCxPSzqIyjLwY4hPHGYfxGhRH5ne2RtsYEcMjOJWs8s +U4x6wpwn9Y4vnG1AqpcwY4xm65g/52BWWM9WfZ++y17MynSdoE29EqXCAGqhh1i1 +IRlKN1vr/792VYzOm2fHScaaCaCmhDIlTw0TlOgnfi7CFtY0z6uizSwG4RWCW+3/ +g47T3q8aCnvlkCkCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAGuNzbKtvKsdfQaAV +SmeNAZqyoG2Fbmh/txj6j+UThu3tadk07/SukgsM6yepeq05+wguW43eBtig/LzH +pSHCn4s/w0fvu1GqePWsTdGI3xnJakZIlkOXPStIgZJNewT9rD6WoRfthvTOda8v +NBjW0InACnVvzAivX9xhbUB4K/I8aEGaAZwzIGnQbsxygPVZKe/Y8oWhiks0qYo2 +Wev1Swli4EeqbYvg+3TMy7T1pDkjAmAdsv7yJAYKsM3xCu7K8vA/e+2J2hjUQIfI +Thdjb6FNywihVaAK2BUqL6cMgF8I+nX7ywVOBAz+a3F00sSogapztinzqsjFDeT9 +5V/MSg== +-----END CERTIFICATE----- diff --git a/docker/redis6-2/stunnel/keys/client-key.pem b/docker/redis6-2/stunnel/keys/client-key.pem new file mode 100644 index 0000000000..4117706d0e --- /dev/null +++ b/docker/redis6-2/stunnel/keys/client-key.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC8Fns79lh3+nws +oi2B5ot/kH/991ZnTQGqVs6TmdF5rs3/EkqBHqf2KLb55iAXvA6rKY8wVnnoPp+6 +q3vqmsBr9QDgDZUrSynjb514VktG3aACjD+vEPI71PmEpiTWU0ZIP9/TAGDasWAA +WGpqCEO6l/oPdR7AsT0s6iMoy8GOITxxmH8RoUR+Z3tkbbGBHDIziVrPLFOMesKc +J/WOL5xtQKqXMGOMZuuYP+dgVljPVn2fvstezMp0naBNvRKlwgBqoYdYtSEZSjdb +6/+/dlWMzptnx0nGmgmgpoQyJU8NE5ToJ34uwhbWNM+ros0sBuEVglvt/4OO096v +Ggp75ZApAgMBAAECggEBAJDXLydJ2W7rMdydNzYld59Qg3/rjFoYbwPhvUrk1O9D +sdaPG1i7ZtSlHeLrWCNu6kzcwCuVLGOwdgimLdLIQQ3hqj7fttOUGjnOphEZQvbb +jHDp19DU1/VDWLLRzuRNVH4m0hIG5I8EsM0TST9GBgIXLrXgl0IEOvvvggvUfMUZ +eGrrVsW56XIc25LZCalf20lcoyKa2hVjtlF2ds41PY6WqytkRJ7zpnBzO4g+Kz3D +iA2rzNn/Ds2CCvuNDA8UF6qG/INbcySaq+qbSYLohWSsz9smIhkWUyF4YfbtziZr +8AbxZKbS8VopSFxF+o35CbEZeTPkFkrBfbD0xUlCeEECgYEA6h1hLodTeQUpQoc3 +6brWvw1gM/tM0RyKbpOEwJGK1MnX99IM5z6qGY+d1htl7cB3RARpaY1HAvRXHhXt +9qaSdhqR1hagZLn2vbelFkbJ0N1agdR6XYgGoxfH2RCluNfZZPOB6urfCLNbMjgb +B1rkvIWiELCzujwsZ6m5sOomP70CgYEAzauggpcqEXQ4P4+y6B/8gOt7chuRczft +1YTj2Y5tfZSTZmh01BUgenDgA1+NFJ9ni33P6+Ij/1D0ZGdea5Lqw2VP1ZDEIYSm +j3ekkge/0AljZgIil2UviBhx5W2BlwnlukIwMvzVRwDulQsV3sDxprZKHYTaRcnC +EB4Y9T6uUt0CgYBjeCojP8IaiDPYnWUHPKgjMoaub1Za/ppekvTzcKMg98V3+Noc +okZZZ+iy4J81HfJOhuVWwHzsZ25gTQb3JhzSa0WNRb3OLikEwHM2/MqgoHvk76cx ++CqBvwfdVTJkT+mA9+k6K6KpqrLTqnzpahgHdWu/VaR3OzvOq5FG9qVbrQKBgF5F +xRUW5RmLBB1eaMstnjgZuEPdjxYZFNNCTo5yUo21hLr0NljgNjrpckUZjzlct8Gg +saWVyppFKUC8gPMeLK3TynxCFySmARLR7IVjN/DL3NvtLp3mq5reWZaoUzZAOyTd +Ieq9KaWaL8HxitzH4/xeoipVsxc6G9H3eckwKgehAoGBAM/E0qLpEXOaLxODY8tt ++qpoNWHZn1M6cVX+tA/6igKfqUY96lefLmEiV1N01qW7+keFMXT12X/edsykG8jd +gcNkNjSNwDSi8ixl0YlQwRJjX93TEip78sisQ3mCUqZUCNbm0Dm66Bqe8rAD5AdF +G4oVbUu1gN0StX85Uw8J0AYS +-----END PRIVATE KEY----- diff --git a/docker/redis6-2/stunnel/keys/client-req.pem b/docker/redis6-2/stunnel/keys/client-req.pem new file mode 100644 index 0000000000..ecf83f4daa --- /dev/null +++ b/docker/redis6-2/stunnel/keys/client-req.pem @@ -0,0 +1,17 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIICujCCAaICAQAwdTELMAkGA1UEBhMCQ0ExETAPBgNVBAgMCFdpbm5pcGVnMREw +DwYDVQQHDAhNYW5pdG9iYTESMBAGA1UECgwJU29tZSBDb3JwMRYwFAYDVQQLDA1J +VCBEZXBhcnRtZW50MRQwEgYDVQQDDAtleGFtcGxlLmNvbTCCASIwDQYJKoZIhvcN +AQEBBQADggEPADCCAQoCggEBALwWezv2WHf6fCyiLYHmi3+Qf/33VmdNAapWzpOZ +0Xmuzf8SSoEep/YotvnmIBe8DqspjzBWeeg+n7qre+qawGv1AOANlStLKeNvnXhW +S0bdoAKMP68Q8jvU+YSmJNZTRkg/39MAYNqxYABYamoIQ7qX+g91HsCxPSzqIyjL +wY4hPHGYfxGhRH5ne2RtsYEcMjOJWs8sU4x6wpwn9Y4vnG1AqpcwY4xm65g/52BW +WM9WfZ++y17MynSdoE29EqXCAGqhh1i1IRlKN1vr/792VYzOm2fHScaaCaCmhDIl +Tw0TlOgnfi7CFtY0z6uizSwG4RWCW+3/g47T3q8aCnvlkCkCAwEAAaAAMA0GCSqG +SIb3DQEBCwUAA4IBAQAqLgfkWWIE1RV1TENnr9jT+SK8u3F2nX4mUzNmy8azq52I +fO8qPKmvV2amt5y961jNpR+rRpARncONuf6NQR5qCMu/EKjVi9BhOkoIOK0RjgtK +AkCTON1J8022JDQpN5/H5ZpLDkIlBtpwDvEaR/PnTaJxtGwLY8HxY6h20PDjP3J9 +Xu3w3m/s3uVjFG07RDvbwK02vYskePnlsKVw+uu5C2blOQRlRVvdCCkwN0y6IiWW +uRGRSzwufgejrfDUJG4VZuNpvWjFfzjHW105g1AxaTW3anRqBSNxYF+iawfbGdf4 +bGT4Wazbwq5uU3uixxOzxPMI5ZP/gn0ywz9S1RRK +-----END CERTIFICATE REQUEST----- diff --git a/docker/redis6-2/stunnel/keys/server-cert.pem b/docker/redis6-2/stunnel/keys/server-cert.pem new file mode 100644 index 0000000000..3a1bf72011 --- /dev/null +++ b/docker/redis6-2/stunnel/keys/server-cert.pem @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDYDCCAkgCAQEwDQYJKoZIhvcNAQEFBQAwdTELMAkGA1UEBhMCQ0ExETAPBgNV +BAgMCFdpbm5pcGVnMREwDwYDVQQHDAhNYW5pdG9iYTESMBAGA1UECgwJU29tZSBD +b3JwMRYwFAYDVQQLDA1JVCBEZXBhcnRtZW50MRQwEgYDVQQDDAtleGFtcGxlLmNv +bTAgFw0yMjAxMTIxNDU0MjFaGA8zMDIxMDUxNTE0NTQyMVowdTELMAkGA1UEBhMC +Q0ExETAPBgNVBAgMCFdpbm5pcGVnMREwDwYDVQQHDAhNYW5pdG9iYTESMBAGA1UE +CgwJU29tZSBDb3JwMRYwFAYDVQQLDA1JVCBEZXBhcnRtZW50MRQwEgYDVQQDDAtl +eGFtcGxlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMxZETTb +dxqFsNjUIJbpS6ZT9RkH/dWYTVk1uRUMh6Cr6920g/7pSaRLIx8guTDHa1jhPIlX +lax7oZyX9coLjhSc6cy0ZmoH0zrp8ZbRc/qOawuO62arKP89pO/18MB3r9zPb1PJ +evTP203+2a8ly25cscMTUge+rHMFAUW+/01hc90CY9ial9oCl9wtoPdPGA8XlX3u +RswOAM79fM+Szvv+bX0VvFakkfHIE8oIK5/rJYDswBKAshw5CjW/OEjD6FbCb84c +1E7jJhwwd6X70yDMOrJ8iVkA/lpzfoosiuYm/okgbPPXWEo8aa//MrSH90l2+M9q +Vvn8hbmwlJl+2IMCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAEcTps0CUnBZJBH/w +8oJo8kAvsHhFTLJpTtiztut5qI+FMgC6sPcVUKi95gie2pdJ91y6sFzqLpghAciR +ocYBy/jxK0M7OGJHLpUPeCS1yxeEyeZXpMPS90bUo1tPh7QDAojoRrFYo6M6DbL3 +dcErTJlvKnBBT9/DmENx75R+1nSB86vq0je+X0IqbZXeJyWju6ybjbwo1NPpnu+f +jnXTG0+ZIsepms0VTXwcTy3dthIE+uw4XqTQ1qYg2stQAOUJ0nmb68NExi5zom5G +0nh7tZnL0N+Z+XeNo7gaVatxfmgyk/HO2Vl4Wk4NA0PkR0yk2vNUwS0rKAb2mYc6 +T2gHdQ== +-----END CERTIFICATE----- diff --git a/docker/redis6-2/stunnel/keys/server-key.pem b/docker/redis6-2/stunnel/keys/server-key.pem new file mode 100644 index 0000000000..62595e017c --- /dev/null +++ b/docker/redis6-2/stunnel/keys/server-key.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDMWRE023cahbDY +1CCW6UumU/UZB/3VmE1ZNbkVDIegq+vdtIP+6UmkSyMfILkwx2tY4TyJV5Wse6Gc +l/XKC44UnOnMtGZqB9M66fGW0XP6jmsLjutmqyj/PaTv9fDAd6/cz29TyXr0z9tN +/tmvJctuXLHDE1IHvqxzBQFFvv9NYXPdAmPYmpfaApfcLaD3TxgPF5V97kbMDgDO +/XzPks77/m19FbxWpJHxyBPKCCuf6yWA7MASgLIcOQo1vzhIw+hWwm/OHNRO4yYc +MHel+9MgzDqyfIlZAP5ac36KLIrmJv6JIGzz11hKPGmv/zK0h/dJdvjPalb5/IW5 +sJSZftiDAgMBAAECggEAct5+daAIy7frOXfE+hAanl0DohaD8dWzZTp12Ac7Fm6O +IAqhSGILK3exPoY+k9UF2uiCBxJc6KB2sHgbioAEVkH+izu9dkz/yFZJn+YNtALq +2Yx1dzkvyor0dI9jzk15Zj6U7hyMKaHOPYHNDE/Kkzc4Fdh+fCwK9H0TwgkjqnLj +hfRK32+SqaftkhZnCxaFfdVVzhonWsaB7VcyUPdIHAMG0xUQ9oNTM0WLPotU/uh0 +XDCemwXhkqfKaAlnj0YBsu65WOTTiPixOPigDe745CHFBXwvCF28kxjSbCAVlHIv +JcTtq1EA+fNHRTeHgNGSpqOdfuVrBMyp3KiztLBfQQKBgQD47MFmQphXVQWRmKoU +gCFf28notV8J0VGyG7E0tFMS3GgyAAl8H8I6fB9UYOmD95PrHTROxKpc7jYtZRW3 +KcYJP5zKa+DqSSks8I5dLwFkKYVC0GiEJWuRwS9aHaD7ja65NtXJO+2iZ598s39w +iSx0OAvaf9cFUrsAmHAE84c+/QKBgQDSJ/VE1CS0Tv2kL5Wbr/RmgYBZbXHnRz6j +LFA7JwX3seHtuo+WBe8BMOMS4YqW6K2YTqwU8NtN1oATWg72TcLhwJZ3sKGPiMhM +/cHW0dJqYsXujIOd/dlSr+j9Mouoxm6Spl+hGpj2IPUV9Dlm8N4SqPk83m0O+8Hy +P088HK7NfwKBgQC3D0XbMjZeY0RJIoBRuzjQCg6eeGOAENOHrB3RqJs/T5/AxY40 +Hhb0c7uGjg6s4jGBwmRpWPAAj56AG8qwfKQKwSFJK7SoF02UowPPO3ZGdtJtpF54 +cBx/gBaWqxtsY3GO++iUqOHFgXckeczKsdZjUaRF96XlYEXt1izrNzzK8QKBgQCP +OsCE6nkhknx3/B5g/2j4u+Y4DMmGsR3VpAwCZLRCfq/WkEHwI5cjHqiEY8dK1sYJ +egT6OLWetUSQ694qrBDYP6PNa0qRQs4Q+xmzSUm5TBxOWuIROcN2AYIvntVkb+lI +da/TYwdBKHEhR1Qf/qW73gIQJB/8CEXEzrU36OySDQKBgQD35khRdiU+1bPt/DpW ++8A+88BuxXMFxKYtEoMuTJnb7enarwp7+FtY6WhNgOgxELTpRbYw9496mOmNbJKL +PmTXzs3aS5bv/2JTtc5+CHzf9PJ+jAYWnh9hCq9x/mA0QRMQAZEi8vhhYFaWiiV3 +wUYnDFnnAKia1VILt9jZ7I4T7Q== +-----END PRIVATE KEY----- diff --git a/docker/redis6-2/stunnel/keys/server-req.pem b/docker/redis6-2/stunnel/keys/server-req.pem new file mode 100644 index 0000000000..361891d1c8 --- /dev/null +++ b/docker/redis6-2/stunnel/keys/server-req.pem @@ -0,0 +1,17 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIICujCCAaICAQAwdTELMAkGA1UEBhMCQ0ExETAPBgNVBAgMCFdpbm5pcGVnMREw +DwYDVQQHDAhNYW5pdG9iYTESMBAGA1UECgwJU29tZSBDb3JwMRYwFAYDVQQLDA1J +VCBEZXBhcnRtZW50MRQwEgYDVQQDDAtleGFtcGxlLmNvbTCCASIwDQYJKoZIhvcN +AQEBBQADggEPADCCAQoCggEBAMxZETTbdxqFsNjUIJbpS6ZT9RkH/dWYTVk1uRUM +h6Cr6920g/7pSaRLIx8guTDHa1jhPIlXlax7oZyX9coLjhSc6cy0ZmoH0zrp8ZbR +c/qOawuO62arKP89pO/18MB3r9zPb1PJevTP203+2a8ly25cscMTUge+rHMFAUW+ +/01hc90CY9ial9oCl9wtoPdPGA8XlX3uRswOAM79fM+Szvv+bX0VvFakkfHIE8oI +K5/rJYDswBKAshw5CjW/OEjD6FbCb84c1E7jJhwwd6X70yDMOrJ8iVkA/lpzfoos +iuYm/okgbPPXWEo8aa//MrSH90l2+M9qVvn8hbmwlJl+2IMCAwEAAaAAMA0GCSqG +SIb3DQEBCwUAA4IBAQCljqLOTU3tFEqxJ2AbZ5HVg9AN/SEUX8c/SyzCBii3r9Dj +ubp0YWvYvgm7lnXsFAVDznf89RAzwdFur5iAQ95VfWBW6NEjdFQIh51KF6P/Qzjg +TbctVeX/MTPuKewVhkQg9/sRmegbb+RBKEeCZccLUVuk5DAgFmi0cFP4e50uuNRG +gwskG9nJp/X5aBd4Y1YKg8XS+WLPwwrYvffoHN8mWHh+YqF16MbxMHM5xRMWu6E7 +801EzEWAW5Y8J2ssp/9FSI+aXOhk68aNlIVNc2R6Rg1IA8zKV4WSWTMUWAud832h +z9UZH/YkPgipuiflpKBGs5lbElRx3o6lYblhRL8J +-----END CERTIFICATE REQUEST----- diff --git a/tox.ini b/tox.ini index ac7f01a6ca..48e63975f6 100644 --- a/tox.ini +++ b/tox.ini @@ -19,7 +19,7 @@ ports = 6379:6379/tcp healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',6379)) else False" volumes = - bind:rw:{toxinidir}/docker/master/redis.conf:/redis.conf + bind:rw:{toxinidir}/docker/redis6-2/master/redis.conf:/redis.conf [docker:replica] name = replica @@ -30,7 +30,7 @@ ports = 6380:6380/tcp healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',6380)) else False" volumes = - bind:rw:{toxinidir}/docker/replica/redis.conf:/redis.conf + bind:rw:{toxinidir}/docker/redis6-2/replica/redis.conf:/redis.conf [docker:unstable] name = unstable @@ -51,7 +51,7 @@ ports = 26379:26379/tcp healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',26379)) else False" volumes = - bind:rw:{toxinidir}/docker/sentinel_1/sentinel.conf:/sentinel.conf + bind:rw:{toxinidir}/docker/redis6-2/sentinel/sentinel_1/sentinel.conf:/sentinel.conf [docker:sentinel_2] name = sentinel_2 @@ -62,7 +62,7 @@ ports = 26380:26380/tcp healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',26380)) else False" volumes = - bind:rw:{toxinidir}/docker/sentinel_2/sentinel.conf:/sentinel.conf + bind:rw:{toxinidir}/docker/redis6-2/sentinel/sentinel_2/sentinel.conf:/sentinel.conf [docker:sentinel_3] name = sentinel_3 @@ -73,7 +73,7 @@ ports = 26381:26381/tcp healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',26381)) else False" volumes = - bind:rw:{toxinidir}/docker/sentinel_3/sentinel.conf:/sentinel.conf + bind:rw:{toxinidir}/docker/redis6-2/sentinel/sentinel_3/sentinel.conf:/sentinel.conf [docker:redismod] name = redismod @@ -105,8 +105,131 @@ links = ports = 6666:6666/tcp volumes = - bind:ro:{toxinidir}/docker/stunnel/conf:/etc/stunnel/conf.d - bind:ro:{toxinidir}/docker/stunnel/keys:/etc/stunnel/keys + bind:ro:{toxinidir}/docker/redis6-2/stunnel/conf:/etc/stunnel/conf.d + bind:ro:{toxinidir}/docker/redis6-2/stunnel/keys:/etc/stunnel/keys + +[docker:redis5_master] +name = redis5_master +image = redisfab/redis-py:5.0-buster +ports = + 6377:6377/tcp +healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',6377)) else False" +volumes = + bind:rw:{toxinidir}/docker/redis5/master/redis.conf:/redis.conf + +[docker:redis5_replica] +name = redis5_replica +image = redisfab/redis-py:5.0-buster +links = + redis5_master:redis5_master +ports = + 6375:6375/tcp +healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',6375)) else False" +volumes = + bind:rw:{toxinidir}/docker/redis5/replica/redis.conf:/redis.conf + +[docker:redis5_sentinel_1] +name = redis5_sentinel_1 +image = redisfab/redis-py-sentinel:5.0-buster +links = + redis5_master:redis5_master +ports = + 26382:26382/tcp +healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',26382)) else False" +volumes = + bind:rw:{toxinidir}/docker/redis5/sentinel/sentinel_1.conf:/sentinel.conf + +[docker:redis5_sentinel_2] +name = redis5_sentinel_2 +image = redisfab/redis-py-sentinel:5.0-buster +links = + redis5_master:redis5_master +ports = + 26383:26383/tcp +healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',26383)) else False" +volumes = + bind:rw:{toxinidir}/docker/redis5/sentinel/sentinel_2.conf:/sentinel.conf + +[docker:redis5_sentinel_3] +name = redis5_sentinel_3 +image = redisfab/redis-py-sentinel:5.0-buster +links = + redis5_master:redis5_master +ports = + 26384:26384/tcp +healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',26384)) else False" +volumes = + bind:rw:{toxinidir}/docker/redis5/sentinel/sentinel_3.conf:/sentinel.conf + +[docker:redis5_cluster] +name = redis5_cluster +image = redisfab/redis-py-cluster:5.0-buster +ports = + 16385:16385/tcp + 16386:16386/tcp + 16387:16387/tcp + 16388:16388/tcp + 16389:16389/tcp + 16390:16390/tcp +healtcheck_cmd = python -c "import socket;print(True) if all([0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',port)) for port in range(16385,16390)]) else False" +volumes = + bind:rw:{toxinidir}/docker/cluster/redis.conf:/redis.conf + +[docker:redis4_master] +name = redis4_master +image = redisfab/redis-py:4.0-buster +ports = + 6376:6376/tcp +healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',6376)) else False" +volumes = + bind:rw:{toxinidir}/docker/redis4/naster/redis.conf:/redis.conf + +[docker:redis4_sentinel_1] +name = redis4_sentinel_1 +image = redisfab/redis-py-sentinel:4.0-buster +links = + redis4_master:redis4_master +ports = + 26385:26385/tcp +healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',26385)) else False" +volumes = + bind:rw:{toxinidir}/docker/redis4/sentinel/sentinel_1.conf:/sentinel.conf + +[docker:redis4_sentinel_2] +name = redis4_sentinel_2 +image = redisfab/redis-py-sentinel:4.0-buster +links = + redis4_master:redis4_master +ports = + 26386:26386/tcp +healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',26386)) else False" +volumes = + bind:rw:{toxinidir}/docker/redis4/sentinel/sentinel_2.conf:/sentinel.conf + +[docker:redis4_sentinel_3] +name = redis4_sentinel_3 +image = redisfab/redis-py-sentinel:4.0-buster +links = + redis4_master:redis4_master +ports = + 26387:26387/tcp +healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',26387)) else False" +volumes = + bind:rw:{toxinidir}/docker/redis4/sentinel/sentinel_3.conf:/sentinel.conf + +[docker:redis4_cluster] +name = redis4_cluster +image = redisfab/redis-py-cluster:4.0-buster +ports = + 16391:16391/tcp + 16392:16392/tcp + 16393:16393/tcp + 16394:16394/tcp + 16395:16395/tcp + 16396:16396/tcp +healtcheck_cmd = python -c "import socket;print(True) if all([0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',port)) for port in range(16391,16396)]) else False" +volumes = + bind:rw:{toxinidir}/docker/cluster/redis.conf:/redis.conf [isort] profile = black @@ -136,6 +259,45 @@ commands = standalone: pytest --cov=./ --cov-report=xml:coverage_redis.xml -W always -m 'not onlycluster' {posargs} cluster: pytest --cov=./ --cov-report=xml:coverage_cluster.xml -W always -m 'not onlynoncluster and not redismod' --redis-url={env:CLUSTER_URL:} {posargs} +[testenv:redis5] +deps = + -r {toxinidir}/requirements.txt + -r {toxinidir}/dev_requirements.txt +docker = + redis5_master + redis5_replica + redis5_sentinel_1 + redis5_sentinel_2 + redis5_sentinel_3 + redis5_cluster +extras = + hiredis: hiredis + cryptography: cryptography, requests +setenv = + CLUSTER_URL = "redis://localhost:16385/0" +commands = + standalone: pytest --cov=./ --cov-report=xml:coverage_redis.xml -W always -m 'not onlycluster and not redismod' {posargs} + cluster: pytest --cov=./ --cov-report=xml:coverage_cluster.xml -W always -m 'not onlynoncluster and not redismod' --redis-url={env:CLUSTER_URL:} {posargs} + +[testenv:redis4] +deps = + -r {toxinidir}/requirements.txt + -r {toxinidir}/dev_requirements.txt +docker = + redis4_master + redis4_sentinel_1 + redis4_sentinel_2 + redis4_sentinel_3 + redis4_cluster +extras = + hiredis: hiredis + cryptography: cryptography, requests +setenv = + CLUSTER_URL = "redis://localhost:16391/0" +commands = + standalone: pytest --cov=./ --cov-report=xml:coverage_redis.xml -W always -m 'not onlycluster and not redismod' {posargs} + cluster: pytest --cov=./ --cov-report=xml:coverage_cluster.xml -W always -m 'not onlynoncluster and not redismod' --redis-url={env:CLUSTER_URL:} {posargs} + [testenv:devenv] skipsdist = true skip_install = true From 18b9cc1c0dacb44eddf1cc2b74890161273427b5 Mon Sep 17 00:00:00 2001 From: "Chayim I. Kirshen" Date: Thu, 13 Jan 2022 10:24:55 +0200 Subject: [PATCH 03/25] path changes --- .github/workflows/integration.yaml | 1 - dev_requirements.txt | 1 - .../base/{Dockerfile.v4.0 => Dockerfile.redis4} | 0 .../base/{Dockerfile.v5.0 => Dockerfile.redis5} | 0 docker/{redis6-2 => redis6.2}/master/redis.conf | 0 docker/{redis6-2 => redis6.2}/replica/redis.conf | 0 .../sentinel/sentinel_1.conf | 0 .../sentinel/sentinel_2.conf | 0 .../sentinel/sentinel_3.conf | 0 docker/stunnel/README | 1 + docker/{redis6-2 => }/stunnel/conf/redis.conf | 0 docker/{redis6-2 => }/stunnel/create_certs.sh | 0 docker/{redis6-2 => }/stunnel/keys/ca-cert.pem | 0 docker/{redis6-2 => }/stunnel/keys/ca-key.pem | 0 .../{redis6-2 => }/stunnel/keys/client-cert.pem | 0 .../{redis6-2 => }/stunnel/keys/client-key.pem | 0 .../{redis6-2 => }/stunnel/keys/client-req.pem | 0 .../{redis6-2 => }/stunnel/keys/server-cert.pem | 0 .../{redis6-2 => }/stunnel/keys/server-key.pem | 0 .../{redis6-2 => }/stunnel/keys/server-req.pem | 0 tasks.py | 11 ----------- tox.ini | 16 +++++++--------- 22 files changed, 8 insertions(+), 22 deletions(-) rename docker/base/{Dockerfile.v4.0 => Dockerfile.redis4} (100%) rename docker/base/{Dockerfile.v5.0 => Dockerfile.redis5} (100%) rename docker/{redis6-2 => redis6.2}/master/redis.conf (100%) rename docker/{redis6-2 => redis6.2}/replica/redis.conf (100%) rename docker/{redis6-2 => redis6.2}/sentinel/sentinel_1.conf (100%) rename docker/{redis6-2 => redis6.2}/sentinel/sentinel_2.conf (100%) rename docker/{redis6-2 => redis6.2}/sentinel/sentinel_3.conf (100%) create mode 100644 docker/stunnel/README rename docker/{redis6-2 => }/stunnel/conf/redis.conf (100%) rename docker/{redis6-2 => }/stunnel/create_certs.sh (100%) rename docker/{redis6-2 => }/stunnel/keys/ca-cert.pem (100%) rename docker/{redis6-2 => }/stunnel/keys/ca-key.pem (100%) rename docker/{redis6-2 => }/stunnel/keys/client-cert.pem (100%) rename docker/{redis6-2 => }/stunnel/keys/client-key.pem (100%) rename docker/{redis6-2 => }/stunnel/keys/client-req.pem (100%) rename docker/{redis6-2 => }/stunnel/keys/server-cert.pem (100%) rename docker/{redis6-2 => }/stunnel/keys/server-key.pem (100%) rename docker/{redis6-2 => }/stunnel/keys/server-req.pem (100%) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index e81cf339fd..bd0fb2d076 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -48,7 +48,6 @@ jobs: - name: run tests run: | pip install -r dev_requirements.txt - bash docker/stunnel/create_certs.sh tox -e ${{matrix.test-type}}-${{matrix.connection-type}} - name: Upload codecov coverage uses: codecov/codecov-action@v2 diff --git a/dev_requirements.txt b/dev_requirements.txt index 1d33b9875b..2a4f37762f 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -6,7 +6,6 @@ pytest==6.2.5 pytest-timeout==2.0.1 tox==3.24.4 tox-docker==3.1.0 -tox-run-before==0.1 invoke==1.6.0 pytest-cov>=3.0.0 vulture>=2.3.0 diff --git a/docker/base/Dockerfile.v4.0 b/docker/base/Dockerfile.redis4 similarity index 100% rename from docker/base/Dockerfile.v4.0 rename to docker/base/Dockerfile.redis4 diff --git a/docker/base/Dockerfile.v5.0 b/docker/base/Dockerfile.redis5 similarity index 100% rename from docker/base/Dockerfile.v5.0 rename to docker/base/Dockerfile.redis5 diff --git a/docker/redis6-2/master/redis.conf b/docker/redis6.2/master/redis.conf similarity index 100% rename from docker/redis6-2/master/redis.conf rename to docker/redis6.2/master/redis.conf diff --git a/docker/redis6-2/replica/redis.conf b/docker/redis6.2/replica/redis.conf similarity index 100% rename from docker/redis6-2/replica/redis.conf rename to docker/redis6.2/replica/redis.conf diff --git a/docker/redis6-2/sentinel/sentinel_1.conf b/docker/redis6.2/sentinel/sentinel_1.conf similarity index 100% rename from docker/redis6-2/sentinel/sentinel_1.conf rename to docker/redis6.2/sentinel/sentinel_1.conf diff --git a/docker/redis6-2/sentinel/sentinel_2.conf b/docker/redis6.2/sentinel/sentinel_2.conf similarity index 100% rename from docker/redis6-2/sentinel/sentinel_2.conf rename to docker/redis6.2/sentinel/sentinel_2.conf diff --git a/docker/redis6-2/sentinel/sentinel_3.conf b/docker/redis6.2/sentinel/sentinel_3.conf similarity index 100% rename from docker/redis6-2/sentinel/sentinel_3.conf rename to docker/redis6.2/sentinel/sentinel_3.conf diff --git a/docker/stunnel/README b/docker/stunnel/README new file mode 100644 index 0000000000..e92ae78981 --- /dev/null +++ b/docker/stunnel/README @@ -0,0 +1 @@ + This directory contains a helper script to create ssl certificates for ssl tests. If the certificates are out of date, re-run create_certs and check them in. These are snake oil certificates. diff --git a/docker/redis6-2/stunnel/conf/redis.conf b/docker/stunnel/conf/redis.conf similarity index 100% rename from docker/redis6-2/stunnel/conf/redis.conf rename to docker/stunnel/conf/redis.conf diff --git a/docker/redis6-2/stunnel/create_certs.sh b/docker/stunnel/create_certs.sh similarity index 100% rename from docker/redis6-2/stunnel/create_certs.sh rename to docker/stunnel/create_certs.sh diff --git a/docker/redis6-2/stunnel/keys/ca-cert.pem b/docker/stunnel/keys/ca-cert.pem similarity index 100% rename from docker/redis6-2/stunnel/keys/ca-cert.pem rename to docker/stunnel/keys/ca-cert.pem diff --git a/docker/redis6-2/stunnel/keys/ca-key.pem b/docker/stunnel/keys/ca-key.pem similarity index 100% rename from docker/redis6-2/stunnel/keys/ca-key.pem rename to docker/stunnel/keys/ca-key.pem diff --git a/docker/redis6-2/stunnel/keys/client-cert.pem b/docker/stunnel/keys/client-cert.pem similarity index 100% rename from docker/redis6-2/stunnel/keys/client-cert.pem rename to docker/stunnel/keys/client-cert.pem diff --git a/docker/redis6-2/stunnel/keys/client-key.pem b/docker/stunnel/keys/client-key.pem similarity index 100% rename from docker/redis6-2/stunnel/keys/client-key.pem rename to docker/stunnel/keys/client-key.pem diff --git a/docker/redis6-2/stunnel/keys/client-req.pem b/docker/stunnel/keys/client-req.pem similarity index 100% rename from docker/redis6-2/stunnel/keys/client-req.pem rename to docker/stunnel/keys/client-req.pem diff --git a/docker/redis6-2/stunnel/keys/server-cert.pem b/docker/stunnel/keys/server-cert.pem similarity index 100% rename from docker/redis6-2/stunnel/keys/server-cert.pem rename to docker/stunnel/keys/server-cert.pem diff --git a/docker/redis6-2/stunnel/keys/server-key.pem b/docker/stunnel/keys/server-key.pem similarity index 100% rename from docker/redis6-2/stunnel/keys/server-key.pem rename to docker/stunnel/keys/server-key.pem diff --git a/docker/redis6-2/stunnel/keys/server-req.pem b/docker/stunnel/keys/server-req.pem similarity index 100% rename from docker/redis6-2/stunnel/keys/server-req.pem rename to docker/stunnel/keys/server-req.pem diff --git a/tasks.py b/tasks.py index 313986d427..c5064e086d 100644 --- a/tasks.py +++ b/tasks.py @@ -4,10 +4,6 @@ from invoke import run, task -def _generate_keys(): - run("bash docker/stunnel/create_certs.sh") - - with open("tox.ini") as fp: lines = fp.read().split("\n") dockers = [line.split("=")[1].strip() for line in lines if line.find("name") != -1] @@ -19,7 +15,6 @@ def devenv(c): specified in the tox.ini file. """ clean(c) - _generate_keys() cmd = "tox -e devenv" for d in dockers: cmd += f" --docker-dont-stop={d}" @@ -29,14 +24,12 @@ def devenv(c): @task def build_docs(c): """Generates the sphinx documentation.""" - _generate_keys() run("tox -e docs") @task def linters(c): """Run code linters""" - _generate_keys() run("tox -e linters") @@ -45,7 +38,6 @@ def all_tests(c): """Run all linters, and tests in redis-py. This assumes you have all the python versions specified in the tox.ini file. """ - _generate_keys() linters(c) tests(c) @@ -56,7 +48,6 @@ def tests(c): with and without hiredis. """ print("Starting Redis tests") - _generate_keys() run("tox -e '{standalone,cluster}'-'{plain,hiredis}'") @@ -65,7 +56,6 @@ def standalone_tests(c): """Run all Redis tests against the current python, with and without hiredis.""" print("Starting Redis tests") - _generate_keys() run("tox -e standalone-'{plain,hiredis,cryptography}'") @@ -74,7 +64,6 @@ def cluster_tests(c): """Run all Redis Cluster tests against the current python, with and without hiredis.""" print("Starting RedisCluster tests") - _generate_keys() run("tox -e cluster-'{plain,hiredis}'") diff --git a/tox.ini b/tox.ini index 48e63975f6..75f437924e 100644 --- a/tox.ini +++ b/tox.ini @@ -19,7 +19,7 @@ ports = 6379:6379/tcp healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',6379)) else False" volumes = - bind:rw:{toxinidir}/docker/redis6-2/master/redis.conf:/redis.conf + bind:rw:{toxinidir}/docker/redis6.2/master/redis.conf:/redis.conf [docker:replica] name = replica @@ -30,7 +30,7 @@ ports = 6380:6380/tcp healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',6380)) else False" volumes = - bind:rw:{toxinidir}/docker/redis6-2/replica/redis.conf:/redis.conf + bind:rw:{toxinidir}/docker/redis6.2/replica/redis.conf:/redis.conf [docker:unstable] name = unstable @@ -51,7 +51,7 @@ ports = 26379:26379/tcp healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',26379)) else False" volumes = - bind:rw:{toxinidir}/docker/redis6-2/sentinel/sentinel_1/sentinel.conf:/sentinel.conf + bind:rw:{toxinidir}/docker/redis6.2/sentinel/sentinel_1/sentinel.conf:/sentinel.conf [docker:sentinel_2] name = sentinel_2 @@ -62,7 +62,7 @@ ports = 26380:26380/tcp healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',26380)) else False" volumes = - bind:rw:{toxinidir}/docker/redis6-2/sentinel/sentinel_2/sentinel.conf:/sentinel.conf + bind:rw:{toxinidir}/docker/redis6.2/sentinel/sentinel_2/sentinel.conf:/sentinel.conf [docker:sentinel_3] name = sentinel_3 @@ -73,7 +73,7 @@ ports = 26381:26381/tcp healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',26381)) else False" volumes = - bind:rw:{toxinidir}/docker/redis6-2/sentinel/sentinel_3/sentinel.conf:/sentinel.conf + bind:rw:{toxinidir}/docker/redis6.2/sentinel/sentinel_3/sentinel.conf:/sentinel.conf [docker:redismod] name = redismod @@ -105,8 +105,8 @@ links = ports = 6666:6666/tcp volumes = - bind:ro:{toxinidir}/docker/redis6-2/stunnel/conf:/etc/stunnel/conf.d - bind:ro:{toxinidir}/docker/redis6-2/stunnel/keys:/etc/stunnel/keys + bind:ro:{toxinidir}/docker/stunnel/conf:/etc/stunnel/conf.d + bind:ro:{toxinidir}/docker/stunnel/keys:/etc/stunnel/keys [docker:redis5_master] name = redis5_master @@ -254,7 +254,6 @@ extras = cryptography: cryptography, requests setenv = CLUSTER_URL = "redis://localhost:16379/0" -run_before = {toxinidir}/docker/stunnel/create_certs.sh commands = standalone: pytest --cov=./ --cov-report=xml:coverage_redis.xml -W always -m 'not onlycluster' {posargs} cluster: pytest --cov=./ --cov-report=xml:coverage_cluster.xml -W always -m 'not onlynoncluster and not redismod' --redis-url={env:CLUSTER_URL:} {posargs} @@ -304,7 +303,6 @@ skip_install = true deps = -r {toxinidir}/dev_requirements.txt docker = {[testenv]docker} commands = /usr/bin/echo docker_up -run_before = {[testenv]run_before} [testenv:linters] deps_files = dev_requirements.txt From 50b1847d371b2605fd873abe58bae005e49ea6d4 Mon Sep 17 00:00:00 2001 From: dvora-h Date: Thu, 13 Jan 2022 12:13:40 +0200 Subject: [PATCH 04/25] fix linters --- tasks.py | 1 - tox.ini | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/tasks.py b/tasks.py index c5064e086d..48a7251e0f 100644 --- a/tasks.py +++ b/tasks.py @@ -3,7 +3,6 @@ from invoke import run, task - with open("tox.ini") as fp: lines = fp.read().split("\n") dockers = [line.split("=")[1].strip() for line in lines if line.find("name") != -1] diff --git a/tox.ini b/tox.ini index 75f437924e..1f21e89c69 100644 --- a/tox.ini +++ b/tox.ini @@ -51,7 +51,7 @@ ports = 26379:26379/tcp healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',26379)) else False" volumes = - bind:rw:{toxinidir}/docker/redis6.2/sentinel/sentinel_1/sentinel.conf:/sentinel.conf + bind:rw:{toxinidir}/docker/redis6.2/sentinel/sentinel_1.conf:/sentinel.conf [docker:sentinel_2] name = sentinel_2 @@ -62,7 +62,7 @@ ports = 26380:26380/tcp healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',26380)) else False" volumes = - bind:rw:{toxinidir}/docker/redis6.2/sentinel/sentinel_2/sentinel.conf:/sentinel.conf + bind:rw:{toxinidir}/docker/redis6.2/sentinel/sentinel_2.conf:/sentinel.conf [docker:sentinel_3] name = sentinel_3 @@ -73,7 +73,7 @@ ports = 26381:26381/tcp healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',26381)) else False" volumes = - bind:rw:{toxinidir}/docker/redis6.2/sentinel/sentinel_3/sentinel.conf:/sentinel.conf + bind:rw:{toxinidir}/docker/redis6.2/sentinel/sentinel_3.conf:/sentinel.conf [docker:redismod] name = redismod @@ -182,7 +182,7 @@ ports = 6376:6376/tcp healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',6376)) else False" volumes = - bind:rw:{toxinidir}/docker/redis4/naster/redis.conf:/redis.conf + bind:rw:{toxinidir}/docker/redis4/master/redis.conf:/redis.conf [docker:redis4_sentinel_1] name = redis4_sentinel_1 From 64691a87230d28dfb5a9b9e9713b584e3be0a8e3 Mon Sep 17 00:00:00 2001 From: dvora-h Date: Thu, 13 Jan 2022 12:55:28 +0200 Subject: [PATCH 05/25] fix tests --- tasks.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tasks.py b/tasks.py index 48a7251e0f..3b9a10863e 100644 --- a/tasks.py +++ b/tasks.py @@ -74,8 +74,6 @@ def clean(c): if os.path.isdir("dist"): shutil.rmtree("dist") run(f"docker rm -f {' '.join(dockers)}") - if os.path.isdir("docker/stunnel/keys"): - shutil.rmtree("docker/stunnel/keys") @task From 3311be7537ebf1a90e81be1587357357d104530a Mon Sep 17 00:00:00 2001 From: "Chayim I. Kirshen" Date: Tue, 25 Jan 2022 09:10:57 +0200 Subject: [PATCH 06/25] fixing linter --- tasks.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tasks.py b/tasks.py index 0f73bf407e..64b3aef80f 100644 --- a/tasks.py +++ b/tasks.py @@ -55,7 +55,6 @@ def standalone_tests(c): """Run all Redis tests against the current python, with and without hiredis.""" print("Starting Redis tests") - _generate_keys() run("tox -e standalone-'{plain,hiredis,ocsp}'") From f5bef3830338278080f632cb584d9d653920e6b4 Mon Sep 17 00:00:00 2001 From: Bar Shaul <88437685+barshaul@users.noreply.github.com> Date: Tue, 25 Jan 2022 11:54:23 +0200 Subject: [PATCH 07/25] Increased pubsub's wait_for_messages timeout to prevent flaky tests (#1893) --- tests/test_pubsub.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_pubsub.py b/tests/test_pubsub.py index 23af46153f..6456370c26 100644 --- a/tests/test_pubsub.py +++ b/tests/test_pubsub.py @@ -12,7 +12,7 @@ from .conftest import _get_client, skip_if_redis_enterprise, skip_if_server_version_lt -def wait_for_message(pubsub, timeout=0.1, ignore_subscribe_messages=False): +def wait_for_message(pubsub, timeout=0.5, ignore_subscribe_messages=False): now = time.time() timeout = now + timeout while now < timeout: From 7f9c1e8de58fd1a85f6a1a5d2be0688b8eae557d Mon Sep 17 00:00:00 2001 From: dvora-h <67596500+dvora-h@users.noreply.github.com> Date: Wed, 26 Jan 2022 09:09:53 +0200 Subject: [PATCH 08/25] Fixing TypeError in GraphCommands.explain (#1901) --- redis/commands/graph/commands.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/redis/commands/graph/commands.py b/redis/commands/graph/commands.py index fa0a9da55f..157f628339 100644 --- a/redis/commands/graph/commands.py +++ b/redis/commands/graph/commands.py @@ -135,6 +135,8 @@ def explain(self, query, params=None): query = self._build_params_header(params) + query plan = self.execute_command("GRAPH.EXPLAIN", self.name, query) + if isinstance(plan[0], bytes): + plan = [b.decode() for b in plan] return "\n".join(plan) def bulk(self, **kwargs): From 5222d6ae8b6f964bb0dfa486f154e42f8326704e Mon Sep 17 00:00:00 2001 From: dvora-h <67596500+dvora-h@users.noreply.github.com> Date: Wed, 26 Jan 2022 13:48:23 +0200 Subject: [PATCH 09/25] Fixing AttributeError in UnixDomainSocketConnection (#1903) --- redis/connection.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/redis/connection.py b/redis/connection.py index 508c1961e5..100f90206d 100755 --- a/redis/connection.py +++ b/redis/connection.py @@ -677,12 +677,19 @@ def _error_message(self, exception): # args for socket.error can either be (errno, "message") # or just "message" if len(exception.args) == 1: - return f"Error connecting to {self.host}:{self.port}. {exception.args[0]}." + try: + return f"Error connecting to {self.host}:{self.port}. \ + {exception.args[0]}." + except AttributeError: + return f"Connection Error: {exception.args[0]}" else: - return ( - f"Error {exception.args[0]} connecting to " - f"{self.host}:{self.port}. {exception.args[1]}." - ) + try: + return ( + f"Error {exception.args[0]} connecting to " + f"{self.host}:{self.port}. {exception.args[1]}." + ) + except AttributeError: + return f"Connection Error: {exception.args[0]}" def on_connect(self): "Initialize the connection, authenticate and select a database" From dfd226326fefd235fe0e5a808556b4bd6f023e58 Mon Sep 17 00:00:00 2001 From: Chayim Date: Wed, 26 Jan 2022 16:50:48 +0200 Subject: [PATCH 10/25] Fixing AttributeError on some connection errors (#1905) --- redis/connection.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/redis/connection.py b/redis/connection.py index 100f90206d..891695d31e 100755 --- a/redis/connection.py +++ b/redis/connection.py @@ -805,16 +805,19 @@ def can_read(self, timeout=0): def read_response(self, disable_decoding=False): """Read the response from a previously sent command""" + try: + hosterr = f"{self.host}:{self.port}" + except AttributeError: + hosterr = "connection" + try: response = self._parser.read_response(disable_decoding=disable_decoding) except socket.timeout: self.disconnect() - raise TimeoutError(f"Timeout reading from {self.host}:{self.port}") + raise TimeoutError(f"Timeout reading from {hosterr}") except OSError as e: self.disconnect() - raise ConnectionError( - f"Error while reading from {self.host}:{self.port}" f" : {e.args}" - ) + raise ConnectionError(f"Error while reading from {hosterr}" f" : {e.args}") except BaseException: self.disconnect() raise From 1da3037098621ccf230790d2d03084e9ba204c6f Mon Sep 17 00:00:00 2001 From: Chayim Date: Wed, 26 Jan 2022 16:51:08 +0200 Subject: [PATCH 11/25] cluster script fixes to support future cluster versions and redis unstable (#1900) --- docker/base/Dockerfile.cluster | 4 +++- docker/base/Dockerfile.unstable_cluster | 4 +++- docker/base/Dockerfile.unstable_sentinel | 17 ++++++++++++++ docker/base/create_cluster.sh | 28 +++++++++++++++++++----- 4 files changed, 46 insertions(+), 7 deletions(-) create mode 100644 docker/base/Dockerfile.unstable_sentinel diff --git a/docker/base/Dockerfile.cluster b/docker/base/Dockerfile.cluster index 5d419801fc..5c246dcf28 100644 --- a/docker/base/Dockerfile.cluster +++ b/docker/base/Dockerfile.cluster @@ -6,4 +6,6 @@ RUN chmod +x /create_cluster.sh EXPOSE 16379 16380 16381 16382 16383 16384 -CMD /create_cluster.sh 16379 16384 +ENV START_PORT=16379 +ENV END_PORT=16384 +CMD /create_cluster.sh diff --git a/docker/base/Dockerfile.unstable_cluster b/docker/base/Dockerfile.unstable_cluster index 31e4275d3c..2e3ed55371 100644 --- a/docker/base/Dockerfile.unstable_cluster +++ b/docker/base/Dockerfile.unstable_cluster @@ -6,4 +6,6 @@ RUN chmod +x /create_cluster.sh EXPOSE 6372 6373 6374 6375 6376 6377 -CMD /create_cluster.sh 6372 6377 +ENV START_PORT=6372 +ENV END_PORT=6377 +CMD ["/create_cluster.sh"] diff --git a/docker/base/Dockerfile.unstable_sentinel b/docker/base/Dockerfile.unstable_sentinel new file mode 100644 index 0000000000..fe6d062de8 --- /dev/null +++ b/docker/base/Dockerfile.unstable_sentinel @@ -0,0 +1,17 @@ +# produces redisfab/redis-py-sentinel:unstable +FROM ubuntu:bionic as builder +RUN apt-get update +RUN apt-get upgrade -y +RUN apt-get install -y build-essential git +RUN mkdir /build +WORKDIR /build +RUN git clone https://github.com/redis/redis +WORKDIR /build/redis +RUN make + +FROM ubuntu:bionic as runner +COPY --from=builder /build/redis/src/redis-server /usr/bin/redis-server +COPY --from=builder /build/redis/src/redis-cli /usr/bin/redis-cli +COPY --from=builder /build/redis/src/redis-sentinel /usr/bin/redis-sentinel + +CMD ["redis-sentinel", "/sentinel.conf"] diff --git a/docker/base/create_cluster.sh b/docker/base/create_cluster.sh index 72332944b3..fcb1b1cd8d 100755 --- a/docker/base/create_cluster.sh +++ b/docker/base/create_cluster.sh @@ -1,9 +1,21 @@ #! /bin/bash + mkdir -p /nodes touch /nodes/nodemap -START_NODE=$1 -END_NODE=$2 -for PORT in `seq ${START_NODE} ${END_NODE}`; do +if [ -z ${START_PORT} ]; then + START_PORT=16379 +fi +if [ -z ${END_PORT} ]; then + END_PORT=16384 +fi +if [ ! -z "$3" ]; then + START_PORT=$2 + START_PORT=$3 +fi +echo "STARTING: ${START_PORT}" +echo "ENDING: ${END_PORT}" + +for PORT in `seq ${START_PORT} ${END_PORT}`; do mkdir -p /nodes/$PORT if [[ -e /redis.conf ]]; then cp /redis.conf /nodes/$PORT/redis.conf @@ -17,12 +29,18 @@ daemonize yes logfile /redis.log dir /nodes/$PORT EOF + + set -x redis-server /nodes/$PORT/redis.conf if [ $? -ne 0 ]; then echo "Redis failed to start, exiting." - exit 3 + continue fi echo 127.0.0.1:$PORT >> /nodes/nodemap done -echo yes | redis-cli --cluster create $(seq -f 127.0.0.1:%g ${START_NODE} ${END_NODE}) --cluster-replicas 1 +if [ -z "${REDIS_PASSWORD}" ]; then + echo yes | redis-cli --cluster create `seq -f 127.0.0.1:%g ${START_PORT} ${END_PORT}` --cluster-replicas 1 +else + echo yes | redis-cli -a ${REDIS_PASSWORD} --cluster create `seq -f 127.0.0.1:%g ${START_PORT} ${END_PORT}` --cluster-replicas 1 +fi tail -f /redis.log From 32559aa2f83834ca83d46237ad6acea4b88cea50 Mon Sep 17 00:00:00 2001 From: Varun Chopra Date: Thu, 27 Jan 2022 12:49:24 +0530 Subject: [PATCH 12/25] Fixing LMOVE, BLMOVE returning an incorrect response (#1906) --- redis/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/redis/client.py b/redis/client.py index 612f91170a..1317cb6ffc 100755 --- a/redis/client.py +++ b/redis/client.py @@ -658,8 +658,8 @@ class Redis(RedisModuleCommands, CoreCommands, SentinelCommands): RESPONSE_CALLBACKS = { **string_keys_to_dict( "AUTH COPY EXPIRE EXPIREAT PEXPIRE PEXPIREAT " - "HEXISTS HMSET LMOVE BLMOVE MOVE " - "MSETNX PERSIST PSETEX RENAMENX SISMEMBER SMOVE SETEX SETNX", + "HEXISTS HMSET MOVE MSETNX PERSIST " + "PSETEX RENAMENX SISMEMBER SMOVE SETEX SETNX", bool, ), **string_keys_to_dict( From b2cb3c8bf7a245b2e2a0a664ca7502634c887396 Mon Sep 17 00:00:00 2001 From: Chayim Date: Thu, 27 Jan 2022 12:12:56 +0200 Subject: [PATCH 13/25] Raising ConnectionError on invalid ocsp certificates - with status information (#1907) --- redis/ocsp.py | 9 +++++++-- tests/test_ssl.py | 10 +++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/redis/ocsp.py b/redis/ocsp.py index 666c7dcd08..4753434fba 100644 --- a/redis/ocsp.py +++ b/redis/ocsp.py @@ -56,9 +56,14 @@ def _check_certificate(issuer_cert, ocsp_bytes, validate=True): raise AuthorizationError("you are not authorized to view this ocsp certificate") if ocsp_response.response_status == ocsp.OCSPResponseStatus.SUCCESSFUL: if ocsp_response.certificate_status != ocsp.OCSPCertStatus.GOOD: - return False + raise ConnectionError( + f'Received an {str(ocsp_response.certificate_status).split(".")[1]} ' + "ocsp certificate status" + ) else: - return False + raise ConnectionError( + "failed to retrieve a sucessful response from the ocsp responder" + ) if ocsp_response.this_update >= datetime.datetime.now(): raise ConnectionError("ocsp certificate was issued in the future") diff --git a/tests/test_ssl.py b/tests/test_ssl.py index 0ae7440daf..ab5d47f293 100644 --- a/tests/test_ssl.py +++ b/tests/test_ssl.py @@ -107,7 +107,7 @@ def test_ssl_ocsp_called_withcrypto(self, request): def test_valid_ocsp_cert_http(self): from redis.ocsp import OCSPVerifier - hostnames = ["github.com", "aws.amazon.com", "ynet.co.il", "microsoft.com"] + hostnames = ["github.com", "aws.amazon.com", "ynet.co.il"] for hostname in hostnames: context = ssl.create_default_context() with socket.create_connection((hostname, 443)) as sock: @@ -124,7 +124,9 @@ def test_revoked_ocsp_certificate(self): with socket.create_connection((hostname, 443)) as sock: with context.wrap_socket(sock, server_hostname=hostname) as wrapped: ocsp = OCSPVerifier(wrapped, hostname, 443) - assert ocsp.is_valid() is False + with pytest.raises(ConnectionError) as e: + assert ocsp.is_valid() + assert "REVOKED" in str(e) @skip_if_nocryptography() def test_unauthorized_ocsp(self): @@ -147,7 +149,9 @@ def test_ocsp_not_present_in_response(self): with socket.create_connection((hostname, 443)) as sock: with context.wrap_socket(sock, server_hostname=hostname) as wrapped: ocsp = OCSPVerifier(wrapped, hostname, 443) - assert ocsp.is_valid() is False + with pytest.raises(ConnectionError) as e: + assert ocsp.is_valid() + assert "from the" in str(e) @skip_if_nocryptography() def test_unauthorized_then_direct(self): From be426892b78bd448bb279e877bffddb726c5a750 Mon Sep 17 00:00:00 2001 From: dvora-h <67596500+dvora-h@users.noreply.github.com> Date: Thu, 27 Jan 2022 12:13:35 +0200 Subject: [PATCH 14/25] 4.1.2 (#1904) --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 8b84c2a97a..a44fe620d7 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ long_description_content_type="text/markdown", keywords=["Redis", "key-value store", "database"], license="MIT", - version="4.1.1", + version="4.1.2", packages=find_packages( include=[ "redis", From ce232bf586b733ca7372cc60e38a02ba9bac892f Mon Sep 17 00:00:00 2001 From: Chayim Date: Thu, 27 Jan 2022 12:59:37 +0200 Subject: [PATCH 15/25] adding cluster env timeout time (#1908) --- tests/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 9ba63d6caa..d9de876933 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -102,7 +102,7 @@ def pytest_sessionstart(session): wait_for_cluster_creation(redis_url, cluster_nodes) -def wait_for_cluster_creation(redis_url, cluster_nodes, timeout=20): +def wait_for_cluster_creation(redis_url, cluster_nodes, timeout=60): """ Waits for the cluster creation to complete. As soon as all :cluster_nodes: nodes become available, the cluster will be From d2ab70afb85041c5c5e547b0806642f9ee71f351 Mon Sep 17 00:00:00 2001 From: dvora-h <67596500+dvora-h@users.noreply.github.com> Date: Sun, 30 Jan 2022 14:58:23 +0200 Subject: [PATCH 16/25] Update changes file with changes since 4.0.0-beta2 (#1915) --- CHANGES | 160 +++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 152 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index b4372be34e..d32d52d5da 100644 --- a/CHANGES +++ b/CHANGES @@ -1,11 +1,155 @@ -# DEPRECATED - -This file is historic. Starting with redis-py 4.0.0b1, please see the GitHub releases page at -https://github.com/redis/redis-py/releases. - ------------------------------------------------------------------------------------------------- - -* (in development) +* 4.1.2 (Jan 27, 2022) + * Invalid OCSP certificates should raise ConnectionError on failed validation (#1907) + * Added retry mechanism on socket timeouts when connecting to the server (#1895) + * LMOVE, BLMOVE return incorrect responses (#1906) + * Fixing AttributeError in UnixDomainSocketConnection (#1903) + * Fixing TypeError in GraphCommands.explain (#1901) + * For tests, increasing wait time for the cluster (#1908) + * Increased pubsub's wait_for_messages timeout to prevent flaky tests (#1893) + * README code snippets formatted to highlight properly (#1888) + * Fix link in the main page (#1897) + * Documentation fixes: JSON Example, SSL Connection Examples, RTD version (#1887) + * Direct link to readthedocs (#1885) +* 4.1.1 (Jan 17, 2022) + * Add retries to connections in Sentinel Pools (#1879) + * OCSP Stapling Support (#1873) + * Define incr/decr as aliases of incrby/decrby (#1874) + * FT.CREATE - support MAXTEXTFIELDS, TEMPORARY, NOHL, NOFREQS, SKIPINITIALSCAN (#1847) + * Timeseries docs fix (#1877) + * get_connection: catch OSError too (#1832) + * Set keys var otherwise variable not created (#1853) + * Clusters should optionally require full slot coverage (#1845) + * Triple quote docstrings in client.py PEP 257 (#1876) + * syncing requirements (#1870) + * Typo and typing in GraphCommands documentation (#1855) + * Allowing poetry and redis-py to install together (#1854) + * setup.py: Add project_urls for PyPI (#1867) + * Support test with redis unstable docker (#1850) + * Connection examples (#1835) + * Documentation cleanup (#1841) +* 4.1.0 (Dec 26, 2021) + * OCSP stapling support (#1820) + * Support for SELECT (#1825) + * Support for specifying error types with retry (#1817) + * Support for RESET command since Redis 6.2.0 (#1824) + * Support CLIENT TRACKING (#1612) + * Support WRITE in CLIENT PAUSE (#1549) + * JSON set_file and set_path support (#1818) + * Allow ssl_ca_path with rediss:// urls (#1814) + * Support for password-encrypted SSL private keys (#1782) + * Support SYNC and PSYNC (#1741) + * Retry on error exception and timeout fixes (#1821) + * Fixing read race condition during pubsub (#1737) + * Fixing exception in listen (#1823) + * Fixed MovedError, and stopped iterating through startup nodes when slots are fully covered (#1819) + * Socket not closing after server disconnect (#1797) + * Single sourcing the package version (#1791) + * Ensure redis_connect_func is set on uds connection (#1794) + * SRTALGO - Skip for redis versions greater than 7.0.0 (#1831) + * Documentation updates (#1822) + * Add CI action to install package from repository commit hash (#1781) (#1790) + * Fix link in lmove docstring (#1793) + * Disabling JSON.DEBUG tests (#1787) + * Migrated targeted nodes to kwargs in Cluster Mode (#1762) + * Added support for MONITOR in clusters (#1756) + * Adding ROLE Command (#1610) + * Integrate RedisBloom support (#1683) + * Adding RedisGraph support (#1556) + * Allow overriding connection class via keyword arguments (#1752) + * Aggregation LOAD * support for RediSearch (#1735) + * Adding cluster, bloom, and graph docs (#1779) + * Add packaging to setup_requires, and use >= to play nice to setup.py (fixes #1625) (#1780) + * Fixing the license link in the readme (#1778) + * Removing distutils from tests (#1773) + * Fix cluster ACL tests (#1774) + * Improved RedisCluster's reinitialize_steps and documentation (#1765) + * Added black and isort (#1734) + * Link Documents for all module commands (#1711) + * Pyupgrade + flynt + f-strings (#1759) + * Remove unused aggregation subclasses in RediSearch (#1754) + * Adding RedisCluster client to support Redis Cluster Mode (#1660) + * Support RediSearch FT.PROFILE command (#1727) + * Adding support for non-decodable commands (#1731) + * COMMAND GETKEYS support (#1738) + * RedisJSON 2.0.4 behaviour support (#1747) + * Removing deprecating distutils (PEP 632) (#1730) + * Updating PR template (#1745) + * Removing duplication of Script class (#1751) + * Splitting documentation for read the docs (#1743) + * Improve code coverage for aggregation tests (#1713) + * Fixing COMMAND GETKEYS tests (#1750) + * GitHub release improvements (#1684) +* 4.0.2 (Nov 22, 2021) + * Restoring Sentinel commands to redis client (#1723) + * Better removal of hiredis warning (#1726) + * Adding links to redis documents in function calls (#1719) +* 4.0.1 (Nov 17, 2021) + * Removing command on initial connections (#1722) + * Removing hiredis warning when not installed (#1721) +* 4.0.0 (Nov 15, 2021) + * FT.EXPLAINCLI intentionally raising NotImplementedError + * Restoring ZRANGE desc for Redis < 6.2.0 (#1697) + * Response parsing occasionally fails to parse floats (#1692) + * Re-enabling read-the-docs (#1707) + * Call HSET after FT.CREATE to avoid keyspace scan (#1706) + * Unit tests fixes for compatibility (#1703) + * Improve documentation about Locks (#1701) + * Fixes to allow --redis-url to pass through all tests (#1700) + * Fix unit tests running against Redis 4.0.0 (#1699) + * Search alias test fix (#1695) + * Adding RediSearch/RedisJSON tests (#1691) + * Updating codecov rules (#1689) + * Tests to validate custom JSON decoders (#1681) + * Added breaking icon to release drafter (#1702) + * Removing dependency on six (#1676) + * Re-enable pipeline support for JSON and TimeSeries (#1674) + * Export Sentinel, and SSL like other classes (#1671) + * Restore zrange functionality for older versions of Redis (#1670) + * Fixed garbage collection deadlock (#1578) + * Tests to validate built python packages (#1678) + * Sleep for flaky search test (#1680) + * Test function renames, to match standards (#1679) + * Docstring improvements for Redis class (#1675) + * Fix georadius tests (#1672) + * Improvements to JSON coverage (#1666) + * Add python_requires setuptools check for python > 3.6 (#1656) + * SMISMEMBER support (#1667) + * Exposing the module version in loaded_modules (#1648) + * RedisTimeSeries support (#1652) + * Support for json multipath ($) (#1663) + * Added boolean parsing to PEXPIRE and PEXPIREAT (#1665) + * Add python_requires setuptools check for python > 3.6 (#1656) + * Adding vulture for static analysis (#1655) + * Starting to clean the docs (#1657) + * Update README.md (#1654) + * Adding description format for package (#1651) + * Publish to pypi as releases are generated with the release drafter (#1647) + * Restore actions to prs (#1653) + * Fixing the package to include commands (#1649) + * Re-enabling codecov as part of CI process (#1646) + * Adding support for redisearch (#1640) Thanks @chayim + * redisjson support (#1636) Thanks @chayim + * Sentinel: Add SentinelManagedSSLConnection (#1419) Thanks @AbdealiJK + * Enable floating parameters in SET (ex and px) (#1635) Thanks @AvitalFineRedis + * Add warning when hiredis not installed. Recommend installation. (#1621) Thanks @adiamzn + * Raising NotImplementedError for SCRIPT DEBUG and DEBUG SEGFAULT (#1624) Thanks @chayim + * CLIENT REDIR command support (#1623) Thanks @chayim + * REPLICAOF command implementation (#1622) Thanks @chayim + * Add support to NX XX and CH to GEOADD (#1605) Thanks @AvitalFineRedis + * Add support to ZRANGE and ZRANGESTORE parameters (#1603) Thanks @AvitalFineRedis + * Pre 6.2 redis should default to None for script flush (#1641) Thanks @chayim + * Add FULL option to XINFO SUMMARY (#1638) Thanks @agusdmb + * Geosearch test should use any=True (#1594) Thanks @Andrew-Chen-Wang + * Removing packaging dependency (#1626) Thanks @chayim + * Fix client_kill_filter docs for skimpy (#1596) Thanks @Andrew-Chen-Wang + * Normalize minid and maxlen docs (#1593) Thanks @Andrew-Chen-Wang + * Update docs for multiple usernames for ACL DELUSER (#1595) Thanks @Andrew-Chen-Wang + * Fix grammar of get param in set command (#1588) Thanks @Andrew-Chen-Wang + * Fix docs for client_kill_filter (#1584) Thanks @Andrew-Chen-Wang + * Convert README & CONTRIBUTING from rst to md (#1633) Thanks @davidylee + * Test BYLEX param in zrangestore (#1634) Thanks @AvitalFineRedis + * Tox integrations with invoke and docker (#1632) Thanks @chayim + * Adding the release drafter to help simplify release notes (#1618). Thanks @chayim * BACKWARDS INCOMPATIBLE: Removed support for end of life Python 2.7. #1318 * BACKWARDS INCOMPATIBLE: All values within Redis URLs are unquoted via urllib.parse.unquote. Prior versions of redis-py supported this by From fc43430a9196ecea8836e1b9f6831706857d2dc0 Mon Sep 17 00:00:00 2001 From: dvora-h <67596500+dvora-h@users.noreply.github.com> Date: Sun, 30 Jan 2022 14:58:33 +0200 Subject: [PATCH 17/25] Fixing volume for unstable_cluster docker (#1914) --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 7edeb43ea4..97a74663b2 100644 --- a/tox.ini +++ b/tox.ini @@ -53,7 +53,7 @@ ports = 6377:6377/tcp healtcheck_cmd = python -c "import socket;print(True) if all([0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',port)) for port in range(6372,6377)]) else False" volumes = - bind:rw:{toxinidir}/docker/cluster/redis.conf:/redis.conf + bind:rw:{toxinidir}/docker/unstable_cluster/redis.conf:/redis.conf [docker:sentinel_1] name = sentinel_1 From 99b6d05358a96d8767e1d6846b320ecbd7cda07a Mon Sep 17 00:00:00 2001 From: dvora-h <67596500+dvora-h@users.noreply.github.com> Date: Wed, 2 Feb 2022 12:48:11 +0200 Subject: [PATCH 18/25] Change json.clear test multi to be up to date with redisjson (#1922) * fix json clear test * fix json clear test --- tests/test_json.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_json.py b/tests/test_json.py index 6980e67398..21bdc08b5e 100644 --- a/tests/test_json.py +++ b/tests/test_json.py @@ -905,10 +905,10 @@ def test_clear_dollar(client): }, ) # Test multi - assert client.json().clear("doc1", "$..a") == 3 + assert client.json().clear("doc1", "$..a") == 4 assert client.json().get("doc1", "$") == [ - {"nested1": {"a": {}}, "a": [], "nested2": {"a": "claro"}, "nested3": {"a": {}}} + {"nested1": {"a": {}}, "a": [], "nested2": {"a": ""}, "nested3": {"a": {}}} ] # Test single From d4fa099274ccbbdbfb262f22851bbb8fcc975ff2 Mon Sep 17 00:00:00 2001 From: dvora-h <67596500+dvora-h@users.noreply.github.com> Date: Wed, 2 Feb 2022 12:49:18 +0200 Subject: [PATCH 19/25] Add support for BZMPOP (#1851) * add bzmpop * add comment * fix pr comment * fix linters * fix pr comments --- redis/commands/core.py | 33 +++++++++++++++++++++++++++++++++ tests/test_commands.py | 13 +++++++++++++ 2 files changed, 46 insertions(+) diff --git a/redis/commands/core.py b/redis/commands/core.py index 73003e7fb6..17194c341f 100644 --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -2,6 +2,7 @@ import hashlib import time import warnings +from typing import List, Optional from redis.exceptions import ConnectionError, DataError, NoScriptError, RedisError @@ -3237,6 +3238,38 @@ def bzpopmin(self, keys, timeout=0): keys.append(timeout) return self.execute_command("BZPOPMIN", *keys) + def bzmpop( + self, + timeout: float, + numkeys: int, + keys: List[str], + min: Optional[bool] = False, + max: Optional[bool] = False, + count: Optional[int] = 1, + ) -> Optional[list]: + """ + Pop ``count`` values (default 1) off of the first non-empty sorted set + named in the ``keys`` list. + + If none of the sorted sets in ``keys`` has a value to pop, + then block for ``timeout`` seconds, or until a member gets added + to one of the sorted sets. + + If timeout is 0, then block indefinitely. + + For more information check https://redis.io/commands/bzmpop + """ + args = [timeout, numkeys, *keys] + if (min and max) or (not min and not max): + raise DataError("Either min or max, but not both must be set") + elif min: + args.append("MIN") + else: + args.append("MAX") + args.extend(["COUNT", count]) + + return self.execute_command("BZMPOP", *args) + def _zrange( self, command, diff --git a/tests/test_commands.py b/tests/test_commands.py index b28b63ea6e..937172a195 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -2058,6 +2058,19 @@ def test_bzpopmin(self, r): r.zadd("c", {"c1": 100}) assert r.bzpopmin("c", timeout=1) == (b"c", b"c1", 100) + @pytest.mark.onlynoncluster + # @skip_if_server_version_lt("7.0.0") turn on after redis 7 release + def test_bzmpop(self, unstable_r): + unstable_r.zadd("a", {"a1": 1, "a2": 2, "a3": 3}) + res = [b"a", [[b"a1", b"1"], [b"a2", b"2"]]] + assert unstable_r.bzmpop(1, "2", ["b", "a"], min=True, count=2) == res + with pytest.raises(redis.DataError): + unstable_r.bzmpop(1, "2", ["b", "a"], count=2) + unstable_r.zadd("b", {"b1": 10, "ab": 9, "b3": 8}) + res = [b"b", [[b"b1", b"10"]]] + assert unstable_r.bzmpop(0, "2", ["b", "a"], max=True) == res + assert unstable_r.bzmpop(1, "2", ["foo", "bar"], max=True) is None + def test_zrange(self, r): r.zadd("a", {"a1": 1, "a2": 2, "a3": 3}) assert r.zrange("a", 0, 1) == [b"a1", b"a2"] From 0567fd88619cbcccb85c9e2760e020edeb3190e3 Mon Sep 17 00:00:00 2001 From: dvora-h <67596500+dvora-h@users.noreply.github.com> Date: Wed, 2 Feb 2022 12:52:37 +0200 Subject: [PATCH 20/25] add client no-evict (#1856) --- redis/commands/core.py | 8 ++++++++ tests/test_commands.py | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/redis/commands/core.py b/redis/commands/core.py index 17194c341f..b06bb5c941 100644 --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -640,6 +640,14 @@ def client_unpause(self, **kwargs): """ return self.execute_command("CLIENT UNPAUSE", **kwargs) + def client_no_evict(self, mode: str) -> str: + """ + Sets the client eviction mode for the current connection. + + For more information check https://redis.io/commands/client-no-evict + """ + return self.execute_command("CLIENT NO-EVICT", mode) + def command(self, **kwargs): """ Returns dict reply of details about all Redis commands. diff --git a/tests/test_commands.py b/tests/test_commands.py index 937172a195..cdcf1202d8 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -592,6 +592,13 @@ def test_client_pause_all(self, r, r2): def test_client_unpause(self, r): assert r.client_unpause() == b"OK" + @pytest.mark.onlynoncluster + # @skip_if_server_version_lt("7.0.0") turn on after redis 7 release + def test_client_no_evict(self, unstable_r): + assert unstable_r.client_no_evict("ON") == b"OK" + with pytest.raises(TypeError): + unstable_r.client_no_evict() + @pytest.mark.onlynoncluster @skip_if_server_version_lt("3.2.0") def test_client_reply(self, r, r_timeout): From 9e098aa698633451ed020a47658cd5c2e6c17abd Mon Sep 17 00:00:00 2001 From: dvora-h <67596500+dvora-h@users.noreply.github.com> Date: Wed, 2 Feb 2022 13:20:58 +0200 Subject: [PATCH 21/25] Add support for ZINTERCARD (#1857) * add zintercard * fix pr comment * linters --- redis/commands/core.py | 13 +++++++++++++ tests/test_commands.py | 9 +++++++++ 2 files changed, 22 insertions(+) diff --git a/redis/commands/core.py b/redis/commands/core.py index b06bb5c941..a4a48f95f1 100644 --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -3153,6 +3153,19 @@ def zinterstore(self, dest, keys, aggregate=None): """ return self._zaggregate("ZINTERSTORE", dest, keys, aggregate) + def zintercard(self, numkeys: int, keys: List[str], limit: int = 0) -> int: + """ + Return the cardinality of the intersect of multiple sorted sets + specified by ``keys`. + When LIMIT provided (defaults to 0 and means unlimited), if the intersection + cardinality reaches limit partway through the computation, the algorithm will + exit and yield limit as the cardinality + + For more information check https://redis.io/commands/zintercard + """ + args = [numkeys, *keys, "LIMIT", limit] + return self.execute_command("ZINTERCARD", *args) + def zlexcount(self, name, min, max): """ Return the number of items in the sorted set ``name`` between the diff --git a/tests/test_commands.py b/tests/test_commands.py index cdcf1202d8..f4d7fa73e0 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -1979,6 +1979,15 @@ def test_zinter(self, r): (b"a1", 23), ] + @pytest.mark.onlynoncluster + # @skip_if_server_version_lt("7.0.0") turn on after redis 7 release + def test_zintercard(self, unstable_r): + unstable_r.zadd("a", {"a1": 1, "a2": 2, "a3": 1}) + unstable_r.zadd("b", {"a1": 2, "a2": 2, "a3": 2}) + unstable_r.zadd("c", {"a1": 6, "a3": 5, "a4": 4}) + assert unstable_r.zintercard(3, ["a", "b", "c"]) == 2 + assert unstable_r.zintercard(3, ["a", "b", "c"], limit=1) == 1 + @pytest.mark.onlynoncluster def test_zinterstore_sum(self, r): r.zadd("a", {"a1": 1, "a2": 1, "a3": 1}) From c76ba62c6d03d40b7f159a65ba4f778794a6277a Mon Sep 17 00:00:00 2001 From: dvora-h <67596500+dvora-h@users.noreply.github.com> Date: Wed, 2 Feb 2022 13:25:42 +0200 Subject: [PATCH 22/25] Add support for EVAL_RO (#1862) * add sort_ro * mark test as onlynon cluster * delete mark test as onlynoncluster * add eval_ro * fix linters * delete sort_ro * fix pr comment * add type hints * add type hints * linters --- redis/commands/core.py | 21 +++++++++++++++++++-- tests/test_scripting.py | 8 ++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/redis/commands/core.py b/redis/commands/core.py index a4a48f95f1..80fad1a716 100644 --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -3917,7 +3917,12 @@ class ScriptCommands: https://redis.com/ebook/part-3-next-steps/chapter-11-scripting-redis-with-lua/ """ - def eval(self, script, numkeys, *keys_and_args): + def _eval( + self, command: str, script: str, numkeys: int, *keys_and_args: list + ) -> str: + return self.execute_command(command, script, numkeys, *keys_and_args) + + def eval(self, script: str, numkeys: int, *keys_and_args: list) -> str: """ Execute the Lua ``script``, specifying the ``numkeys`` the script will touch and the key names and argument values in ``keys_and_args``. @@ -3928,7 +3933,19 @@ def eval(self, script, numkeys, *keys_and_args): For more information check https://redis.io/commands/eval """ - return self.execute_command("EVAL", script, numkeys, *keys_and_args) + return self._eval("EVAL", script, numkeys, *keys_and_args) + + def eval_ro(self, script: str, numkeys: int, *keys_and_args: list) -> str: + """ + The read-only variant of the EVAL command + + Execute the read-only Lue ``script`` specifying the ``numkeys`` the script + will touch and the key names and argument values in ``keys_and_args``. + Returns the result of the script. + + For more information check https://redis.io/commands/eval_ro + """ + return self._eval("EVAL_RO", script, numkeys, *keys_and_args) def evalsha(self, sha, numkeys, *keys_and_args): """ diff --git a/tests/test_scripting.py b/tests/test_scripting.py index 9f4f82023f..b0d76c7335 100644 --- a/tests/test_scripting.py +++ b/tests/test_scripting.py @@ -1,5 +1,6 @@ import pytest +import redis from redis import exceptions from tests.conftest import skip_if_server_version_lt @@ -31,6 +32,13 @@ def test_eval(self, r): # 2 * 3 == 6 assert r.eval(multiply_script, 1, "a", 3) == 6 + # @skip_if_server_version_lt("7.0.0") turn on after redis 7 release + def test_eval_ro(self, unstable_r): + unstable_r.set("a", "b") + assert unstable_r.eval_ro("return redis.call('GET', KEYS[1])", 1, "a") == b"b" + with pytest.raises(redis.ResponseError): + unstable_r.eval_ro("return redis.call('DEL', KEYS[1])", 1, "a") + @skip_if_server_version_lt("6.2.0") def test_script_flush_620(self, r): r.set("a", 2) From 36862b885f5768c3328d76da9bb0c1201519c2d6 Mon Sep 17 00:00:00 2001 From: dvora-h <67596500+dvora-h@users.noreply.github.com> Date: Wed, 2 Feb 2022 13:26:00 +0200 Subject: [PATCH 23/25] Add support for EVALSHA_RO (#1863) * add evalsha-ro * fix pr comment * add type hints * add type hints --- redis/commands/core.py | 22 ++++++++++++++++++++-- tests/test_scripting.py | 9 +++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/redis/commands/core.py b/redis/commands/core.py index 80fad1a716..383c635aea 100644 --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -3947,7 +3947,12 @@ def eval_ro(self, script: str, numkeys: int, *keys_and_args: list) -> str: """ return self._eval("EVAL_RO", script, numkeys, *keys_and_args) - def evalsha(self, sha, numkeys, *keys_and_args): + def _evalsha( + self, command: str, sha: str, numkeys: int, *keys_and_args: list + ) -> str: + return self.execute_command(command, sha, numkeys, *keys_and_args) + + def evalsha(self, sha: str, numkeys: int, *keys_and_args: list) -> str: """ Use the ``sha`` to execute a Lua script already registered via EVAL or SCRIPT LOAD. Specify the ``numkeys`` the script will touch and the @@ -3959,7 +3964,20 @@ def evalsha(self, sha, numkeys, *keys_and_args): For more information check https://redis.io/commands/evalsha """ - return self.execute_command("EVALSHA", sha, numkeys, *keys_and_args) + return self._evalsha("EVALSHA", sha, numkeys, *keys_and_args) + + def evalsha_ro(self, sha: str, numkeys: int, *keys_and_args: list) -> str: + """ + The read-only variant of the EVALSHA command + + Use the ``sha`` to execute a read-only Lua script already registered via EVAL + or SCRIPT LOAD. Specify the ``numkeys`` the script will touch and the + key names and argument values in ``keys_and_args``. Returns the result + of the script. + + For more information check https://redis.io/commands/evalsha_ro + """ + return self._evalsha("EVALSHA_RO", sha, numkeys, *keys_and_args) def script_exists(self, *args): """ diff --git a/tests/test_scripting.py b/tests/test_scripting.py index b0d76c7335..f4671a5f9a 100644 --- a/tests/test_scripting.py +++ b/tests/test_scripting.py @@ -74,6 +74,15 @@ def test_evalsha(self, r): # 2 * 3 == 6 assert r.evalsha(sha, 1, "a", 3) == 6 + # @skip_if_server_version_lt("7.0.0") turn on after redis 7 release + def test_evalsha_ro(self, unstable_r): + unstable_r.set("a", "b") + get_sha = unstable_r.script_load("return redis.call('GET', KEYS[1])") + del_sha = unstable_r.script_load("return redis.call('DEL', KEYS[1])") + assert unstable_r.evalsha_ro(get_sha, 1, "a") == b"b" + with pytest.raises(redis.ResponseError): + unstable_r.evalsha_ro(del_sha, 1, "a") + def test_evalsha_script_not_loaded(self, r): r.set("a", 2) sha = r.script_load(multiply_script) From 4d2d62c358378715f6da2fd4d68af14f659cb7e0 Mon Sep 17 00:00:00 2001 From: dvora-h <67596500+dvora-h@users.noreply.github.com> Date: Wed, 2 Feb 2022 13:26:29 +0200 Subject: [PATCH 24/25] Fix naming conventions (#1872) * fix naming convention * fix worng changes --- redis/commands/bf/__init__.py | 22 ++-- redis/commands/bf/commands.py | 42 +++--- redis/commands/graph/__init__.py | 20 +-- redis/commands/graph/edge.py | 2 +- redis/commands/graph/node.py | 2 +- redis/commands/graph/query_result.py | 4 +- redis/commands/helpers.py | 2 +- redis/commands/json/commands.py | 28 ++-- redis/commands/json/path.py | 2 +- redis/commands/search/commands.py | 6 +- redis/commands/search/indexDefinition.py | 24 ++-- redis/commands/timeseries/commands.py | 100 +++++++------- tests/test_graph.py | 12 +- tests/test_graph_utils/test_edge.py | 6 +- tests/test_graph_utils/test_node.py | 12 +- tests/test_json.py | 160 +++++++++++------------ tests/test_search.py | 16 +-- 17 files changed, 230 insertions(+), 230 deletions(-) diff --git a/redis/commands/bf/__init__.py b/redis/commands/bf/__init__.py index f34e11d9bb..d62d8a0d83 100644 --- a/redis/commands/bf/__init__.py +++ b/redis/commands/bf/__init__.py @@ -18,70 +18,70 @@ class AbstractBloom(object): """ @staticmethod - def appendItems(params, items): + def append_items(params, items): """Append ITEMS to params.""" params.extend(["ITEMS"]) params += items @staticmethod - def appendError(params, error): + def append_error(params, error): """Append ERROR to params.""" if error is not None: params.extend(["ERROR", error]) @staticmethod - def appendCapacity(params, capacity): + def append_capacity(params, capacity): """Append CAPACITY to params.""" if capacity is not None: params.extend(["CAPACITY", capacity]) @staticmethod - def appendExpansion(params, expansion): + def append_expansion(params, expansion): """Append EXPANSION to params.""" if expansion is not None: params.extend(["EXPANSION", expansion]) @staticmethod - def appendNoScale(params, noScale): + def append_no_scale(params, noScale): """Append NONSCALING tag to params.""" if noScale is not None: params.extend(["NONSCALING"]) @staticmethod - def appendWeights(params, weights): + def append_weights(params, weights): """Append WEIGHTS to params.""" if len(weights) > 0: params.append("WEIGHTS") params += weights @staticmethod - def appendNoCreate(params, noCreate): + def append_no_create(params, noCreate): """Append NOCREATE tag to params.""" if noCreate is not None: params.extend(["NOCREATE"]) @staticmethod - def appendItemsAndIncrements(params, items, increments): + def append_items_and_increments(params, items, increments): """Append pairs of items and increments to params.""" for i in range(len(items)): params.append(items[i]) params.append(increments[i]) @staticmethod - def appendValuesAndWeights(params, items, weights): + def append_values_and_weights(params, items, weights): """Append pairs of items and weights to params.""" for i in range(len(items)): params.append(items[i]) params.append(weights[i]) @staticmethod - def appendMaxIterations(params, max_iterations): + def append_max_iterations(params, max_iterations): """Append MAXITERATIONS to params.""" if max_iterations is not None: params.extend(["MAXITERATIONS", max_iterations]) @staticmethod - def appendBucketSize(params, bucket_size): + def append_bucket_size(params, bucket_size): """Append BUCKETSIZE to params.""" if bucket_size is not None: params.extend(["BUCKETSIZE", bucket_size]) diff --git a/redis/commands/bf/commands.py b/redis/commands/bf/commands.py index 7fc507d2d9..e911efc621 100644 --- a/redis/commands/bf/commands.py +++ b/redis/commands/bf/commands.py @@ -62,8 +62,8 @@ def create(self, key, errorRate, capacity, expansion=None, noScale=None): For more information see `BF.RESERVE `_. """ # noqa params = [key, errorRate, capacity] - self.appendExpansion(params, expansion) - self.appendNoScale(params, noScale) + self.append_expansion(params, expansion) + self.append_no_scale(params, noScale) return self.execute_command(BF_RESERVE, *params) def add(self, key, item): @@ -102,12 +102,12 @@ def insert( For more information see `BF.INSERT `_. """ # noqa params = [key] - self.appendCapacity(params, capacity) - self.appendError(params, error) - self.appendExpansion(params, expansion) - self.appendNoCreate(params, noCreate) - self.appendNoScale(params, noScale) - self.appendItems(params, items) + self.append_capacity(params, capacity) + self.append_error(params, error) + self.append_expansion(params, expansion) + self.append_no_create(params, noCreate) + self.append_no_scale(params, noScale) + self.append_items(params, items) return self.execute_command(BF_INSERT, *params) @@ -177,9 +177,9 @@ def create( For more information see `CF.RESERVE `_. """ # noqa params = [key, capacity] - self.appendExpansion(params, expansion) - self.appendBucketSize(params, bucket_size) - self.appendMaxIterations(params, max_iterations) + self.append_expansion(params, expansion) + self.append_bucket_size(params, bucket_size) + self.append_max_iterations(params, max_iterations) return self.execute_command(CF_RESERVE, *params) def add(self, key, item): @@ -207,9 +207,9 @@ def insert(self, key, items, capacity=None, nocreate=None): For more information see `CF.INSERT `_. """ # noqa params = [key] - self.appendCapacity(params, capacity) - self.appendNoCreate(params, nocreate) - self.appendItems(params, items) + self.append_capacity(params, capacity) + self.append_no_create(params, nocreate) + self.append_items(params, items) return self.execute_command(CF_INSERT, *params) def insertnx(self, key, items, capacity=None, nocreate=None): @@ -220,9 +220,9 @@ def insertnx(self, key, items, capacity=None, nocreate=None): For more information see `CF.INSERTNX `_. """ # noqa params = [key] - self.appendCapacity(params, capacity) - self.appendNoCreate(params, nocreate) - self.appendItems(params, items) + self.append_capacity(params, capacity) + self.append_no_create(params, nocreate) + self.append_items(params, items) return self.execute_command(CF_INSERTNX, *params) def exists(self, key, item): @@ -315,7 +315,7 @@ def incrby(self, key, items, increments): >>> topkincrby('A', ['foo'], [1]) """ # noqa params = [key] - self.appendItemsAndIncrements(params, items, increments) + self.append_items_and_increments(params, items, increments) return self.execute_command(TOPK_INCRBY, *params) def query(self, key, *items): @@ -383,7 +383,7 @@ def add(self, key, values, weights): >>> tdigestadd('A', [1500.0], [1.0]) """ # noqa params = [key] - self.appendValuesAndWeights(params, values, weights) + self.append_values_and_weights(params, values, weights) return self.execute_command(TDIGEST_ADD, *params) def merge(self, toKey, fromKey): @@ -465,7 +465,7 @@ def incrby(self, key, items, increments): >>> cmsincrby('A', ['foo'], [1]) """ # noqa params = [key] - self.appendItemsAndIncrements(params, items, increments) + self.append_items_and_increments(params, items, increments) return self.execute_command(CMS_INCRBY, *params) def query(self, key, *items): @@ -487,7 +487,7 @@ def merge(self, destKey, numKeys, srcKeys, weights=[]): """ # noqa params = [destKey, numKeys] params += srcKeys - self.appendWeights(params, weights) + self.append_weights(params, weights) return self.execute_command(CMS_MERGE, *params) def info(self, key): diff --git a/redis/commands/graph/__init__.py b/redis/commands/graph/__init__.py index 7b9972ad9b..3736195007 100644 --- a/redis/commands/graph/__init__.py +++ b/redis/commands/graph/__init__.py @@ -22,7 +22,7 @@ def __init__(self, client, name=random_string()): self.edges = [] self._labels = [] # List of node labels. self._properties = [] # List of properties. - self._relationshipTypes = [] # List of relation types. + self._relationship_types = [] # List of relation types. self.version = 0 # Graph version @property @@ -32,7 +32,7 @@ def name(self): def _clear_schema(self): self._labels = [] self._properties = [] - self._relationshipTypes = [] + self._relationship_types = [] def _refresh_schema(self): self._clear_schema() @@ -49,15 +49,15 @@ def _refresh_labels(self): self._labels[i] = l[0] def _refresh_relations(self): - rels = self.relationshipTypes() + rels = self.relationship_types() # Unpack data. - self._relationshipTypes = [None] * len(rels) + self._relationship_types = [None] * len(rels) for i, r in enumerate(rels): - self._relationshipTypes[i] = r[0] + self._relationship_types[i] = r[0] def _refresh_attributes(self): - props = self.propertyKeys() + props = self.property_keys() # Unpack data. self._properties = [None] * len(props) @@ -91,11 +91,11 @@ def get_relation(self, idx): The index of the relation """ try: - relationship_type = self._relationshipTypes[idx] + relationship_type = self._relationship_types[idx] except IndexError: # Refresh relationship types. self._refresh_relations() - relationship_type = self._relationshipTypes[idx] + relationship_type = self._relationship_types[idx] return relationship_type def get_property(self, idx): @@ -155,8 +155,8 @@ def call_procedure(self, procedure, *args, read_only=False, **kwagrs): def labels(self): return self.call_procedure("db.labels", read_only=True).result_set - def relationshipTypes(self): + def relationship_types(self): return self.call_procedure("db.relationshipTypes", read_only=True).result_set - def propertyKeys(self): + def property_keys(self): return self.call_procedure("db.propertyKeys", read_only=True).result_set diff --git a/redis/commands/graph/edge.py b/redis/commands/graph/edge.py index b334293fb2..b0141d9452 100644 --- a/redis/commands/graph/edge.py +++ b/redis/commands/graph/edge.py @@ -22,7 +22,7 @@ def __init__(self, src_node, relation, dest_node, edge_id=None, properties=None) self.src_node = src_node self.dest_node = dest_node - def toString(self): + def to_string(self): res = "" if self.properties: props = ",".join( diff --git a/redis/commands/graph/node.py b/redis/commands/graph/node.py index 47e4eeb8e2..c5f842906b 100644 --- a/redis/commands/graph/node.py +++ b/redis/commands/graph/node.py @@ -37,7 +37,7 @@ def __init__(self, node_id=None, alias=None, label=None, properties=None): self.properties = properties or {} - def toString(self): + def to_string(self): res = "" if self.properties: props = ",".join( diff --git a/redis/commands/graph/query_result.py b/redis/commands/graph/query_result.py index e9d9f4d3fd..644ac5a3db 100644 --- a/redis/commands/graph/query_result.py +++ b/redis/commands/graph/query_result.py @@ -292,9 +292,9 @@ def parse_profile(self, response): # record = [] # for idx, cell in enumerate(row): # if type(cell) is Node: - # record.append(cell.toString()) + # record.append(cell.to_string()) # elif type(cell) is Edge: - # record.append(cell.toString()) + # record.append(cell.to_string()) # else: # record.append(cell) # tbl.add_row(record) diff --git a/redis/commands/helpers.py b/redis/commands/helpers.py index afb4f9fae8..2b873e3385 100644 --- a/redis/commands/helpers.py +++ b/redis/commands/helpers.py @@ -117,7 +117,7 @@ def quote_string(v): return f'"{v}"' -def decodeDictKeys(obj): +def decode_dict_keys(obj): """Decode the keys of the given dictionary with utf-8.""" newobj = copy.copy(obj) for k in obj.keys(): diff --git a/redis/commands/json/commands.py b/redis/commands/json/commands.py index a132b8ee8d..03ab0c4b8d 100644 --- a/redis/commands/json/commands.py +++ b/redis/commands/json/commands.py @@ -12,7 +12,7 @@ class JSONCommands: """json commands.""" - def arrappend(self, name, path=Path.rootPath(), *args): + def arrappend(self, name, path=Path.root_path(), *args): """Append the objects ``args`` to the array under the ``path` in key ``name``. @@ -48,7 +48,7 @@ def arrinsert(self, name, path, index, *args): pieces.append(self._encode(o)) return self.execute_command("JSON.ARRINSERT", *pieces) - def arrlen(self, name, path=Path.rootPath()): + def arrlen(self, name, path=Path.root_path()): """Return the length of the array JSON value under ``path`` at key``name``. @@ -56,7 +56,7 @@ def arrlen(self, name, path=Path.rootPath()): """ # noqa return self.execute_command("JSON.ARRLEN", name, str(path)) - def arrpop(self, name, path=Path.rootPath(), index=-1): + def arrpop(self, name, path=Path.root_path(), index=-1): """Pop the element at ``index`` in the array JSON value under ``path`` at key ``name``. @@ -72,21 +72,21 @@ def arrtrim(self, name, path, start, stop): """ # noqa return self.execute_command("JSON.ARRTRIM", name, str(path), start, stop) - def type(self, name, path=Path.rootPath()): + def type(self, name, path=Path.root_path()): """Get the type of the JSON value under ``path`` from key ``name``. For more information: https://oss.redis.com/redisjson/commands/#jsontype """ # noqa return self.execute_command("JSON.TYPE", name, str(path)) - def resp(self, name, path=Path.rootPath()): + def resp(self, name, path=Path.root_path()): """Return the JSON value under ``path`` at key ``name``. For more information: https://oss.redis.com/redisjson/commands/#jsonresp """ # noqa return self.execute_command("JSON.RESP", name, str(path)) - def objkeys(self, name, path=Path.rootPath()): + def objkeys(self, name, path=Path.root_path()): """Return the key names in the dictionary JSON value under ``path`` at key ``name``. @@ -94,7 +94,7 @@ def objkeys(self, name, path=Path.rootPath()): """ # noqa return self.execute_command("JSON.OBJKEYS", name, str(path)) - def objlen(self, name, path=Path.rootPath()): + def objlen(self, name, path=Path.root_path()): """Return the length of the dictionary JSON value under ``path`` at key ``name``. @@ -123,7 +123,7 @@ def nummultby(self, name, path, number): "JSON.NUMMULTBY", name, str(path), self._encode(number) ) - def clear(self, name, path=Path.rootPath()): + def clear(self, name, path=Path.root_path()): """ Empty arrays and objects (to have zero slots/keys without deleting the array/object). @@ -135,7 +135,7 @@ def clear(self, name, path=Path.rootPath()): """ # noqa return self.execute_command("JSON.CLEAR", name, str(path)) - def delete(self, key, path=Path.rootPath()): + def delete(self, key, path=Path.root_path()): """Delete the JSON value stored at key ``key`` under ``path``. For more information: https://oss.redis.com/redisjson/commands/#jsondel @@ -160,7 +160,7 @@ def get(self, name, *args, no_escape=False): pieces.append("noescape") if len(args) == 0: - pieces.append(Path.rootPath()) + pieces.append(Path.root_path()) else: for p in args: @@ -275,7 +275,7 @@ def strlen(self, name, path=None): pieces.append(str(path)) return self.execute_command("JSON.STRLEN", *pieces) - def toggle(self, name, path=Path.rootPath()): + def toggle(self, name, path=Path.root_path()): """Toggle boolean value under ``path`` at key ``name``. returning the new value. @@ -283,17 +283,17 @@ def toggle(self, name, path=Path.rootPath()): """ # noqa return self.execute_command("JSON.TOGGLE", name, str(path)) - def strappend(self, name, value, path=Path.rootPath()): + def strappend(self, name, value, path=Path.root_path()): """Append to the string JSON value. If two options are specified after the key name, the path is determined to be the first. If a single - option is passed, then the rootpath (i.e Path.rootPath()) is used. + option is passed, then the root_path (i.e Path.root_path()) is used. For more information: https://oss.redis.com/redisjson/commands/#jsonstrappend """ # noqa pieces = [name, str(path), self._encode(value)] return self.execute_command("JSON.STRAPPEND", *pieces) - def debug(self, subcommand, key=None, path=Path.rootPath()): + def debug(self, subcommand, key=None, path=Path.root_path()): """Return the memory usage in bytes of a value under ``path`` from key ``name``. diff --git a/redis/commands/json/path.py b/redis/commands/json/path.py index f0a413a00d..bfb0ab2db0 100644 --- a/redis/commands/json/path.py +++ b/redis/commands/json/path.py @@ -4,7 +4,7 @@ class Path: strPath = "" @staticmethod - def rootPath(): + def root_path(): """Return the root path's string representation.""" return "." diff --git a/redis/commands/search/commands.py b/redis/commands/search/commands.py index 3f768ab320..94edea168c 100644 --- a/redis/commands/search/commands.py +++ b/redis/commands/search/commands.py @@ -447,9 +447,9 @@ def aggregate(self, query): raise ValueError("Bad query", query) raw = self.execute_command(*cmd) - return self._get_AggregateResult(raw, query, has_cursor) + return self._get_aggregate_result(raw, query, has_cursor) - def _get_AggregateResult(self, raw, query, has_cursor): + def _get_aggregate_result(self, raw, query, has_cursor): if has_cursor: if isinstance(query, Cursor): query.cid = raw[1] @@ -499,7 +499,7 @@ def profile(self, query, limited=False): res = self.execute_command(*cmd) if isinstance(query, AggregateRequest): - result = self._get_AggregateResult(res[0], query, query._cursor) + result = self._get_aggregate_result(res[0], query, query._cursor) else: result = Result( res[0], diff --git a/redis/commands/search/indexDefinition.py b/redis/commands/search/indexDefinition.py index 0c7a3b0635..a668e85b42 100644 --- a/redis/commands/search/indexDefinition.py +++ b/redis/commands/search/indexDefinition.py @@ -24,14 +24,14 @@ def __init__( index_type=None, ): self.args = [] - self._appendIndexType(index_type) - self._appendPrefix(prefix) - self._appendFilter(filter) - self._appendLanguage(language_field, language) - self._appendScore(score_field, score) - self._appendPayload(payload_field) + self._append_index_type(index_type) + self._append_prefix(prefix) + self._append_filter(filter) + self._append_language(language_field, language) + self._append_score(score_field, score) + self._append_payload(payload_field) - def _appendIndexType(self, index_type): + def _append_index_type(self, index_type): """Append `ON HASH` or `ON JSON` according to the enum.""" if index_type is IndexType.HASH: self.args.extend(["ON", "HASH"]) @@ -40,7 +40,7 @@ def _appendIndexType(self, index_type): elif index_type is not None: raise RuntimeError(f"index_type must be one of {list(IndexType)}") - def _appendPrefix(self, prefix): + def _append_prefix(self, prefix): """Append PREFIX.""" if len(prefix) > 0: self.args.append("PREFIX") @@ -48,13 +48,13 @@ def _appendPrefix(self, prefix): for p in prefix: self.args.append(p) - def _appendFilter(self, filter): + def _append_filter(self, filter): """Append FILTER.""" if filter is not None: self.args.append("FILTER") self.args.append(filter) - def _appendLanguage(self, language_field, language): + def _append_language(self, language_field, language): """Append LANGUAGE_FIELD and LANGUAGE.""" if language_field is not None: self.args.append("LANGUAGE_FIELD") @@ -63,7 +63,7 @@ def _appendLanguage(self, language_field, language): self.args.append("LANGUAGE") self.args.append(language) - def _appendScore(self, score_field, score): + def _append_score(self, score_field, score): """Append SCORE_FIELD and SCORE.""" if score_field is not None: self.args.append("SCORE_FIELD") @@ -72,7 +72,7 @@ def _appendScore(self, score_field, score): self.args.append("SCORE") self.args.append(score) - def _appendPayload(self, payload_field): + def _append_payload(self, payload_field): """Append PAYLOAD_FIELD.""" if payload_field is not None: self.args.append("PAYLOAD_FIELD") diff --git a/redis/commands/timeseries/commands.py b/redis/commands/timeseries/commands.py index c86e0b98b7..3a30c246d5 100644 --- a/redis/commands/timeseries/commands.py +++ b/redis/commands/timeseries/commands.py @@ -66,11 +66,11 @@ def create(self, key, **kwargs): chunk_size = kwargs.get("chunk_size", None) duplicate_policy = kwargs.get("duplicate_policy", None) params = [key] - self._appendRetention(params, retention_msecs) - self._appendUncompressed(params, uncompressed) - self._appendChunkSize(params, chunk_size) - self._appendDuplicatePolicy(params, CREATE_CMD, duplicate_policy) - self._appendLabels(params, labels) + self._append_retention(params, retention_msecs) + self._append_uncompressed(params, uncompressed) + self._append_chunk_size(params, chunk_size) + self._append_duplicate_policy(params, CREATE_CMD, duplicate_policy) + self._append_labels(params, labels) return self.execute_command(CREATE_CMD, *params) @@ -87,9 +87,9 @@ def alter(self, key, **kwargs): labels = kwargs.get("labels", {}) duplicate_policy = kwargs.get("duplicate_policy", None) params = [key] - self._appendRetention(params, retention_msecs) - self._appendDuplicatePolicy(params, ALTER_CMD, duplicate_policy) - self._appendLabels(params, labels) + self._append_retention(params, retention_msecs) + self._append_duplicate_policy(params, ALTER_CMD, duplicate_policy) + self._append_labels(params, labels) return self.execute_command(ALTER_CMD, *params) @@ -137,11 +137,11 @@ def add(self, key, timestamp, value, **kwargs): chunk_size = kwargs.get("chunk_size", None) duplicate_policy = kwargs.get("duplicate_policy", None) params = [key, timestamp, value] - self._appendRetention(params, retention_msecs) - self._appendUncompressed(params, uncompressed) - self._appendChunkSize(params, chunk_size) - self._appendDuplicatePolicy(params, ADD_CMD, duplicate_policy) - self._appendLabels(params, labels) + self._append_retention(params, retention_msecs) + self._append_uncompressed(params, uncompressed) + self._append_chunk_size(params, chunk_size) + self._append_duplicate_policy(params, ADD_CMD, duplicate_policy) + self._append_labels(params, labels) return self.execute_command(ADD_CMD, *params) @@ -197,11 +197,11 @@ def incrby(self, key, value, **kwargs): labels = kwargs.get("labels", {}) chunk_size = kwargs.get("chunk_size", None) params = [key, value] - self._appendTimestamp(params, timestamp) - self._appendRetention(params, retention_msecs) - self._appendUncompressed(params, uncompressed) - self._appendChunkSize(params, chunk_size) - self._appendLabels(params, labels) + self._append_timestamp(params, timestamp) + self._append_retention(params, retention_msecs) + self._append_uncompressed(params, uncompressed) + self._append_chunk_size(params, chunk_size) + self._append_labels(params, labels) return self.execute_command(INCRBY_CMD, *params) @@ -245,11 +245,11 @@ def decrby(self, key, value, **kwargs): labels = kwargs.get("labels", {}) chunk_size = kwargs.get("chunk_size", None) params = [key, value] - self._appendTimestamp(params, timestamp) - self._appendRetention(params, retention_msecs) - self._appendUncompressed(params, uncompressed) - self._appendChunkSize(params, chunk_size) - self._appendLabels(params, labels) + self._append_timestamp(params, timestamp) + self._append_retention(params, retention_msecs) + self._append_uncompressed(params, uncompressed) + self._append_chunk_size(params, chunk_size) + self._append_labels(params, labels) return self.execute_command(DECRBY_CMD, *params) @@ -285,7 +285,7 @@ def createrule(self, source_key, dest_key, aggregation_type, bucket_size_msec): For more information: https://oss.redis.com/redistimeseries/master/commands/#tscreaterule """ # noqa params = [source_key, dest_key] - self._appendAggregation(params, aggregation_type, bucket_size_msec) + self._append_aggregation(params, aggregation_type, bucket_size_msec) return self.execute_command(CREATERULE_CMD, *params) @@ -313,11 +313,11 @@ def __range_params( ): """Create TS.RANGE and TS.REVRANGE arguments.""" params = [key, from_time, to_time] - self._appendFilerByTs(params, filter_by_ts) - self._appendFilerByValue(params, filter_by_min_value, filter_by_max_value) - self._appendCount(params, count) - self._appendAlign(params, align) - self._appendAggregation(params, aggregation_type, bucket_size_msec) + self._append_filer_by_ts(params, filter_by_ts) + self._append_filer_by_value(params, filter_by_min_value, filter_by_max_value) + self._append_count(params, count) + self._append_align(params, align) + self._append_aggregation(params, aggregation_type, bucket_size_msec) return params @@ -459,15 +459,15 @@ def __mrange_params( ): """Create TS.MRANGE and TS.MREVRANGE arguments.""" params = [from_time, to_time] - self._appendFilerByTs(params, filter_by_ts) - self._appendFilerByValue(params, filter_by_min_value, filter_by_max_value) - self._appendCount(params, count) - self._appendAlign(params, align) - self._appendAggregation(params, aggregation_type, bucket_size_msec) - self._appendWithLabels(params, with_labels, select_labels) + self._append_filer_by_ts(params, filter_by_ts) + self._append_filer_by_value(params, filter_by_min_value, filter_by_max_value) + self._append_count(params, count) + self._append_align(params, align) + self._append_aggregation(params, aggregation_type, bucket_size_msec) + self._append_with_labels(params, with_labels, select_labels) params.extend(["FILTER"]) params += filters - self._appendGroupbyReduce(params, groupby, reduce) + self._append_groupby_reduce(params, groupby, reduce) return params def mrange( @@ -653,7 +653,7 @@ def mget(self, filters, with_labels=False): For more information: https://oss.redis.com/redistimeseries/master/commands/#tsmget """ # noqa params = [] - self._appendWithLabels(params, with_labels) + self._append_with_labels(params, with_labels) params.extend(["FILTER"]) params += filters return self.execute_command(MGET_CMD, *params) @@ -675,13 +675,13 @@ def queryindex(self, filters): return self.execute_command(QUERYINDEX_CMD, *filters) @staticmethod - def _appendUncompressed(params, uncompressed): + def _append_uncompressed(params, uncompressed): """Append UNCOMPRESSED tag to params.""" if uncompressed: params.extend(["UNCOMPRESSED"]) @staticmethod - def _appendWithLabels(params, with_labels, select_labels=None): + def _append_with_labels(params, with_labels, select_labels=None): """Append labels behavior to params.""" if with_labels and select_labels: raise DataError( @@ -694,19 +694,19 @@ def _appendWithLabels(params, with_labels, select_labels=None): params.extend(["SELECTED_LABELS", *select_labels]) @staticmethod - def _appendGroupbyReduce(params, groupby, reduce): + def _append_groupby_reduce(params, groupby, reduce): """Append GROUPBY REDUCE property to params.""" if groupby is not None and reduce is not None: params.extend(["GROUPBY", groupby, "REDUCE", reduce.upper()]) @staticmethod - def _appendRetention(params, retention): + def _append_retention(params, retention): """Append RETENTION property to params.""" if retention is not None: params.extend(["RETENTION", retention]) @staticmethod - def _appendLabels(params, labels): + def _append_labels(params, labels): """Append LABELS property to params.""" if labels: params.append("LABELS") @@ -714,38 +714,38 @@ def _appendLabels(params, labels): params.extend([k, v]) @staticmethod - def _appendCount(params, count): + def _append_count(params, count): """Append COUNT property to params.""" if count is not None: params.extend(["COUNT", count]) @staticmethod - def _appendTimestamp(params, timestamp): + def _append_timestamp(params, timestamp): """Append TIMESTAMP property to params.""" if timestamp is not None: params.extend(["TIMESTAMP", timestamp]) @staticmethod - def _appendAlign(params, align): + def _append_align(params, align): """Append ALIGN property to params.""" if align is not None: params.extend(["ALIGN", align]) @staticmethod - def _appendAggregation(params, aggregation_type, bucket_size_msec): + def _append_aggregation(params, aggregation_type, bucket_size_msec): """Append AGGREGATION property to params.""" if aggregation_type is not None: params.append("AGGREGATION") params.extend([aggregation_type, bucket_size_msec]) @staticmethod - def _appendChunkSize(params, chunk_size): + def _append_chunk_size(params, chunk_size): """Append CHUNK_SIZE property to params.""" if chunk_size is not None: params.extend(["CHUNK_SIZE", chunk_size]) @staticmethod - def _appendDuplicatePolicy(params, command, duplicate_policy): + def _append_duplicate_policy(params, command, duplicate_policy): """Append DUPLICATE_POLICY property to params on CREATE and ON_DUPLICATE on ADD. """ @@ -756,13 +756,13 @@ def _appendDuplicatePolicy(params, command, duplicate_policy): params.extend(["DUPLICATE_POLICY", duplicate_policy]) @staticmethod - def _appendFilerByTs(params, ts_list): + def _append_filer_by_ts(params, ts_list): """Append FILTER_BY_TS property to params.""" if ts_list is not None: params.extend(["FILTER_BY_TS", *ts_list]) @staticmethod - def _appendFilerByValue(params, min_value, max_value): + def _append_filer_by_value(params, min_value, max_value): """Append FILTER_BY_VALUE property to params.""" if min_value is not None and max_value is not None: params.extend(["FILTER_BY_VALUE", min_value, max_value]) diff --git a/tests/test_graph.py b/tests/test_graph.py index c6dc9a4371..2125d4a2fc 100644 --- a/tests/test_graph.py +++ b/tests/test_graph.py @@ -440,13 +440,13 @@ def test_cache_sync(client): assert len(A._labels) == 2 assert len(A._properties) == 2 - assert len(A._relationshipTypes) == 2 + assert len(A._relationship_types) == 2 assert A._labels[0] == "L" assert A._labels[1] == "K" assert A._properties[0] == "x" assert A._properties[1] == "q" - assert A._relationshipTypes[0] == "R" - assert A._relationshipTypes[1] == "S" + assert A._relationship_types[0] == "R" + assert A._relationship_types[1] == "S" # Have client B reconstruct the graph in a different order. B.delete() @@ -468,10 +468,10 @@ def test_cache_sync(client): assert len(A._labels) == 2 assert len(A._properties) == 2 - assert len(A._relationshipTypes) == 2 + assert len(A._relationship_types) == 2 assert A._labels[0] == "K" assert A._labels[1] == "L" assert A._properties[0] == "q" assert A._properties[1] == "x" - assert A._relationshipTypes[0] == "S" - assert A._relationshipTypes[1] == "R" + assert A._relationship_types[0] == "S" + assert A._relationship_types[1] == "R" diff --git a/tests/test_graph_utils/test_edge.py b/tests/test_graph_utils/test_edge.py index 42358de19a..b5b7362389 100644 --- a/tests/test_graph_utils/test_edge.py +++ b/tests/test_graph_utils/test_edge.py @@ -17,15 +17,15 @@ def test_init(): @pytest.mark.redismod -def test_toString(): +def test_to_string(): props_result = edge.Edge( node.Node(), None, node.Node(), properties={"a": "a", "b": 10} - ).toString() + ).to_string() assert props_result == '{a:"a",b:10}' no_props_result = edge.Edge( node.Node(), None, node.Node(), properties={} - ).toString() + ).to_string() assert no_props_result == "" diff --git a/tests/test_graph_utils/test_node.py b/tests/test_graph_utils/test_node.py index faf8ab6458..cd4e936719 100644 --- a/tests/test_graph_utils/test_node.py +++ b/tests/test_graph_utils/test_node.py @@ -14,13 +14,13 @@ def fixture(): @pytest.mark.redismod -def test_toString(fixture): +def test_to_string(fixture): no_args, no_props, props_only, no_label, multi_label = fixture - assert no_args.toString() == "" - assert no_props.toString() == "" - assert props_only.toString() == '{a:"a",b:10}' - assert no_label.toString() == '{a:"a"}' - assert multi_label.toString() == "" + assert no_args.to_string() == "" + assert no_props.to_string() == "" + assert props_only.to_string() == '{a:"a",b:10}' + assert no_label.to_string() == '{a:"a"}' + assert multi_label.to_string() == "" @pytest.mark.redismod diff --git a/tests/test_json.py b/tests/test_json.py index 21bdc08b5e..3d9b67841f 100644 --- a/tests/test_json.py +++ b/tests/test_json.py @@ -18,13 +18,13 @@ def client(modclient): def test_json_setbinarykey(client): d = {"hello": "world", b"some": "value"} with pytest.raises(TypeError): - client.json().set("somekey", Path.rootPath(), d) - assert client.json().set("somekey", Path.rootPath(), d, decode_keys=True) + client.json().set("somekey", Path.root_path(), d) + assert client.json().set("somekey", Path.root_path(), d, decode_keys=True) @pytest.mark.redismod def test_json_setgetdeleteforget(client): - assert client.json().set("foo", Path.rootPath(), "bar") + assert client.json().set("foo", Path.root_path(), "bar") assert client.json().get("foo") == "bar" assert client.json().get("baz") is None assert client.json().delete("foo") == 1 @@ -34,13 +34,13 @@ def test_json_setgetdeleteforget(client): @pytest.mark.redismod def test_jsonget(client): - client.json().set("foo", Path.rootPath(), "bar") + client.json().set("foo", Path.root_path(), "bar") assert client.json().get("foo") == "bar" @pytest.mark.redismod def test_json_get_jset(client): - assert client.json().set("foo", Path.rootPath(), "bar") + assert client.json().set("foo", Path.root_path(), "bar") assert "bar" == client.json().get("foo") assert client.json().get("baz") is None assert 1 == client.json().delete("foo") @@ -49,7 +49,7 @@ def test_json_get_jset(client): @pytest.mark.redismod def test_nonascii_setgetdelete(client): - assert client.json().set("notascii", Path.rootPath(), "hyvää-élève") + assert client.json().set("notascii", Path.root_path(), "hyvää-élève") assert "hyvää-élève" == client.json().get("notascii", no_escape=True) assert 1 == client.json().delete("notascii") assert client.exists("notascii") == 0 @@ -58,7 +58,7 @@ def test_nonascii_setgetdelete(client): @pytest.mark.redismod def test_jsonsetexistentialmodifiersshouldsucceed(client): obj = {"foo": "bar"} - assert client.json().set("obj", Path.rootPath(), obj) + assert client.json().set("obj", Path.root_path(), obj) # Test that flags prevent updates when conditions are unmet assert client.json().set("obj", Path("foo"), "baz", nx=True) is None @@ -75,69 +75,69 @@ def test_jsonsetexistentialmodifiersshouldsucceed(client): @pytest.mark.redismod def test_mgetshouldsucceed(client): - client.json().set("1", Path.rootPath(), 1) - client.json().set("2", Path.rootPath(), 2) - assert client.json().mget(["1"], Path.rootPath()) == [1] + client.json().set("1", Path.root_path(), 1) + client.json().set("2", Path.root_path(), 2) + assert client.json().mget(["1"], Path.root_path()) == [1] - assert client.json().mget([1, 2], Path.rootPath()) == [1, 2] + assert client.json().mget([1, 2], Path.root_path()) == [1, 2] @pytest.mark.redismod @skip_ifmodversion_lt("99.99.99", "ReJSON") # todo: update after the release def test_clear(client): - client.json().set("arr", Path.rootPath(), [0, 1, 2, 3, 4]) - assert 1 == client.json().clear("arr", Path.rootPath()) + client.json().set("arr", Path.root_path(), [0, 1, 2, 3, 4]) + assert 1 == client.json().clear("arr", Path.root_path()) assert [] == client.json().get("arr") @pytest.mark.redismod def test_type(client): - client.json().set("1", Path.rootPath(), 1) - assert "integer" == client.json().type("1", Path.rootPath()) + client.json().set("1", Path.root_path(), 1) + assert "integer" == client.json().type("1", Path.root_path()) assert "integer" == client.json().type("1") @pytest.mark.redismod def test_numincrby(client): - client.json().set("num", Path.rootPath(), 1) - assert 2 == client.json().numincrby("num", Path.rootPath(), 1) - assert 2.5 == client.json().numincrby("num", Path.rootPath(), 0.5) - assert 1.25 == client.json().numincrby("num", Path.rootPath(), -1.25) + client.json().set("num", Path.root_path(), 1) + assert 2 == client.json().numincrby("num", Path.root_path(), 1) + assert 2.5 == client.json().numincrby("num", Path.root_path(), 0.5) + assert 1.25 == client.json().numincrby("num", Path.root_path(), -1.25) @pytest.mark.redismod def test_nummultby(client): - client.json().set("num", Path.rootPath(), 1) + client.json().set("num", Path.root_path(), 1) with pytest.deprecated_call(): - assert 2 == client.json().nummultby("num", Path.rootPath(), 2) - assert 5 == client.json().nummultby("num", Path.rootPath(), 2.5) - assert 2.5 == client.json().nummultby("num", Path.rootPath(), 0.5) + assert 2 == client.json().nummultby("num", Path.root_path(), 2) + assert 5 == client.json().nummultby("num", Path.root_path(), 2.5) + assert 2.5 == client.json().nummultby("num", Path.root_path(), 0.5) @pytest.mark.redismod @skip_ifmodversion_lt("99.99.99", "ReJSON") # todo: update after the release def test_toggle(client): - client.json().set("bool", Path.rootPath(), False) - assert client.json().toggle("bool", Path.rootPath()) - assert client.json().toggle("bool", Path.rootPath()) is False + client.json().set("bool", Path.root_path(), False) + assert client.json().toggle("bool", Path.root_path()) + assert client.json().toggle("bool", Path.root_path()) is False # check non-boolean value - client.json().set("num", Path.rootPath(), 1) + client.json().set("num", Path.root_path(), 1) with pytest.raises(redis.exceptions.ResponseError): - client.json().toggle("num", Path.rootPath()) + client.json().toggle("num", Path.root_path()) @pytest.mark.redismod def test_strappend(client): - client.json().set("jsonkey", Path.rootPath(), "foo") + client.json().set("jsonkey", Path.root_path(), "foo") assert 6 == client.json().strappend("jsonkey", "bar") - assert "foobar" == client.json().get("jsonkey", Path.rootPath()) + assert "foobar" == client.json().get("jsonkey", Path.root_path()) # @pytest.mark.redismod # def test_debug(client): -# client.json().set("str", Path.rootPath(), "foo") -# assert 24 == client.json().debug("MEMORY", "str", Path.rootPath()) +# client.json().set("str", Path.root_path(), "foo") +# assert 24 == client.json().debug("MEMORY", "str", Path.root_path()) # assert 24 == client.json().debug("MEMORY", "str") # # # technically help is valid @@ -146,34 +146,34 @@ def test_strappend(client): @pytest.mark.redismod def test_strlen(client): - client.json().set("str", Path.rootPath(), "foo") - assert 3 == client.json().strlen("str", Path.rootPath()) - client.json().strappend("str", "bar", Path.rootPath()) - assert 6 == client.json().strlen("str", Path.rootPath()) + client.json().set("str", Path.root_path(), "foo") + assert 3 == client.json().strlen("str", Path.root_path()) + client.json().strappend("str", "bar", Path.root_path()) + assert 6 == client.json().strlen("str", Path.root_path()) assert 6 == client.json().strlen("str") @pytest.mark.redismod def test_arrappend(client): - client.json().set("arr", Path.rootPath(), [1]) - assert 2 == client.json().arrappend("arr", Path.rootPath(), 2) - assert 4 == client.json().arrappend("arr", Path.rootPath(), 3, 4) - assert 7 == client.json().arrappend("arr", Path.rootPath(), *[5, 6, 7]) + client.json().set("arr", Path.root_path(), [1]) + assert 2 == client.json().arrappend("arr", Path.root_path(), 2) + assert 4 == client.json().arrappend("arr", Path.root_path(), 3, 4) + assert 7 == client.json().arrappend("arr", Path.root_path(), *[5, 6, 7]) @pytest.mark.redismod def test_arrindex(client): - client.json().set("arr", Path.rootPath(), [0, 1, 2, 3, 4]) - assert 1 == client.json().arrindex("arr", Path.rootPath(), 1) - assert -1 == client.json().arrindex("arr", Path.rootPath(), 1, 2) + client.json().set("arr", Path.root_path(), [0, 1, 2, 3, 4]) + assert 1 == client.json().arrindex("arr", Path.root_path(), 1) + assert -1 == client.json().arrindex("arr", Path.root_path(), 1, 2) @pytest.mark.redismod def test_arrinsert(client): - client.json().set("arr", Path.rootPath(), [0, 4]) + client.json().set("arr", Path.root_path(), [0, 4]) assert 5 - -client.json().arrinsert( "arr", - Path.rootPath(), + Path.root_path(), 1, *[ 1, @@ -184,64 +184,64 @@ def test_arrinsert(client): assert [0, 1, 2, 3, 4] == client.json().get("arr") # test prepends - client.json().set("val2", Path.rootPath(), [5, 6, 7, 8, 9]) - client.json().arrinsert("val2", Path.rootPath(), 0, ["some", "thing"]) + client.json().set("val2", Path.root_path(), [5, 6, 7, 8, 9]) + client.json().arrinsert("val2", Path.root_path(), 0, ["some", "thing"]) assert client.json().get("val2") == [["some", "thing"], 5, 6, 7, 8, 9] @pytest.mark.redismod def test_arrlen(client): - client.json().set("arr", Path.rootPath(), [0, 1, 2, 3, 4]) - assert 5 == client.json().arrlen("arr", Path.rootPath()) + client.json().set("arr", Path.root_path(), [0, 1, 2, 3, 4]) + assert 5 == client.json().arrlen("arr", Path.root_path()) assert 5 == client.json().arrlen("arr") assert client.json().arrlen("fakekey") is None @pytest.mark.redismod def test_arrpop(client): - client.json().set("arr", Path.rootPath(), [0, 1, 2, 3, 4]) - assert 4 == client.json().arrpop("arr", Path.rootPath(), 4) - assert 3 == client.json().arrpop("arr", Path.rootPath(), -1) - assert 2 == client.json().arrpop("arr", Path.rootPath()) - assert 0 == client.json().arrpop("arr", Path.rootPath(), 0) + client.json().set("arr", Path.root_path(), [0, 1, 2, 3, 4]) + assert 4 == client.json().arrpop("arr", Path.root_path(), 4) + assert 3 == client.json().arrpop("arr", Path.root_path(), -1) + assert 2 == client.json().arrpop("arr", Path.root_path()) + assert 0 == client.json().arrpop("arr", Path.root_path(), 0) assert [1] == client.json().get("arr") # test out of bounds - client.json().set("arr", Path.rootPath(), [0, 1, 2, 3, 4]) - assert 4 == client.json().arrpop("arr", Path.rootPath(), 99) + client.json().set("arr", Path.root_path(), [0, 1, 2, 3, 4]) + assert 4 == client.json().arrpop("arr", Path.root_path(), 99) # none test - client.json().set("arr", Path.rootPath(), []) + client.json().set("arr", Path.root_path(), []) assert client.json().arrpop("arr") is None @pytest.mark.redismod def test_arrtrim(client): - client.json().set("arr", Path.rootPath(), [0, 1, 2, 3, 4]) - assert 3 == client.json().arrtrim("arr", Path.rootPath(), 1, 3) + client.json().set("arr", Path.root_path(), [0, 1, 2, 3, 4]) + assert 3 == client.json().arrtrim("arr", Path.root_path(), 1, 3) assert [1, 2, 3] == client.json().get("arr") # <0 test, should be 0 equivalent - client.json().set("arr", Path.rootPath(), [0, 1, 2, 3, 4]) - assert 0 == client.json().arrtrim("arr", Path.rootPath(), -1, 3) + client.json().set("arr", Path.root_path(), [0, 1, 2, 3, 4]) + assert 0 == client.json().arrtrim("arr", Path.root_path(), -1, 3) # testing stop > end - client.json().set("arr", Path.rootPath(), [0, 1, 2, 3, 4]) - assert 2 == client.json().arrtrim("arr", Path.rootPath(), 3, 99) + client.json().set("arr", Path.root_path(), [0, 1, 2, 3, 4]) + assert 2 == client.json().arrtrim("arr", Path.root_path(), 3, 99) # start > array size and stop - client.json().set("arr", Path.rootPath(), [0, 1, 2, 3, 4]) - assert 0 == client.json().arrtrim("arr", Path.rootPath(), 9, 1) + client.json().set("arr", Path.root_path(), [0, 1, 2, 3, 4]) + assert 0 == client.json().arrtrim("arr", Path.root_path(), 9, 1) # all larger - client.json().set("arr", Path.rootPath(), [0, 1, 2, 3, 4]) - assert 0 == client.json().arrtrim("arr", Path.rootPath(), 9, 11) + client.json().set("arr", Path.root_path(), [0, 1, 2, 3, 4]) + assert 0 == client.json().arrtrim("arr", Path.root_path(), 9, 11) @pytest.mark.redismod def test_resp(client): obj = {"foo": "bar", "baz": 1, "qaz": True} - client.json().set("obj", Path.rootPath(), obj) + client.json().set("obj", Path.root_path(), obj) assert "bar" == client.json().resp("obj", Path("foo")) assert 1 == client.json().resp("obj", Path("baz")) assert client.json().resp("obj", Path("qaz")) @@ -251,14 +251,14 @@ def test_resp(client): @pytest.mark.redismod def test_objkeys(client): obj = {"foo": "bar", "baz": "qaz"} - client.json().set("obj", Path.rootPath(), obj) - keys = client.json().objkeys("obj", Path.rootPath()) + client.json().set("obj", Path.root_path(), obj) + keys = client.json().objkeys("obj", Path.root_path()) keys.sort() exp = list(obj.keys()) exp.sort() assert exp == keys - client.json().set("obj", Path.rootPath(), obj) + client.json().set("obj", Path.root_path(), obj) keys = client.json().objkeys("obj") assert keys == list(obj.keys()) @@ -268,17 +268,17 @@ def test_objkeys(client): @pytest.mark.redismod def test_objlen(client): obj = {"foo": "bar", "baz": "qaz"} - client.json().set("obj", Path.rootPath(), obj) - assert len(obj) == client.json().objlen("obj", Path.rootPath()) + client.json().set("obj", Path.root_path(), obj) + assert len(obj) == client.json().objlen("obj", Path.root_path()) - client.json().set("obj", Path.rootPath(), obj) + client.json().set("obj", Path.root_path(), obj) assert len(obj) == client.json().objlen("obj") @pytest.mark.redismod def test_json_commands_in_pipeline(client): p = client.json().pipeline() - p.set("foo", Path.rootPath(), "bar") + p.set("foo", Path.root_path(), "bar") p.get("foo") p.delete("foo") assert [True, "bar", 1] == p.execute() @@ -290,7 +290,7 @@ def test_json_commands_in_pipeline(client): p = client.json().pipeline() d = {"hello": "world", "oh": "snap"} with pytest.deprecated_call(): - p.jsonset("foo", Path.rootPath(), d) + p.jsonset("foo", Path.root_path(), d) p.jsonget("foo") p.exists("notarealkey") p.delete("foo") @@ -1385,7 +1385,7 @@ def test_custom_decoder(client): import ujson cj = client.json(encoder=ujson, decoder=ujson) - assert cj.set("foo", Path.rootPath(), "bar") + assert cj.set("foo", Path.root_path(), "bar") assert "bar" == cj.get("foo") assert cj.get("baz") is None assert 1 == cj.delete("foo") @@ -1407,10 +1407,10 @@ def test_set_file(client): nojsonfile = tempfile.NamedTemporaryFile() nojsonfile.write(b"Hello World") - assert client.json().set_file("test", Path.rootPath(), jsonfile.name) + assert client.json().set_file("test", Path.root_path(), jsonfile.name) assert client.json().get("test") == obj with pytest.raises(json.JSONDecodeError): - client.json().set_file("test2", Path.rootPath(), nojsonfile.name) + client.json().set_file("test2", Path.root_path(), nojsonfile.name) @pytest.mark.redismod @@ -1428,5 +1428,5 @@ def test_set_path(client): open(nojsonfile, "a+").write("hello") result = {jsonfile: True, nojsonfile: False} - assert client.json().set_path(Path.rootPath(), root) == result + assert client.json().set_path(Path.root_path(), root) == result assert client.json().get(jsonfile.rsplit(".")[0]) == {"hello": "world"} diff --git a/tests/test_search.py b/tests/test_search.py index 6c79041cfe..18bb9adecf 100644 --- a/tests/test_search.py +++ b/tests/test_search.py @@ -1266,8 +1266,8 @@ def test_create_client_definition_json(client): definition = IndexDefinition(prefix=["king:"], index_type=IndexType.JSON) client.ft().create_index((TextField("$.name"),), definition=definition) - client.json().set("king:1", Path.rootPath(), {"name": "henry"}) - client.json().set("king:2", Path.rootPath(), {"name": "james"}) + client.json().set("king:1", Path.root_path(), {"name": "henry"}) + client.json().set("king:2", Path.root_path(), {"name": "james"}) res = client.ft().search("henry") assert res.docs[0].id == "king:1" @@ -1288,7 +1288,7 @@ def test_fields_as_name(client): client.ft().create_index(SCHEMA, definition=definition) # insert json data - res = client.json().set("doc:1", Path.rootPath(), {"name": "Jon", "age": 25}) + res = client.json().set("doc:1", Path.root_path(), {"name": "Jon", "age": 25}) assert res total = client.ft().search(Query("Jon").return_fields("name", "just_a_number")).docs @@ -1303,7 +1303,7 @@ def test_fields_as_name(client): def test_search_return_fields(client): res = client.json().set( "doc:1", - Path.rootPath(), + Path.root_path(), {"t": "riceratops", "t2": "telmatosaurus", "n": 9072, "flt": 97.2}, ) assert res @@ -1389,8 +1389,8 @@ def test_create_json_with_alias(client): definition=definition, ) - client.json().set("king:1", Path.rootPath(), {"name": "henry", "num": 42}) - client.json().set("king:2", Path.rootPath(), {"name": "james", "num": 3.14}) + client.json().set("king:1", Path.root_path(), {"name": "henry", "num": 42}) + client.json().set("king:2", Path.root_path(), {"name": "james", "num": 3.14}) res = client.ft().search("@name:henry") assert res.docs[0].id == "king:1" @@ -1421,7 +1421,7 @@ def test_json_with_multipath(client): ) client.json().set( - "king:1", Path.rootPath(), {"name": "henry", "country": {"name": "england"}} + "king:1", Path.root_path(), {"name": "henry", "country": {"name": "england"}} ) res = client.ft().search("@name:{henry}") @@ -1447,7 +1447,7 @@ def test_json_with_jsonpath(client): definition=definition, ) - client.json().set("doc:1", Path.rootPath(), {"prod:name": "RediSearch"}) + client.json().set("doc:1", Path.root_path(), {"prod:name": "RediSearch"}) # query for a supported field succeeds res = client.ft().search(Query("@name:RediSearch")) From 57592f9820554976fff9c6a200841437333bc695 Mon Sep 17 00:00:00 2001 From: dvora-h Date: Wed, 2 Feb 2022 17:02:38 +0200 Subject: [PATCH 25/25] change ports to resolve conflict with unstable_cluster --- docker/redis4/master/redis.conf | 2 +- docker/redis4/sentinel/sentinel_1.conf | 2 +- docker/redis4/sentinel/sentinel_2.conf | 2 +- docker/redis4/sentinel/sentinel_3.conf | 2 +- docker/redis5/master/redis.conf | 2 +- docker/redis5/replica/redis.conf | 4 ++-- docker/redis5/sentinel/sentinel_1.conf | 2 +- docker/redis5/sentinel/sentinel_2.conf | 2 +- docker/redis5/sentinel/sentinel_3.conf | 2 +- tox.ini | 12 ++++++------ 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/docker/redis4/master/redis.conf b/docker/redis4/master/redis.conf index eb304b1685..b7ed0ebf00 100644 --- a/docker/redis4/master/redis.conf +++ b/docker/redis4/master/redis.conf @@ -1,2 +1,2 @@ -port 6376 +port 6381 save "" diff --git a/docker/redis4/sentinel/sentinel_1.conf b/docker/redis4/sentinel/sentinel_1.conf index c0adf379b2..cfee17c051 100644 --- a/docker/redis4/sentinel/sentinel_1.conf +++ b/docker/redis4/sentinel/sentinel_1.conf @@ -1,6 +1,6 @@ port 26385 -sentinel monitor redis-py-test 127.0.0.1 6376 2 +sentinel monitor redis-py-test 127.0.0.1 6381 2 sentinel down-after-milliseconds redis-py-test 5000 sentinel failover-timeout redis-py-test 60000 sentinel parallel-syncs redis-py-test 1 diff --git a/docker/redis4/sentinel/sentinel_2.conf b/docker/redis4/sentinel/sentinel_2.conf index 6652630236..68d930aea8 100644 --- a/docker/redis4/sentinel/sentinel_2.conf +++ b/docker/redis4/sentinel/sentinel_2.conf @@ -1,6 +1,6 @@ port 26386 -sentinel monitor redis-py-test 127.0.0.1 6376 2 +sentinel monitor redis-py-test 127.0.0.1 6381 2 sentinel down-after-milliseconds redis-py-test 5000 sentinel failover-timeout redis-py-test 60000 sentinel parallel-syncs redis-py-test 1 \ No newline at end of file diff --git a/docker/redis4/sentinel/sentinel_3.conf b/docker/redis4/sentinel/sentinel_3.conf index f835f6a773..60abf65c9b 100644 --- a/docker/redis4/sentinel/sentinel_3.conf +++ b/docker/redis4/sentinel/sentinel_3.conf @@ -1,6 +1,6 @@ port 26387 -sentinel monitor redis-py-test 127.0.0.1 6376 2 +sentinel monitor redis-py-test 127.0.0.1 6381 2 sentinel down-after-milliseconds redis-py-test 5000 sentinel failover-timeout redis-py-test 60000 sentinel parallel-syncs redis-py-test 1 \ No newline at end of file diff --git a/docker/redis5/master/redis.conf b/docker/redis5/master/redis.conf index aa369e8a35..e479c48b28 100644 --- a/docker/redis5/master/redis.conf +++ b/docker/redis5/master/redis.conf @@ -1,2 +1,2 @@ -port 6377 +port 6382 save "" diff --git a/docker/redis5/replica/redis.conf b/docker/redis5/replica/redis.conf index d59148025c..a2dc9e0945 100644 --- a/docker/redis5/replica/redis.conf +++ b/docker/redis5/replica/redis.conf @@ -1,3 +1,3 @@ -port 6375 +port 6383 save "" -replicaof master 6377 +replicaof master 6382 diff --git a/docker/redis5/sentinel/sentinel_1.conf b/docker/redis5/sentinel/sentinel_1.conf index 93c3ac67f7..c748a0ba72 100644 --- a/docker/redis5/sentinel/sentinel_1.conf +++ b/docker/redis5/sentinel/sentinel_1.conf @@ -1,6 +1,6 @@ port 26382 -sentinel monitor redis-py-test 127.0.0.1 6377 2 +sentinel monitor redis-py-test 127.0.0.1 6382 2 sentinel down-after-milliseconds redis-py-test 5000 sentinel failover-timeout redis-py-test 60000 sentinel parallel-syncs redis-py-test 1 diff --git a/docker/redis5/sentinel/sentinel_2.conf b/docker/redis5/sentinel/sentinel_2.conf index 9439fc219c..0a50c9a623 100644 --- a/docker/redis5/sentinel/sentinel_2.conf +++ b/docker/redis5/sentinel/sentinel_2.conf @@ -1,6 +1,6 @@ port 26383 -sentinel monitor redis-py-test 127.0.0.1 6377 2 +sentinel monitor redis-py-test 127.0.0.1 6382 2 sentinel down-after-milliseconds redis-py-test 5000 sentinel failover-timeout redis-py-test 60000 sentinel parallel-syncs redis-py-test 1 \ No newline at end of file diff --git a/docker/redis5/sentinel/sentinel_3.conf b/docker/redis5/sentinel/sentinel_3.conf index a468fd5efa..a0e350ba0f 100644 --- a/docker/redis5/sentinel/sentinel_3.conf +++ b/docker/redis5/sentinel/sentinel_3.conf @@ -1,6 +1,6 @@ port 26384 -sentinel monitor redis-py-test 127.0.0.1 6377 2 +sentinel monitor redis-py-test 127.0.0.1 6383 2 sentinel down-after-milliseconds redis-py-test 5000 sentinel failover-timeout redis-py-test 60000 sentinel parallel-syncs redis-py-test 1 \ No newline at end of file diff --git a/tox.ini b/tox.ini index 97a74663b2..2639cb7a2e 100644 --- a/tox.ini +++ b/tox.ini @@ -125,8 +125,8 @@ volumes = name = redis5_master image = redisfab/redis-py:5.0-buster ports = - 6377:6377/tcp -healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',6377)) else False" + 6382:6382/tcp +healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',6382)) else False" volumes = bind:rw:{toxinidir}/docker/redis5/master/redis.conf:/redis.conf @@ -136,8 +136,8 @@ image = redisfab/redis-py:5.0-buster links = redis5_master:redis5_master ports = - 6375:6375/tcp -healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',6375)) else False" + 6383:6383/tcp +healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',6383)) else False" volumes = bind:rw:{toxinidir}/docker/redis5/replica/redis.conf:/redis.conf @@ -192,8 +192,8 @@ volumes = name = redis4_master image = redisfab/redis-py:4.0-buster ports = - 6376:6376/tcp -healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',6376)) else False" + 6381:6381/tcp +healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',6381)) else False" volumes = bind:rw:{toxinidir}/docker/redis4/master/redis.conf:/redis.conf