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:
Wen Hui 2022-11-24 06:10:41 -05:00 committed by GitHub
parent 3b462ce566
commit 75c66fb02c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 1 deletions

View File

@ -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}
};

View File

@ -16,6 +16,7 @@
{
"name": "data",
"type": "block",
"optional": true,
"multiple": true,
"arguments": [
{

View 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]
}