summaryrefslogtreecommitdiff
path: root/tests/instances.tcl
diff options
context:
space:
mode:
authorOran Agra <oran@redislabs.com>2021-04-01 09:44:44 +0300
committerGitHub <noreply@github.com>2021-04-01 09:44:44 +0300
commit370ab4c4db9f5ec83d9ceb3edf9518ad322f31f3 (patch)
tree10c1a0d3ab104922277bb25c9b5b83a288666b3f /tests/instances.tcl
parent843f769b96ba3bf6cd40293304a1c7d1d405a2cb (diff)
downloadredis-370ab4c4db9f5ec83d9ceb3edf9518ad322f31f3.tar.gz
Solve sentinel test issue in TLS due to recent tests change. (#8728)
5629dbe71 added a change that configures the tcp (plaintext) port alongside the tls port, this causes the INFO command for tcp_port to return that instead of the tls port when running in tls, and that broke the sentinel tests that query it. the fix is to add a method that gets the right port from CONFIG instead of relying on the tcp_port info field.
Diffstat (limited to 'tests/instances.tcl')
-rw-r--r--tests/instances.tcl8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/instances.tcl b/tests/instances.tcl
index ad605c316..1395efa0c 100644
--- a/tests/instances.tcl
+++ b/tests/instances.tcl
@@ -499,6 +499,14 @@ proc RI {n field} {
get_info_field [R $n info] $field
}
+proc RPort {n} {
+ if {$::tls} {
+ return [lindex [R $n config get tls-port] 1]
+ } else {
+ return [lindex [R $n config get port] 1]
+ }
+}
+
# Iterate over IDs of sentinel or redis instances.
proc foreach_instance_id {instances idvar code} {
upvar 1 $idvar id