"Fossies" - the Fresh Open Source Software Archive

Member "redis-7.0.5/tests/cluster/tests/01-faildet.tcl" (21 Sep 2022, 763 Bytes) of package /linux/misc/redis-7.0.5.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Tcl/Tk source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

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