summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2014-04-29 10:42:32 +0200
committerantirez <antirez@gmail.com>2014-05-05 09:37:39 +0200
commite244bee60cf8f92e1abe1698f3f6adc36d311501 (patch)
tree48a9ed872d9afe03f96a1a1229fd5d15c4601a02
parent6b4e9558bd181c6874d5aeca629f989ea93033dd (diff)
downloadredis-e244bee60cf8f92e1abe1698f3f6adc36d311501.tar.gz
Cluster test: check that every node has a different ID.
-rw-r--r--tests/cluster/tests/00-base.tcl16
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/cluster/tests/00-base.tcl b/tests/cluster/tests/00-base.tcl
index e3b88e3e8..cf2a7644d 100644
--- a/tests/cluster/tests/00-base.tcl
+++ b/tests/cluster/tests/00-base.tcl
@@ -8,9 +8,23 @@ if {$::simulate_error} {
}
}
-test "Cluster nodes are reachable." {
+test "Cluster nodes are reachable" {
foreach_redis_id id {
# Every node should just know itself.
assert {[R $id ping] eq {PONG}}
}
}
+
+test "Different nodes have different IDs" {
+ set ids {}
+ set numnodes 0
+ foreach_redis_id id {
+ incr numnodes
+ # Every node should just know itself.
+ set nodeid [dict get [get_myself $id] id]
+ assert {$nodeid ne {}}
+ lappend ids $nodeid
+ }
+ set numids [llength [lsort -unique $ids]]
+ assert {$numids == $numnodes}
+}