Skip to content

Commit

Permalink
Add announced-endpoints test to all_tests and fix tls related tests (r…
Browse files Browse the repository at this point in the history
…edis#12927)

The test was introduced in redis#10745, but we forgot to add it to the
test_helper.tcl, so our CI did not actually run it. This PR adds it
and ensures it passes CI tests.
  • Loading branch information
enjoy-binbin authored Jan 10, 2024
1 parent f7b1d02 commit b351a04
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions tests/test_helper.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ set ::all_tests {
unit/client-eviction
unit/violations
unit/replybufsize
unit/cluster/announced-endpoints
unit/cluster/misc
unit/cluster/cli
unit/cluster/scripting
Expand Down
18 changes: 13 additions & 5 deletions tests/unit/cluster/announced-endpoints.tcl
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
start_cluster 2 2 {tags {external:skip cluster}} {

test "Test change cluster-announce-port and cluster-announce-tls-port at runtime" {
set baseport [lindex [R 0 config get port] 1]
set count [expr [llength $::servers] +1 ]
if {$::tls} {
set baseport [lindex [R 0 config get tls-port] 1]
} else {
set baseport [lindex [R 0 config get port] 1]
}
set count [expr [llength $::servers] + 1]
set used_port [find_available_port $baseport $count]

R 0 config set cluster-announce-tls-port $used_port
Expand All @@ -17,12 +21,16 @@ start_cluster 2 2 {tags {external:skip cluster}} {

R 0 config set cluster-announce-tls-port 0
R 0 config set cluster-announce-port 0
assert_match "*:$baseport@*" [R 0 CLUSTER NODES]
assert_match "*:$baseport@*" [R 0 CLUSTER NODES]
}

test "Test change cluster-announce-bus-port at runtime" {
set baseport [lindex [R 0 config get port] 1]
set count [expr [llength $::servers] +1 ]
if {$::tls} {
set baseport [lindex [R 0 config get tls-port] 1]
} else {
set baseport [lindex [R 0 config get port] 1]
}
set count [expr [llength $::servers] + 1]
set used_port [find_available_port $baseport $count]

# Verify config set cluster-announce-bus-port
Expand Down

0 comments on commit b351a04

Please sign in to comment.