summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBinbin <binloveplay1314@qq.com>2023-03-22 18:18:03 +0800
committerGitHub <noreply@github.com>2023-03-22 12:18:03 +0200
commit9c4c90c1bf28d5da738eb5a461b40193ce0b70c3 (patch)
tree3680b2d6b7ac1a835621b4153922b0fe2289e3ad /tests
parentef50118c92edcc882f66e17b236097600ceab1ab (diff)
downloadredis-9c4c90c1bf28d5da738eb5a461b40193ce0b70c3.tar.gz
Replcae sentinel commands sanity check with infrastructure work test (#11950)
The sanity check test intention was to detect that when a command is added to sentinel it is on purpose. This test is easily broken, like CLIENT SETINFO introduced by #11758. We replace it with a test that validates that a few specific commands are either there or missing (to test the infrastructure works correctly).
Diffstat (limited to 'tests')
-rw-r--r--tests/sentinel/tests/00-base.tcl18
1 files changed, 15 insertions, 3 deletions
diff --git a/tests/sentinel/tests/00-base.tcl b/tests/sentinel/tests/00-base.tcl
index 761ee82d1..1b33ca7a3 100644
--- a/tests/sentinel/tests/00-base.tcl
+++ b/tests/sentinel/tests/00-base.tcl
@@ -12,10 +12,22 @@ if {$::simulate_error} {
}
}
-test "Sentinel commands sanity check" {
+test "Sentinel command flag infrastructure works correctly" {
foreach_sentinel_id id {
- assert_equal {72} [llength [S $id command list]]
- assert_equal {15} [S $id command count]
+ set command_list [S $id command list]
+
+ foreach cmd {ping info subscribe client|setinfo} {
+ assert_not_equal [S $id command docs $cmd] {}
+ assert_not_equal [lsearch $command_list $cmd] -1
+ }
+
+ foreach cmd {save bgrewriteaof blpop replicaof} {
+ assert_equal [S $id command docs $cmd] {}
+ assert_equal [lsearch $command_list $cmd] -1
+ assert_error {ERR unknown command*} {S $id $cmd}
+ }
+
+ assert_error {ERR unknown subcommand*} {S $id client no-touch}
}
}