From 9a8d15bd3f741b999ea2e0d1ecbe8b4309242dff Mon Sep 17 00:00:00 2001 From: Lucas Kent Date: Mon, 16 Oct 2023 22:03:46 +1100 Subject: [PATCH] redis tls tests use bitnami image (#1355) --- .../redis/tls-no-client-auth/docker-compose.yaml | 13 +++++++++---- .../redis/tls-no-client-auth/redis.conf | 7 ------- .../tls-no-verify-hostname/docker-compose.yaml | 13 +++++++++---- .../redis/tls-no-verify-hostname/redis.conf | 6 ------ .../test-configs/redis/tls/docker-compose.yaml | 13 +++++++++---- .../tests/test-configs/redis/tls/redis.conf | 6 ------ test-helpers/src/docker_compose.rs | 5 +++++ 7 files changed, 32 insertions(+), 31 deletions(-) delete mode 100644 shotover-proxy/tests/test-configs/redis/tls-no-client-auth/redis.conf delete mode 100644 shotover-proxy/tests/test-configs/redis/tls-no-verify-hostname/redis.conf delete mode 100644 shotover-proxy/tests/test-configs/redis/tls/redis.conf diff --git a/shotover-proxy/tests/test-configs/redis/tls-no-client-auth/docker-compose.yaml b/shotover-proxy/tests/test-configs/redis/tls-no-client-auth/docker-compose.yaml index 2f577ea02..db4d09fbd 100644 --- a/shotover-proxy/tests/test-configs/redis/tls-no-client-auth/docker-compose.yaml +++ b/shotover-proxy/tests/test-configs/redis/tls-no-client-auth/docker-compose.yaml @@ -1,10 +1,15 @@ version: "3.3" services: redis-one: - image: library/redis:6.2.5 + image: bitnami/redis:6.2.13-debian-11-r73 ports: - "1111:6379" volumes: - - ./redis.conf:/usr/local/etc/redis/redis.conf - - ../tls/certs:/usr/local/etc/redis/certs - command: [ "redis-server", "/usr/local/etc/redis/redis.conf" ] + - ../tls/certs:/certs + environment: + ALLOW_EMPTY_PASSWORD: "yes" + REDIS_TLS_ENABLED: "yes" + REDIS_TLS_CERT_FILE: "/certs/localhost.crt" + REDIS_TLS_KEY_FILE: "/certs/localhost.key" + REDIS_TLS_CA_FILE: "/certs/localhost_CA.crt" + REDIS_TLS_AUTH_CLIENTS: "no" diff --git a/shotover-proxy/tests/test-configs/redis/tls-no-client-auth/redis.conf b/shotover-proxy/tests/test-configs/redis/tls-no-client-auth/redis.conf deleted file mode 100644 index d41bd6088..000000000 --- a/shotover-proxy/tests/test-configs/redis/tls-no-client-auth/redis.conf +++ /dev/null @@ -1,7 +0,0 @@ -tls-cert-file /usr/local/etc/redis/certs/localhost.crt -tls-key-file /usr/local/etc/redis/certs/localhost.key -tls-ca-cert-file /usr/local/etc/redis/certs/localhost_CA.crt - -port 0 -tls-port 6379 -tls-auth-clients no \ No newline at end of file diff --git a/shotover-proxy/tests/test-configs/redis/tls-no-verify-hostname/docker-compose.yaml b/shotover-proxy/tests/test-configs/redis/tls-no-verify-hostname/docker-compose.yaml index 2f577ea02..281bb7418 100644 --- a/shotover-proxy/tests/test-configs/redis/tls-no-verify-hostname/docker-compose.yaml +++ b/shotover-proxy/tests/test-configs/redis/tls-no-verify-hostname/docker-compose.yaml @@ -1,10 +1,15 @@ version: "3.3" services: redis-one: - image: library/redis:6.2.5 + image: bitnami/redis:6.2.13-debian-11-r73 ports: - "1111:6379" volumes: - - ./redis.conf:/usr/local/etc/redis/redis.conf - - ../tls/certs:/usr/local/etc/redis/certs - command: [ "redis-server", "/usr/local/etc/redis/redis.conf" ] + - ../tls/certs:/certs + environment: + ALLOW_EMPTY_PASSWORD: "yes" + REDIS_TLS_ENABLED: "yes" + REDIS_TLS_CERT_FILE: "/certs/localhost.crt" + REDIS_TLS_KEY_FILE: "/certs/localhost.key" + REDIS_TLS_CA_FILE: "/certs/localhost_CA.crt" + REDIS_TLS_AUTH_CLIENTS: "yes" diff --git a/shotover-proxy/tests/test-configs/redis/tls-no-verify-hostname/redis.conf b/shotover-proxy/tests/test-configs/redis/tls-no-verify-hostname/redis.conf deleted file mode 100644 index 800619c33..000000000 --- a/shotover-proxy/tests/test-configs/redis/tls-no-verify-hostname/redis.conf +++ /dev/null @@ -1,6 +0,0 @@ -tls-cert-file /usr/local/etc/redis/certs/localhost.crt -tls-key-file /usr/local/etc/redis/certs/localhost.key -tls-ca-cert-file /usr/local/etc/redis/certs/localhost_CA.crt - -port 0 -tls-port 6379 diff --git a/shotover-proxy/tests/test-configs/redis/tls/docker-compose.yaml b/shotover-proxy/tests/test-configs/redis/tls/docker-compose.yaml index f037af530..f5b7b5df9 100644 --- a/shotover-proxy/tests/test-configs/redis/tls/docker-compose.yaml +++ b/shotover-proxy/tests/test-configs/redis/tls/docker-compose.yaml @@ -1,10 +1,15 @@ version: "3.3" services: redis-one: - image: library/redis:6.2.5 + image: bitnami/redis:6.2.13-debian-11-r73 ports: - "1111:6379" volumes: - - ./redis.conf:/usr/local/etc/redis/redis.conf - - ./certs:/usr/local/etc/redis/certs - command: [ "redis-server", "/usr/local/etc/redis/redis.conf" ] + - ./certs:/certs + environment: + ALLOW_EMPTY_PASSWORD: "yes" + REDIS_TLS_ENABLED: "yes" + REDIS_TLS_CERT_FILE: "/certs/localhost.crt" + REDIS_TLS_KEY_FILE: "/certs/localhost.key" + REDIS_TLS_CA_FILE: "/certs/localhost_CA.crt" + REDIS_TLS_AUTH_CLIENTS: "yes" diff --git a/shotover-proxy/tests/test-configs/redis/tls/redis.conf b/shotover-proxy/tests/test-configs/redis/tls/redis.conf deleted file mode 100644 index 800619c33..000000000 --- a/shotover-proxy/tests/test-configs/redis/tls/redis.conf +++ /dev/null @@ -1,6 +0,0 @@ -tls-cert-file /usr/local/etc/redis/certs/localhost.crt -tls-key-file /usr/local/etc/redis/certs/localhost.key -tls-ca-cert-file /usr/local/etc/redis/certs/localhost_CA.crt - -port 0 -tls-port 6379 diff --git a/test-helpers/src/docker_compose.rs b/test-helpers/src/docker_compose.rs index 4f6af73d5..baf43bffa 100644 --- a/test-helpers/src/docker_compose.rs +++ b/test-helpers/src/docker_compose.rs @@ -44,6 +44,11 @@ pub fn get_image_waiters() -> &'static [Image] { log_regex_to_wait_for: r"Ready to accept connections", timeout: 120, }, + Image { + name: "bitnami/redis:6.2.13-debian-11-r73", + log_regex_to_wait_for: r"Ready to accept connections", + timeout: 120, + }, Image { name: "bitnami/redis-cluster:6.2.12-debian-11-r26", //`Cluster state changed` is created by the node services