Skip to content
Snippets Groups Projects
Commit db8554f9 authored by Malte Bauch's avatar Malte Bauch
Browse files

Fix failed test: AddDevice of api

parent de6ac193
No related branches found
No related tags found
1 merge request!284Improve usability and better output formatting for gosndc
Pipeline #99503 passed
...@@ -90,7 +90,7 @@ func bootstrapUnitTest() { ...@@ -90,7 +90,7 @@ func bootstrapUnitTest() {
mockPnd.On("PendingChanges").Return([]uuid.UUID{changeUUID}) mockPnd.On("PendingChanges").Return([]uuid.UUID{changeUUID})
mockPnd.On("CommittedChanges").Return([]uuid.UUID{changeUUID}) mockPnd.On("CommittedChanges").Return([]uuid.UUID{changeUUID})
mockPnd.On("GetChange", mock.Anything).Return(mockChange, nil) mockPnd.On("GetChange", mock.Anything).Return(mockChange, nil)
mockPnd.On("AddDevice", mock.Anything, mock.Anything, mock.Anything).Return(nil) mockPnd.On("AddDevice", mock.Anything, mock.Anything, mock.Anything).Return(nil, nil)
mockPnd.On("GetDevice", mock.Anything).Return(&nucleus.CommonDevice{ mockPnd.On("GetDevice", mock.Anything).Return(&nucleus.CommonDevice{
UUID: deviceUUID, UUID: deviceUUID,
Model: &openconfig.Device{}, Model: &openconfig.Device{},
......
...@@ -506,15 +506,16 @@ func (p pndServer) SetOndList(ctx context.Context, request *ppb.SetOndListReques ...@@ -506,15 +506,16 @@ func (p pndServer) SetOndList(ctx context.Context, request *ppb.SetOndListReques
} }
deviceIDs = append(deviceIDs, did) deviceIDs = append(deviceIDs, did)
} }
r := make([]*ppb.SetResponse, len(deviceIDs))
for i, did := range deviceIDs {
r[i] = &ppb.SetResponse{Id: did.String(), Status: ppb.Status_STATUS_OK}
}
return &ppb.SetOndListResponse{ return &ppb.SetOndListResponse{
Timestamp: time.Now().UnixNano(), Timestamp: time.Now().UnixNano(),
Status: ppb.Status_STATUS_OK, Status: ppb.Status_STATUS_OK,
Responses: []*ppb.SetResponse{ Responses: r,
{
Id: "",
Status: ppb.Status_STATUS_OK,
},
},
}, nil }, nil
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment