Skip to content
Snippets Groups Projects
Commit c743e730 authored by Katharina Renk's avatar Katharina Renk
Browse files

modifying request creation

parent 23be9eee
Branches
No related tags found
2 merge requests!784Draft: Resolve "Integration test for Lab01",!757Draft: Resolve "Integration test for Lab01"
Pipeline #185134 failed
...@@ -161,39 +161,34 @@ func TestLab01(t *testing.T) { ...@@ -161,39 +161,34 @@ func TestLab01(t *testing.T) {
// Modify the interface of both managed network elements. // Modify the interface of both managed network elements.
for _, mne := range managedNetworkElements { for _, mne := range managedNetworkElements {
for i := 0; i < len(mne.configEntries); i++ { for i := 0; i < len(mne.configEntries); i++ {
var pathListRequest *mnepb.SetPathListRequest
var err error
// Interface change request // Interface change request
if strings.Contains(mne.configEntries[i].leaf, "eth") { if strings.Contains(mne.configEntries[i].leaf, "eth") {
interfacePathListRequest, err := lab_utils.SetPathListRequestFromJsonImport(pathToInterfaceConfig, mne.configEntries[i].leaf, mne.id, mnepb.ApiOperation_API_OPERATION_UPDATE, mne.configEntries[i].value, pndID) pathListRequest, err = lab_utils.SetPathListRequestFromJsonImport(pathToInterfaceConfig, mne.configEntries[i].leaf, mne.id, mnepb.ApiOperation_API_OPERATION_UPDATE, mne.configEntries[i].value, pndID)
if err != nil {
t.Error(err)
}
setResp, err := mneService.SetPathList(ctx, interfacePathListRequest)
if err != nil {
t.Error(err)
}
// Force-push changes
err = lab_utils.ForcePush(setResp.GetResponses()[0].GetId(), pndID, mneService, ctx)
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
// Route change request // Route change request
} else if strings.Contains(mne.configEntries[i].leaf, "route") { } else if strings.Contains(mne.configEntries[i].leaf, "route") {
routePathListRequest, err := lab_utils.SetPathListRequestFromJsonImport(pathToRouteConfig, mne.configEntries[i].leaf, mne.id, mnepb.ApiOperation_API_OPERATION_UPDATE, mne.configEntries[i].value, pndID) pathListRequest, err = lab_utils.SetPathListRequestFromJsonImport(pathToRouteConfig, mne.configEntries[i].leaf, mne.id, mnepb.ApiOperation_API_OPERATION_UPDATE, mne.configEntries[i].value, pndID)
if err != nil {
t.Error(err)
}
setResp, err := mneService.SetPathList(ctx, routePathListRequest)
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
}
// Force-push changes // Set the requested path on managed network element
err = lab_utils.ForcePush(setResp.GetResponses()[0].GetId(), pndID, mneService, ctx) setResp, err := mneService.SetPathList(ctx, pathListRequest)
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
// Force-push changes
err = lab_utils.ForcePush(setResp.GetResponses()[0].GetId(), pndID, mneService, ctx)
if err != nil {
t.Error(err)
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment