diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 5029dd43cced..6421ae583af7 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -190,7 +190,6 @@ jobs: ports: - 6379:6379 - 6380:6380 - - 6381:6381 options: >- --name kong_redis @@ -199,6 +198,19 @@ jobs: ports: - 9411:9411 + redis-auth: + image: redis/redis-stack-server + # Set health checks to wait until redis has started + options: >- + --health-cmd "redis-cli ping" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 6381:6379 + env: + REDIS_ARGS: "--requirepass passdefault" + steps: - name: Bump max open files run: | diff --git a/spec/03-plugins/29-acme/05-redis_storage_spec.lua b/spec/03-plugins/29-acme/05-redis_storage_spec.lua index e188744d2c08..ef1bec8ef0e8 100644 --- a/spec/03-plugins/29-acme/05-redis_storage_spec.lua +++ b/spec/03-plugins/29-acme/05-redis_storage_spec.lua @@ -623,7 +623,7 @@ describe("Plugin: acme (storage.redis)", function() assert.is_nil(err) assert.not_nil(storage) local err = storage:set("foo", "bar", 10) - assert.equal("can't select database NOAUTH Authentication required.", err) + assert.equal("authentication failed WRONGPASS invalid username-password pair or user is disabled.", err) end) it("should not connect to Redis with Auth using wrong username", function() @@ -637,7 +637,7 @@ describe("Plugin: acme (storage.redis)", function() assert.is_nil(err) assert.not_nil(storage) local err = storage:set("foo", "bar", 10) - assert.equal("can't select database NOAUTH Authentication required.", err) + assert.equal("authentication failed WRONGPASS invalid username-password pair or user is disabled.", err) end) it("should not connect to Redis with Auth using wrong password and no username", function() @@ -666,7 +666,7 @@ describe("Plugin: acme (storage.redis)", function() assert.is_nil(err) assert.not_nil(storage) local err = storage:set("foo", "bar", 10) - assert.equal("can't select database NOAUTH Authentication required.", err) + assert.equal("authentication failed WRONGPASS invalid username-password pair or user is disabled.", err) end) it("should not connect to Redis with Auth using correct password and wrong username", function() @@ -681,7 +681,7 @@ describe("Plugin: acme (storage.redis)", function() assert.is_nil(err) assert.not_nil(storage) local err = storage:set("foo", "bar", 10) - assert.equal("can't select database NOAUTH Authentication required.", err) + assert.equal("authentication failed WRONGPASS invalid username-password pair or user is disabled.", err) end) end) end) diff --git a/spec/fixtures/redis/docker-entrypoint.sh b/spec/fixtures/redis/docker-entrypoint.sh index e17eebde5c47..157babcbe669 100755 --- a/spec/fixtures/redis/docker-entrypoint.sh +++ b/spec/fixtures/redis/docker-entrypoint.sh @@ -10,10 +10,6 @@ if [ -d /workspace ] ; then --tls-cluster no \ --tls-replication no \ --tls-auth-clients no - - redis-server \ - --port 6381 \ - --requirepass passdefault fi tail -f /dev/null