diff options
Diffstat (limited to 'examples/redis-unstable/tests/unit/cluster/human-announced-nodename.tcl')
| -rw-r--r-- | examples/redis-unstable/tests/unit/cluster/human-announced-nodename.tcl | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/examples/redis-unstable/tests/unit/cluster/human-announced-nodename.tcl b/examples/redis-unstable/tests/unit/cluster/human-announced-nodename.tcl new file mode 100644 index 0000000..a595ca6 --- /dev/null +++ b/examples/redis-unstable/tests/unit/cluster/human-announced-nodename.tcl | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | # Check if cluster's view of human announced nodename is reported in logs | ||
| 2 | start_cluster 3 0 {tags {external:skip cluster}} { | ||
| 3 | test "Set cluster human announced nodename and let it propagate" { | ||
| 4 | for {set j 0} {$j < [llength $::servers]} {incr j} { | ||
| 5 | R $j config set cluster-announce-hostname "host-$j.com" | ||
| 6 | R $j config set cluster-announce-human-nodename "nodename-$j" | ||
| 7 | } | ||
| 8 | |||
| 9 | # We wait for everyone to agree on the hostnames. Since they are gossiped | ||
| 10 | # the same way as nodenames, it implies everyone knows the nodenames too. | ||
| 11 | wait_for_condition 50 100 { | ||
| 12 | [are_hostnames_propagated "host-*.com"] eq 1 | ||
| 13 | } else { | ||
| 14 | fail "cluster hostnames were not propagated" | ||
| 15 | } | ||
| 16 | } | ||
| 17 | |||
| 18 | test "Human nodenames are visible in log messages" { | ||
| 19 | # Pause instance 0, so everyone thinks it is dead | ||
| 20 | pause_process [srv 0 pid] | ||
| 21 | |||
| 22 | # We're going to use a message we will know will be sent, node unreachable, | ||
| 23 | # since it includes the other node gossiping. | ||
| 24 | wait_for_log_messages -1 {"*Node * (nodename-2) reported node * (nodename-0) as not reachable*"} 0 20 500 | ||
| 25 | wait_for_log_messages -2 {"*Node * (nodename-1) reported node * (nodename-0) as not reachable*"} 0 20 500 | ||
| 26 | |||
| 27 | resume_process [srv 0 pid] | ||
| 28 | } | ||
| 29 | } | ||
