31 lines
725 B
Tcl
31 lines
725 B
Tcl
# Check the basic monitoring and failover capabilities.
|
|
|
|
source "../tests/includes/init-tests.tcl"
|
|
|
|
if {$::simulate_error} {
|
|
test "This test will fail" {
|
|
fail "Simulated error"
|
|
}
|
|
}
|
|
|
|
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}
|
|
}
|