diff options
author | guybe7 <guy.benoish@redislabs.com> | 2021-11-23 09:38:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-23 10:38:25 +0200 |
commit | b161cff5f92a01acc23ac4ff533e65bda579e1a6 (patch) | |
tree | 71f279b7b43efc944bcc143f60941ee541cab658 /tests/modules | |
parent | f07dedf73facfed5044efaf2a7a780581bf73ffa (diff) | |
download | redis-b161cff5f92a01acc23ac4ff533e65bda579e1a6.tar.gz |
QUIT is a command, HOST: and POST are not (#9798)
Some people complain that QUIT is missing from help/command table.
Not appearing in COMMAND command, command stats, ACL, etc.
and instead, there's a hack in processCommand with a comment that looks outdated.
Note that it is [documented](https://redis.io/commands/quit)
At the same time, HOST: and POST are there in the command table although these are not real commands.
They would appear in the COMMAND command, and even in commandstats.
Other changes:
1. Initialize the static logged_time static var in securityWarningCommand
2. add `no-auth` flag to RESET so it can always be executed.
Diffstat (limited to 'tests/modules')
-rw-r--r-- | tests/modules/misc.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/modules/misc.c b/tests/modules/misc.c index 88039c6dd..daed69952 100644 --- a/tests/modules/misc.c +++ b/tests/modules/misc.c @@ -295,6 +295,14 @@ int test_log_tsctx(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) return REDISMODULE_OK; } +int test_weird_cmd(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) { + REDISMODULE_NOT_USED(argv); + REDISMODULE_NOT_USED(argc); + + RedisModule_ReplyWithSimpleString(ctx, "OK"); + return REDISMODULE_OK; +} + int RedisModule_OnLoad(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) { REDISMODULE_NOT_USED(argv); REDISMODULE_NOT_USED(argc); @@ -331,6 +339,9 @@ int RedisModule_OnLoad(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) return REDISMODULE_ERR; if (RedisModule_CreateCommand(ctx,"test.log_tsctx", test_log_tsctx,"",0,0,0) == REDISMODULE_ERR) return REDISMODULE_ERR; + /* Add a command with ':' in it's name, so that we can check commandstats sanitization. */ + if (RedisModule_CreateCommand(ctx,"test.weird:cmd", test_weird_cmd,"readonly",0,0,0) == REDISMODULE_ERR) + return REDISMODULE_ERR; return REDISMODULE_OK; } |