summaryrefslogtreecommitdiff
path: root/tests/cluster/cluster.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cluster/cluster.tcl')
-rw-r--r--tests/cluster/cluster.tcl69
1 files changed, 0 insertions, 69 deletions
diff --git a/tests/cluster/cluster.tcl b/tests/cluster/cluster.tcl
index 9c669e128..056bfc311 100644
--- a/tests/cluster/cluster.tcl
+++ b/tests/cluster/cluster.tcl
@@ -217,72 +217,3 @@ proc are_hostnames_propagated {match_string} {
}
return 1
}
-
-# Returns a parsed CLUSTER LINKS output of the instance identified
-# by the given `id` as a list of dictionaries, with each dictionary
-# corresponds to a link.
-proc get_cluster_links id {
- set lines [R $id cluster links]
- set links {}
- foreach l $lines {
- if {$l eq {}} continue
- assert_equal [llength $l] 12
- assert_equal [lindex $l 0] "direction"
- set dir [lindex $l 1]
- assert_equal [lindex $l 2] "node"
- set node [lindex $l 3]
- assert_equal [lindex $l 4] "create-time"
- set create_time [lindex $l 5]
- assert_equal [lindex $l 6] "events"
- set events [lindex $l 7]
- assert_equal [lindex $l 8] "send-buffer-allocated"
- set send_buffer_allocated [lindex $l 9]
- assert_equal [lindex $l 10] "send-buffer-used"
- set send_buffer_used [lindex $l 11]
- set link [dict create \
- dir $dir \
- node $node \
- create_time $create_time \
- events $events \
- send_buffer_allocated $send_buffer_allocated \
- send_buffer_used $send_buffer_used \
- ]
- lappend links $link
- }
- return $links
-}
-
-proc get_links_with_peer {this_instance_id peer_nodename} {
- set links [get_cluster_links $this_instance_id]
- set links_with_peer {}
- foreach l $links {
- if {[dict get $l node] eq $peer_nodename} {
- lappend links_with_peer $l
- }
- }
- return $links_with_peer
-}
-
-# Return the entry in CLUSTER LINKS output by instance identified by `this_instance_id` that
-# corresponds to the link established toward a peer identified by `peer_nodename`
-proc get_link_to_peer {this_instance_id peer_nodename} {
- set links_with_peer [get_links_with_peer $this_instance_id $peer_nodename]
- foreach l $links_with_peer {
- if {[dict get $l dir] eq "to"} {
- return $l
- }
- }
- return {}
-}
-
-# Return the entry in CLUSTER LINKS output by instance identified by `this_instance_id` that
-# corresponds to the link accepted from a peer identified by `peer_nodename`
-proc get_link_from_peer {this_instance_id peer_nodename} {
- set links_with_peer [get_links_with_peer $this_instance_id $peer_nodename]
- foreach l $links_with_peer {
- if {[dict get $l dir] eq "from"} {
- return $l
- }
- }
- return {}
-} \ No newline at end of file