File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,33 @@ GET /t
4848[error]
4949
5050
51+ === TEST 1 b: Get the master directly
52+ -- - http_config eval: $::HttpConfig
53+ -- - config
54+ location / t {
55+ content_by_lua_block {
56+ local rc = require (" resty.redis.connector" ). new ()
57+
58+ local master, err = rc: connect({
59+ url = " sentinel://mymaster:m/3" ,
60+ sentinels = {
61+ { host = " 127.0.0.1" , port = 6381 }
62+ }
63+ })
64+
65+ assert(master and not err, " get_master should return the master" )
66+ assert(master: set(" foo" , " bar" ), " set should run without error" )
67+ assert(master: get(" foo" ) == " bar" , " get(foo) should return bar" )
68+
69+ master: close()
70+ }
71+ }
72+ -- - request
73+ GET / t
74+ -- - no_error_log
75+ [error]
76+
77+
5178=== TEST 2 : Get slaves
5279-- - http_config eval: $::HttpConfig
5380-- - config
You can’t perform that action at this time.
0 commit comments