Skip to content

Commit

Permalink
Add CI scenarios to test agains unix sockets
Browse files Browse the repository at this point in the history
  • Loading branch information
jlledom committed Oct 30, 2024
1 parent 7eff2d5 commit 9c45561
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
35 changes: 35 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ commands:
cp -r script/config/examples/tls/sentinel1 ./sentinel1_tls
cp -r script/config/examples/tls/sentinel2 ./sentinel2_tls
cp -r script/config/examples/tls/sentinel3 ./sentinel3_tls
mkdir -m 1777 ./run
- run:
name: Start services
command: |
Expand Down Expand Up @@ -119,9 +120,15 @@ workflows:
- test_single:
requires:
- install_dependencies
- test_single_unix:
requires:
- install_dependencies
- test_sentinels:
requires:
- install_dependencies
- test_acl_unix:
requires:
- install_dependencies
- test_tls:
requires:
- install_dependencies
Expand Down Expand Up @@ -161,6 +168,18 @@ jobs:
- start_services:
services: redis-master
- run_tests
test_single_unix:
executor:
name: ubuntu_vm
working_directory: ~/project
environment:
CONFIG_QUEUES_MASTER_NAME: unix://run/redis.sock
CONFIG_REDIS_PROXY: unix://run/redis.sock
steps:
- *attach-to-workspace
- start_services:
services: redis-master
- run_tests
test_sentinels:
executor:
name: ubuntu_vm
Expand All @@ -175,6 +194,22 @@ jobs:
- start_services:
services: redis-master redis-replica1 redis-replica2 redis-sentinel1 redis-sentinel2 redis-sentinel3
- run_tests
test_acl_unix:
executor:
name: ubuntu_vm
working_directory: ~/project
environment:
CONFIG_QUEUES_MASTER_NAME: unix://run/redis.sock
CONFIG_QUEUES_USERNAME: porta
CONFIG_QUEUES_PASSWORD: sup3rS3cre1!
CONFIG_REDIS_PROXY: unix://run/redis.sock
CONFIG_REDIS_USERNAME: porta
CONFIG_REDIS_PASSWORD: sup3rS3cre1!
steps:
- *attach-to-workspace
- start_services:
services: tls-redis-master
- run_tests
test_tls:
executor:
name: ubuntu_vm
Expand Down
2 changes: 2 additions & 0 deletions script/config/examples/tls/master.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
port 0
unixsocket /var/run/redis/redis.sock
unixsocketperm 777
tls-port 46380
tls-cert-file /etc/redis.crt
tls-key-file /etc/redis.key
Expand Down
5 changes: 4 additions & 1 deletion script/config/podman-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ services:
image: redis:6.2-alpine
container_name: redis-master
network_mode: host
command: [ redis-server, --port, "6379" ]
volumes:
- ./run:/var/run/redis:z
command: [ redis-server, --port, "6379", --unixsocket, "/var/run/redis/redis.sock", --unixsocketperm, "777" ]

redis-replica1:
image: redis:6.2-alpine
Expand Down Expand Up @@ -47,6 +49,7 @@ services:
container_name: tls-redis-master
network_mode: host
volumes:
- ./run:/var/run/redis:z
- ./master.conf:/etc/redis.conf:z
- ./circleci.crt:/etc/redis.crt:z
- ./circleci.key:/etc/redis.key:z
Expand Down

0 comments on commit 9c45561

Please sign in to comment.