summaryrefslogtreecommitdiff
path: root/tests/unit/moduleapi/misc.tcl
diff options
context:
space:
mode:
authorYossi Gottlieb <yossigo@gmail.com>2020-08-17 17:46:54 +0300
committerGitHub <noreply@github.com>2020-08-17 17:46:54 +0300
commit64c360c5156ca6ee6d1eb52bfeb3fa48f3b25da5 (patch)
tree693cf16a95771dc0718bab0975265a104e260b84 /tests/unit/moduleapi/misc.tcl
parentfb2a94af3fbb3f3cf8b26b8bd89387669cb111a1 (diff)
downloadredis-64c360c5156ca6ee6d1eb52bfeb3fa48f3b25da5.tar.gz
Module API: fix missing RM_CLIENTINFO_FLAG_SSL. (#7666)
The `REDISMODULE_CLIENTINFO_FLAG_SSL` flag was already a part of the `RedisModuleClientInfo` structure but was not implemented.
Diffstat (limited to 'tests/unit/moduleapi/misc.tcl')
-rw-r--r--tests/unit/moduleapi/misc.tcl19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/unit/moduleapi/misc.tcl b/tests/unit/moduleapi/misc.tcl
index 748016f1a..b57a94f6a 100644
--- a/tests/unit/moduleapi/misc.tcl
+++ b/tests/unit/moduleapi/misc.tcl
@@ -67,4 +67,23 @@ start_server {tags {"modules"}} {
assert { $was_set == 0 }
}
+ test {test module clientinfo api} {
+ # Test basic sanity and SSL flag
+ set info [r test.clientinfo]
+ set ssl_flag [expr $::tls ? {"ssl:"} : {":"}]
+
+ assert { [dict get $info db] == 9 }
+ assert { [dict get $info flags] == "${ssl_flag}::::" }
+
+ # Test MULTI flag
+ r multi
+ r test.clientinfo
+ set info [lindex [r exec] 0]
+ assert { [dict get $info flags] == "${ssl_flag}::::multi" }
+
+ # Test TRACKING flag
+ r client tracking on
+ set info [r test.clientinfo]
+ assert { [dict get $info flags] == "${ssl_flag}::tracking::" }
+ }
}