File tree Expand file tree Collapse file tree 1 file changed +26
-1
lines changed
Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -161,7 +161,9 @@ GET /t
161161location / t {
162162 lua_socket_log_errors Off;
163163 content_by_lua_block {
164- local rc = require (" resty.redis.connector" ). new ()
164+ local rc = require (" resty.redis.connector" ). new ({
165+ port = $ TEST_NGINX_REDIS_PORT ,
166+ })
165167
166168 local redis = assert(rc: connect(),
167169 " rc:connect should return positively" )
@@ -186,3 +188,26 @@ location /t {
186188GET / t
187189-- - no_error_log
188190[error]
191+
192+
193+ === TEST 6 : password
194+ -- - http_config eval: $::HttpConfig
195+ -- - config
196+ location / t {
197+ lua_socket_log_errors Off;
198+ content_by_lua_block {
199+ local rc = require (" resty.redis.connector" ). new ({
200+ port = $ TEST_NGINX_REDIS_PORT ,
201+ password = " foo" ,
202+ })
203+
204+ local redis, err = rc: connect()
205+ assert(not redis and string. find(err, " ERR Client sent AUTH, but no password is set" ),
206+ " connect should fail with password error" )
207+
208+ }
209+ }
210+ -- - request
211+ GET / t
212+ -- - error_log
213+ ERR Client sent AUTH, but no password is set
You can’t perform that action at this time.
0 commit comments