|
|
|
|
@@ -96,15 +96,15 @@ func TestRPCITLclStatusSecondEngine(t *testing.T) {
|
|
|
|
|
var status map[string]interface{}
|
|
|
|
|
if err := rpcPoolFirst.Call("Responder.Status", "", &status); err != nil {
|
|
|
|
|
t.Error(err)
|
|
|
|
|
} else if status[utils.InstanceID].(string) == "" {
|
|
|
|
|
t.Error("Empty InstanceID received")
|
|
|
|
|
} else if status[utils.NodeID].(string) == "" {
|
|
|
|
|
t.Error("Empty NodeID received")
|
|
|
|
|
} else {
|
|
|
|
|
ral2ID = status[utils.InstanceID].(string)
|
|
|
|
|
ral2ID = status[utils.NodeID].(string)
|
|
|
|
|
}
|
|
|
|
|
if err := rpcPoolFirst.Call("Responder.Status", "", &status); err != nil { // Make sure second time we land on the same instance
|
|
|
|
|
t.Error(err)
|
|
|
|
|
} else if status[utils.InstanceID].(string) != ral2ID {
|
|
|
|
|
t.Errorf("Expecting:\n%s\nReceived:\n%s", ral2ID, status[utils.InstanceID].(string))
|
|
|
|
|
} else if status[utils.NodeID].(string) != ral2ID {
|
|
|
|
|
t.Errorf("Expecting:\n%s\nReceived:\n%s", ral2ID, status[utils.NodeID].(string))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -120,17 +120,17 @@ func TestRPCITLclStatusFirstInitial(t *testing.T) {
|
|
|
|
|
var status map[string]interface{}
|
|
|
|
|
if err := rpcPoolFirst.Call("Responder.Status", "", &status); err != nil {
|
|
|
|
|
t.Error(err)
|
|
|
|
|
} else if status[utils.InstanceID].(string) == "" {
|
|
|
|
|
t.Error("Empty InstanceID received")
|
|
|
|
|
} else if status[utils.InstanceID].(string) == ral2ID {
|
|
|
|
|
t.Fatalf("Should receive ralID different than second one, got: %s", status[utils.InstanceID].(string))
|
|
|
|
|
} else if status[utils.NodeID].(string) == "" {
|
|
|
|
|
t.Error("Empty NodeID received")
|
|
|
|
|
} else if status[utils.NodeID].(string) == ral2ID {
|
|
|
|
|
t.Fatalf("Should receive ralID different than second one, got: %s", status[utils.NodeID].(string))
|
|
|
|
|
} else {
|
|
|
|
|
ral1ID = status[utils.InstanceID].(string)
|
|
|
|
|
ral1ID = status[utils.NodeID].(string)
|
|
|
|
|
}
|
|
|
|
|
if err := rpcPoolFirst.Call("Responder.Status", "", &status); err != nil { // Make sure second time we land on the same instance
|
|
|
|
|
t.Error(err)
|
|
|
|
|
} else if status[utils.InstanceID].(string) != ral1ID {
|
|
|
|
|
t.Errorf("Expecting:\n%s\nReceived:\n%s", ral1ID, status[utils.InstanceID].(string))
|
|
|
|
|
} else if status[utils.NodeID].(string) != ral1ID {
|
|
|
|
|
t.Errorf("Expecting:\n%s\nReceived:\n%s", ral1ID, status[utils.NodeID].(string))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -143,17 +143,17 @@ func TestRPCITLclStatusFirstFailover(t *testing.T) {
|
|
|
|
|
var status map[string]interface{}
|
|
|
|
|
if err := rpcPoolFirst.Call("Responder.Status", "", &status); err != nil {
|
|
|
|
|
t.Error(err)
|
|
|
|
|
} else if status[utils.InstanceID].(string) == "" {
|
|
|
|
|
t.Error("Empty InstanceID received")
|
|
|
|
|
} else if status[utils.InstanceID].(string) == ral1ID {
|
|
|
|
|
t.Fatalf("Should receive ralID different than first one, got: %s", status[utils.InstanceID].(string))
|
|
|
|
|
} else if status[utils.NodeID].(string) == "" {
|
|
|
|
|
t.Error("Empty NodeID received")
|
|
|
|
|
} else if status[utils.NodeID].(string) == ral1ID {
|
|
|
|
|
t.Fatalf("Should receive ralID different than first one, got: %s", status[utils.NodeID].(string))
|
|
|
|
|
} else {
|
|
|
|
|
ral2ID = status[utils.InstanceID].(string)
|
|
|
|
|
ral2ID = status[utils.NodeID].(string)
|
|
|
|
|
}
|
|
|
|
|
if err := rpcPoolFirst.Call("Responder.Status", "", &status); err != nil { // Make sure second time we land on the same instance
|
|
|
|
|
t.Error(err)
|
|
|
|
|
} else if status[utils.InstanceID].(string) != ral2ID {
|
|
|
|
|
t.Errorf("Expecting:\n%s\nReceived:\n%s", ral2ID, status[utils.InstanceID].(string))
|
|
|
|
|
} else if status[utils.NodeID].(string) != ral2ID {
|
|
|
|
|
t.Errorf("Expecting:\n%s\nReceived:\n%s", ral2ID, status[utils.NodeID].(string))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -164,15 +164,15 @@ func TestRPCITLclStatusFirstFailback(t *testing.T) {
|
|
|
|
|
var status map[string]interface{}
|
|
|
|
|
if err := rpcPoolFirst.Call("Responder.Status", "", &status); err != nil {
|
|
|
|
|
t.Error(err)
|
|
|
|
|
} else if status[utils.InstanceID].(string) == ral2ID {
|
|
|
|
|
} else if status[utils.NodeID].(string) == ral2ID {
|
|
|
|
|
t.Error("Should receive new ID")
|
|
|
|
|
} else {
|
|
|
|
|
ral1ID = status[utils.InstanceID].(string)
|
|
|
|
|
ral1ID = status[utils.NodeID].(string)
|
|
|
|
|
}
|
|
|
|
|
if err := rpcPoolFirst.Call("Responder.Status", "", &status); err != nil { // Make sure second time we land on the same instance
|
|
|
|
|
t.Error(err)
|
|
|
|
|
} else if status[utils.InstanceID].(string) != ral1ID {
|
|
|
|
|
t.Errorf("Expecting:\n%s\nReceived:\n%s", ral1ID, status[utils.InstanceID].(string))
|
|
|
|
|
} else if status[utils.NodeID].(string) != ral1ID {
|
|
|
|
|
t.Errorf("Expecting:\n%s\nReceived:\n%s", ral1ID, status[utils.NodeID].(string))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -204,13 +204,13 @@ func TestRPCITLclBcastStatusInitial(t *testing.T) {
|
|
|
|
|
var status map[string]interface{}
|
|
|
|
|
if err := rpcPoolBroadcast.Call("Responder.Status", "", &status); err != nil {
|
|
|
|
|
t.Error(err)
|
|
|
|
|
} else if status[utils.InstanceID].(string) == "" {
|
|
|
|
|
t.Error("Empty InstanceID received")
|
|
|
|
|
} else if status[utils.NodeID].(string) == "" {
|
|
|
|
|
t.Error("Empty NodeID received")
|
|
|
|
|
}
|
|
|
|
|
if err := rpcPoolBroadcast.Call("Responder.Status", "", &status); err != nil {
|
|
|
|
|
t.Error(err)
|
|
|
|
|
} else if status[utils.InstanceID].(string) == "" {
|
|
|
|
|
t.Error("Empty InstanceID received")
|
|
|
|
|
} else if status[utils.NodeID].(string) == "" {
|
|
|
|
|
t.Error("Empty NodeID received")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -222,13 +222,13 @@ func TestRPCITLclBcastStatusNoRals1(t *testing.T) {
|
|
|
|
|
var status map[string]interface{}
|
|
|
|
|
if err := rpcPoolBroadcast.Call("Responder.Status", "", &status); err != nil {
|
|
|
|
|
t.Error(err)
|
|
|
|
|
} else if status[utils.InstanceID].(string) == "" {
|
|
|
|
|
t.Error("Empty InstanceID received")
|
|
|
|
|
} else if status[utils.NodeID].(string) == "" {
|
|
|
|
|
t.Error("Empty NodeID received")
|
|
|
|
|
}
|
|
|
|
|
if err := rpcPoolBroadcast.Call("Responder.Status", "", &status); err != nil {
|
|
|
|
|
t.Error(err)
|
|
|
|
|
} else if status[utils.InstanceID].(string) == "" {
|
|
|
|
|
t.Error("Empty InstanceID received")
|
|
|
|
|
} else if status[utils.NodeID].(string) == "" {
|
|
|
|
|
t.Error("Empty NodeID received")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -250,13 +250,13 @@ func TestRPCITLclBcastStatusRALs2Up(t *testing.T) {
|
|
|
|
|
var status map[string]interface{}
|
|
|
|
|
if err := rpcPoolBroadcast.Call("Responder.Status", "", &status); err != nil {
|
|
|
|
|
t.Error(err)
|
|
|
|
|
} else if status[utils.InstanceID].(string) == "" {
|
|
|
|
|
t.Error("Empty InstanceID received")
|
|
|
|
|
} else if status[utils.NodeID].(string) == "" {
|
|
|
|
|
t.Error("Empty NodeID received")
|
|
|
|
|
}
|
|
|
|
|
if err := rpcPoolBroadcast.Call("Responder.Status", "", &status); err != nil {
|
|
|
|
|
t.Error(err)
|
|
|
|
|
} else if status[utils.InstanceID].(string) == "" {
|
|
|
|
|
t.Error("Empty InstanceID received")
|
|
|
|
|
} else if status[utils.NodeID].(string) == "" {
|
|
|
|
|
t.Error("Empty NodeID received")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -267,12 +267,12 @@ func TestRPCITLclStatusBcastRALs1Up(t *testing.T) {
|
|
|
|
|
var status map[string]interface{}
|
|
|
|
|
if err := rpcPoolBroadcast.Call("Responder.Status", "", &status); err != nil {
|
|
|
|
|
t.Error(err)
|
|
|
|
|
} else if status[utils.InstanceID].(string) == "" {
|
|
|
|
|
} else if status[utils.NodeID].(string) == "" {
|
|
|
|
|
t.Error("Empty InstanceID received")
|
|
|
|
|
}
|
|
|
|
|
if err := rpcPoolBroadcast.Call("Responder.Status", "", &status); err != nil {
|
|
|
|
|
t.Error(err)
|
|
|
|
|
} else if status[utils.InstanceID].(string) == "" {
|
|
|
|
|
} else if status[utils.NodeID].(string) == "" {
|
|
|
|
|
t.Error("Empty InstanceID received")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -340,15 +340,15 @@ func TestRPCITRmtStatusFirstInitial(t *testing.T) {
|
|
|
|
|
var status map[string]interface{}
|
|
|
|
|
if err := rpcPoolFirst.Call("Responder.Status", "", &status); err != nil {
|
|
|
|
|
t.Error(err)
|
|
|
|
|
} else if status[utils.InstanceID].(string) == "" {
|
|
|
|
|
t.Error("Empty InstanceID received")
|
|
|
|
|
} else if status[utils.NodeID].(string) == "" {
|
|
|
|
|
t.Error("Empty NodeID received")
|
|
|
|
|
} else {
|
|
|
|
|
ralRmtID = status[utils.InstanceID].(string)
|
|
|
|
|
ralRmtID = status[utils.NodeID].(string)
|
|
|
|
|
}
|
|
|
|
|
if err := rpcPoolFirst.Call("Responder.Status", "", &status); err != nil { // Make sure second time we land on the same instance
|
|
|
|
|
t.Error(err)
|
|
|
|
|
} else if status[utils.InstanceID].(string) != ralRmtID {
|
|
|
|
|
t.Errorf("Expecting:\n%s\nReceived:\n%s", ralRmtID, status[utils.InstanceID].(string))
|
|
|
|
|
} else if status[utils.NodeID].(string) != ralRmtID {
|
|
|
|
|
t.Errorf("Expecting:\n%s\nReceived:\n%s", ralRmtID, status[utils.NodeID].(string))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -366,18 +366,18 @@ func TestRPCITRmtStatusFirstFailover(t *testing.T) {
|
|
|
|
|
var status map[string]interface{}
|
|
|
|
|
if err := rpcPoolFirst.Call("Responder.Status", "", &status); err != nil {
|
|
|
|
|
t.Error(err)
|
|
|
|
|
} else if status[utils.InstanceID].(string) == "" {
|
|
|
|
|
t.Error("Empty InstanceID received")
|
|
|
|
|
} else if status[utils.InstanceID].(string) == ralRmtID {
|
|
|
|
|
} else if status[utils.NodeID].(string) == "" {
|
|
|
|
|
t.Error("Empty NodeID received")
|
|
|
|
|
} else if status[utils.NodeID].(string) == ralRmtID {
|
|
|
|
|
t.Fatal("Did not failover")
|
|
|
|
|
} else {
|
|
|
|
|
ralRmtID = status[utils.InstanceID].(string)
|
|
|
|
|
ralRmtID = status[utils.NodeID].(string)
|
|
|
|
|
}
|
|
|
|
|
if err := rpcPoolFirst.Call("Responder.Status", "", &status); err != nil {
|
|
|
|
|
t.Error(err)
|
|
|
|
|
} else if status[utils.InstanceID].(string) == "" {
|
|
|
|
|
t.Error("Empty InstanceID received")
|
|
|
|
|
} else if status[utils.InstanceID].(string) != ralRmtID {
|
|
|
|
|
} else if status[utils.NodeID].(string) == "" {
|
|
|
|
|
t.Error("Empty NodeID received")
|
|
|
|
|
} else if status[utils.NodeID].(string) != ralRmtID {
|
|
|
|
|
t.Fatal("Did not do failover")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -396,18 +396,18 @@ func TestRPCITRmtStatusFirstFailback(t *testing.T) {
|
|
|
|
|
var status map[string]interface{}
|
|
|
|
|
if err := rpcPoolFirst.Call("Responder.Status", "", &status); err != nil {
|
|
|
|
|
t.Error(err)
|
|
|
|
|
} else if status[utils.InstanceID].(string) == "" {
|
|
|
|
|
t.Error("Empty InstanceID received")
|
|
|
|
|
} else if status[utils.InstanceID].(string) == ralRmtID {
|
|
|
|
|
} else if status[utils.NodeID].(string) == "" {
|
|
|
|
|
t.Error("Empty NodeID received")
|
|
|
|
|
} else if status[utils.NodeID].(string) == ralRmtID {
|
|
|
|
|
t.Fatal("Did not do failback")
|
|
|
|
|
} else {
|
|
|
|
|
ralRmtID = status[utils.InstanceID].(string)
|
|
|
|
|
ralRmtID = status[utils.NodeID].(string)
|
|
|
|
|
}
|
|
|
|
|
if err := rpcPoolFirst.Call("Responder.Status", "", &status); err != nil {
|
|
|
|
|
t.Error(err)
|
|
|
|
|
} else if status[utils.InstanceID].(string) == "" {
|
|
|
|
|
t.Error("Empty InstanceID received")
|
|
|
|
|
} else if status[utils.InstanceID].(string) != ralRmtID {
|
|
|
|
|
} else if status[utils.NodeID].(string) == "" {
|
|
|
|
|
t.Error("Empty NodeID received")
|
|
|
|
|
} else if status[utils.NodeID].(string) != ralRmtID {
|
|
|
|
|
t.Fatal("Did not do failback")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|