Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ func (s *Server) doModify(cid string, ops []*spb.AFTOperation, resCh chan *spb.M
},
}},
}
return
continue
}

// We do not try and modify entries within the operation in parallel
Expand Down
68 changes: 68 additions & 0 deletions server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1138,6 +1138,74 @@ func TestDoModify(t *testing.T) {
}},
},
}},
}, {
desc: "one invalid operation (invalid NI) followed by one valid operation",
inServer: func() *Server {
s, err := New()
if err != nil {
t.Fatalf("cannot create server, error: %v", err)
}
s.cs["testclient"] = &clientState{
params: &clientParams{
Persist: true,
ExpectElecID: true,
FIBAck: true,
},
lastElecID: &spb.Uint128{High: 42, Low: 42},
}
s.curElecID = &spb.Uint128{High: 42, Low: 42}
s.curMaster = "testclient"
return s
}(),
inCID: "testclient",
inOps: []*spb.AFTOperation{{
Id: 84,
NetworkInstance: "FISH",
Op: spb.AFTOperation_ADD,
ElectionId: &spb.Uint128{High: 42, Low: 42},
Entry: &spb.AFTOperation_NextHop{
NextHop: &aftpb.Afts_NextHopKey{
Index: 1,
NextHop: &aftpb.Afts_NextHop{
IpAddress: &wpb.StringValue{Value: "192.0.2.1"},
},
},
},
}, {
Id: 96,
NetworkInstance: DefaultNetworkInstanceName,
Op: spb.AFTOperation_ADD,
ElectionId: &spb.Uint128{High: 42, Low: 42},
Entry: &spb.AFTOperation_NextHop{
NextHop: &aftpb.Afts_NextHopKey{
Index: 1,
NextHop: &aftpb.Afts_NextHop{
IpAddress: &wpb.StringValue{Value: "192.0.2.1"},
},
},
},
}},
wantMsg: []*expectedMsg{{
result: &spb.ModifyResponse{
Result: []*spb.AFTResult{{
Id: 84,
Status: spb.AFTResult_FAILED,
ErrorDetails: &spb.AFTErrorDetails{
ErrorMessage: `unknown network instance "FISH" specified`,
},
}},
},
}, {
result: &spb.ModifyResponse{
Result: []*spb.AFTResult{{
Id: 96,
Status: spb.AFTResult_RIB_PROGRAMMED,
}, {
Id: 96,
Status: spb.AFTResult_FIB_PROGRAMMED,
}},
},
}},
}}

type recvMsg struct {
Expand Down
Loading