01-faildet.tcl 763 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. # Check the basic monitoring and failover capabilities.
  2. source "../tests/includes/init-tests.tcl"
  3. test "Create a 5 nodes cluster" {
  4. create_cluster 5 5
  5. }
  6. test "Cluster should start ok" {
  7. assert_cluster_state ok
  8. }
  9. test "Killing two slave nodes" {
  10. kill_instance redis 5
  11. kill_instance redis 6
  12. }
  13. test "Cluster should be still up" {
  14. assert_cluster_state ok
  15. }
  16. test "Killing one master node" {
  17. kill_instance redis 0
  18. }
  19. # Note: the only slave of instance 0 is already down so no
  20. # failover is possible, that would change the state back to ok.
  21. test "Cluster should be down now" {
  22. assert_cluster_state fail
  23. }
  24. test "Restarting master node" {
  25. restart_instance redis 0
  26. }
  27. test "Cluster should be up again" {
  28. assert_cluster_state ok
  29. }