func TestPartitionSingle(t *testing.T) { addresses := []string{"a", "b", "c"} ctrl, cluster, iptables := setup(t, addresses) defer ctrl.Finish() cluster.EXPECT().Addresses().Return(addresses) iptables.EXPECT().Deny("a", "b") iptables.EXPECT().Deny("a", "c") n := NewNemesis(cluster) n.iptables = iptables n.PartitionSingle(0) }
func TestBridge(t *testing.T) { addresses := []string{"a", "b", "c", "d"} ctrl, cluster, iptables := setup(t, addresses) defer ctrl.Finish() cluster.EXPECT().Addresses().Return(addresses) iptables.EXPECT().Deny("a", "d") iptables.EXPECT().Deny("b", "d") n := NewNemesis(cluster) n.iptables = iptables n.Bridge() }
func TestHeal(t *testing.T) { addresses := []string{"a", "b", "c"} ctrl, cluster, iptables := setup(t, addresses) defer ctrl.Finish() cluster.EXPECT().Addresses().Return(addresses) iptables.EXPECT().Heal() n := NewNemesis(cluster) n.iptables = iptables n.Heal() }
func TestPartitionHalf(t *testing.T) { addresses := []string{"a", "b", "c"} ctrl, cluster, iptables := setup(t, addresses) defer ctrl.Finish() cluster.EXPECT().Addresses().Return(addresses) iptables.EXPECT().PartitionLevel(addresses, 1) n := NewNemesis(cluster) n.iptables = iptables n.PartitionHalf() }