mirror of
https://github.com/bitnami/containers.git
synced 2026-03-07 10:07:20 +08:00
tests: Master data is replicated on slave with authentication enabled
This commit is contained in:
@@ -134,3 +134,25 @@ cleanup_environment
|
||||
run redis_client slave0 get winter
|
||||
[[ "$output" =~ "is coming" ]]
|
||||
}
|
||||
|
||||
@test "Master data is replicated on slave with authentication enabled" {
|
||||
container_create master -d \
|
||||
-e REDIS_PASSWORD=$REDIS_PASSWORD \
|
||||
-e REDIS_REPLICATION_MODE=master
|
||||
|
||||
container_create slave0 -d \
|
||||
$(container_link master $CONTAINER_NAME) \
|
||||
-e REDIS_MASTER_HOST=$CONTAINER_NAME \
|
||||
-e REDIS_MASTER_PORT=6379 \
|
||||
-e REDIS_MASTER_PASSWORD=$REDIS_PASSWORD \
|
||||
-e REDIS_PASSWORD=$REDIS_PASSWORD \
|
||||
-e REDIS_REPLICATION_MODE=slave
|
||||
|
||||
# create record in master
|
||||
run redis_client master -a $REDIS_PASSWORD set winter 'is coming'
|
||||
[[ "$output" =~ "OK" ]]
|
||||
|
||||
# verify that record is replicated on slave0
|
||||
run redis_client slave0 -a $REDIS_PASSWORD get winter
|
||||
[[ "$output" =~ "is coming" ]]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user