Update Sentinel Debug command json file and add test case for it (#11513)
Command SENTINEL DEBUG could be no arguments, which display all configurable arguments and their values. Update the command arguments in the docs (json file) to indicate that arguments are optional
This commit is contained in:
parent
3b462ce566
commit
75c66fb02c
@ -3718,7 +3718,7 @@ struct redisCommandArg SENTINEL_DEBUG_data_Subargs[] = {
|
||||
|
||||
/* SENTINEL DEBUG argument table */
|
||||
struct redisCommandArg SENTINEL_DEBUG_Args[] = {
|
||||
{"data",ARG_TYPE_BLOCK,-1,NULL,NULL,NULL,CMD_ARG_MULTIPLE,.subargs=SENTINEL_DEBUG_data_Subargs},
|
||||
{"data",ARG_TYPE_BLOCK,-1,NULL,NULL,NULL,CMD_ARG_OPTIONAL|CMD_ARG_MULTIPLE,.subargs=SENTINEL_DEBUG_data_Subargs},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
{
|
||||
"name": "data",
|
||||
"type": "block",
|
||||
"optional": true,
|
||||
"multiple": true,
|
||||
"arguments": [
|
||||
{
|
||||
|
9
tests/sentinel/tests/14-debug-command.tcl
Normal file
9
tests/sentinel/tests/14-debug-command.tcl
Normal file
@ -0,0 +1,9 @@
|
||||
source "../tests/includes/init-tests.tcl"
|
||||
|
||||
test "Sentinel debug test with arguments and without argument" {
|
||||
set current_info_period [lindex [S 0 SENTINEL DEBUG] 1]
|
||||
S 0 SENTINEL DEBUG info-period 8888
|
||||
assert_equal {8888} [lindex [S 0 SENTINEL DEBUG] 1]
|
||||
S 0 SENTINEL DEBUG info-period $current_info_period
|
||||
assert_equal $current_info_period [lindex [S 0 SENTINEL DEBUG] 1]
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user