"Fossies" - the Fresh Open Source Software Archive

Member "redis-7.0.5/tests/sentinel/tests/13-info-command.tcl" (21 Sep 2022, 1835 Bytes) of package /linux/misc/redis-7.0.5.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Tcl/Tk source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 source "../tests/includes/init-tests.tcl"
    2 
    3 test "info command with at most one argument" {
    4     set subCommandList {}
    5     foreach arg {"" "all" "default" "everything"} {
    6         if {$arg == ""} {
    7             set info [S 0 info]
    8         } else {
    9             set info [S 0 info $arg]
   10         }
   11         assert { [string match "*redis_version*" $info] }
   12         assert { [string match "*maxclients*" $info] }
   13         assert { [string match "*used_cpu_user*" $info] }
   14         assert { [string match "*sentinel_tilt*" $info] }
   15         assert { ![string match "*used_memory*" $info] }
   16         assert { ![string match "*rdb_last_bgsave*" $info] }
   17         assert { ![string match "*master_repl_offset*" $info] }
   18         assert { ![string match "*cluster_enabled*" $info] }
   19     }
   20 }
   21 
   22 test "info command with one sub-section" {
   23     set info [S 0 info cpu]
   24     assert { [string match "*used_cpu_user*" $info] }
   25     assert { ![string match "*sentinel_tilt*" $info] }
   26     assert { ![string match "*redis_version*" $info] }
   27 
   28     set info [S 0 info sentinel]
   29     assert { [string match "*sentinel_tilt*" $info] }
   30     assert { ![string match "*used_cpu_user*" $info] }
   31     assert { ![string match "*redis_version*" $info] }
   32 }
   33 
   34 test "info command with multiple sub-sections" {
   35     set info [S 0 info server sentinel replication]
   36     assert { [string match "*redis_version*" $info] }
   37     assert { [string match "*sentinel_tilt*" $info] }
   38     assert { ![string match "*used_memory*" $info] }
   39     assert { ![string match "*used_cpu_user*" $info] }
   40 
   41     set info [S 0 info cpu all]
   42     assert { [string match "*used_cpu_user*" $info] }
   43     assert { [string match "*sentinel_tilt*" $info] }
   44     assert { [string match "*redis_version*" $info] }
   45     assert { ![string match "*used_memory*" $info] }
   46     assert { ![string match "*master_repl_offset*" $info] }
   47 }