2014-05-19 11:39:15 +02:00
|
|
|
# Check the basic monitoring and failover capabilities.
|
|
|
|
|
|
|
|
source "../tests/includes/init-tests.tcl"
|
|
|
|
|
|
|
|
test "Create a 5 nodes cluster" {
|
2014-05-19 15:26:17 +02:00
|
|
|
create_cluster 5 5
|
2014-05-19 11:39:15 +02:00
|
|
|
}
|
|
|
|
|
2014-05-23 11:40:25 +02:00
|
|
|
test "Cluster should start ok" {
|
|
|
|
assert_cluster_state ok
|
|
|
|
}
|
|
|
|
|
|
|
|
test "Killing two slave nodes" {
|
|
|
|
kill_instance redis 5
|
|
|
|
kill_instance redis 6
|
|
|
|
}
|
|
|
|
|
|
|
|
test "Cluster should be still up" {
|
|
|
|
assert_cluster_state ok
|
|
|
|
}
|
|
|
|
|
2014-05-19 11:39:15 +02:00
|
|
|
test "Killing one master node" {
|
|
|
|
kill_instance redis 0
|
|
|
|
}
|
|
|
|
|
2014-05-23 11:40:25 +02:00
|
|
|
# Note: the only slave of instance 0 is already down so no
|
|
|
|
# failover is possible, that would change the state back to ok.
|
2014-05-19 11:39:15 +02:00
|
|
|
test "Cluster should be down now" {
|
|
|
|
assert_cluster_state fail
|
|
|
|
}
|
|
|
|
|
|
|
|
test "Restarting master node" {
|
|
|
|
restart_instance redis 0
|
|
|
|
}
|
|
|
|
|
|
|
|
test "Cluster should be up again" {
|
|
|
|
assert_cluster_state ok
|
|
|
|
}
|