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

Resolve "Segmentation fault through plugin client"

See merge request !619
parent b406addb
No related branches found
No related tags found
1 merge request!619Resolve "Segmentation fault through plugin client"
Pipeline #169384 passed
...@@ -45,7 +45,7 @@ containerlab-destroy: ...@@ -45,7 +45,7 @@ containerlab-destroy:
needs: needs:
[ [
"containerlab-deploy", "containerlab-deploy",
"integration-test:nucleus", #"integration-test:nucleus",
"integration-test:api" "integration-test:api"
] ]
......
...@@ -10,12 +10,13 @@ ...@@ -10,12 +10,13 @@
GOSDN_TEST_USER: "admin" GOSDN_TEST_USER: "admin"
GOSDN_TEST_PASSWORD: "admin" GOSDN_TEST_PASSWORD: "admin"
integration-test:nucleus: # NOTE: Current test setup and runners are changed, therefore this test is not possible to run at the moment
<<: *integration-test #integration-test:nucleus:
script: # <<: *integration-test
- ${CI_PROJECT_DIR}/.gitlab/ci/scripts/wait-for-it.sh ${CEOS_TEST_ENDPOINT} -s -t 180 -- echo "CEOS is up" # script:
- cd controller/ # - ${CI_PROJECT_DIR}/.gitlab/ci/scripts/wait-for-it.sh ${CEOS_TEST_ENDPOINT} -s -t 180 -- echo "CEOS is up"
- make integration-test-nucleus # - cd controller/
# - make integration-test-nucleus
integration-test:api: integration-test:api:
<<: *integration-test <<: *integration-test
......
...@@ -27,6 +27,7 @@ func (m *DeviceModelClient) Unmarshal(json []byte, path *gpb.Path) error { ...@@ -27,6 +27,7 @@ func (m *DeviceModelClient) Unmarshal(json []byte, path *gpb.Path) error {
Json: json, Json: json,
Path: path, Path: path,
}) })
return err return err
} }
...@@ -38,6 +39,7 @@ func (m *DeviceModelClient) SetNode(path *gpb.Path, value *gpb.TypedValue) error ...@@ -38,6 +39,7 @@ func (m *DeviceModelClient) SetNode(path *gpb.Path, value *gpb.TypedValue) error
Path: path, Path: path,
Value: value, Value: value,
}) })
return err return err
} }
...@@ -50,7 +52,11 @@ func (m *DeviceModelClient) GetNode(path *gpb.Path, requestForIntendedState bool ...@@ -50,7 +52,11 @@ func (m *DeviceModelClient) GetNode(path *gpb.Path, requestForIntendedState bool
Path: path, Path: path,
RequestForIntendedState: requestForIntendedState, RequestForIntendedState: requestForIntendedState,
}) })
return resp.GetNodes(), err if err != nil {
return nil, err
}
return resp.GetNodes(), nil
} }
// DeleteNode calls the DeleteNode method of the DeviceModelClients client. A // DeleteNode calls the DeleteNode method of the DeviceModelClients client. A
...@@ -60,6 +66,7 @@ func (m *DeviceModelClient) DeleteNode(path *gpb.Path) error { ...@@ -60,6 +66,7 @@ func (m *DeviceModelClient) DeleteNode(path *gpb.Path) error {
_, err := m.client.DeleteNode(context.Background(), &pb.DeleteNodeRequest{ _, err := m.client.DeleteNode(context.Background(), &pb.DeleteNodeRequest{
Path: path, Path: path,
}) })
return err return err
} }
...@@ -71,7 +78,11 @@ func (m *DeviceModelClient) Model(filterReadOnly bool) ([]byte, error) { ...@@ -71,7 +78,11 @@ func (m *DeviceModelClient) Model(filterReadOnly bool) ([]byte, error) {
resp, err := m.client.Model(context.Background(), &pb.ModelRequest{ resp, err := m.client.Model(context.Background(), &pb.ModelRequest{
FilterReadOnly: filterReadOnly, FilterReadOnly: filterReadOnly,
}) })
return resp.Json, err if err != nil {
return nil, err
}
return resp.Json, nil
} }
// Diff calls the Diff method of the DeviceModelClients client. A request is // Diff calls the Diff method of the DeviceModelClients client. A request is
...@@ -82,7 +93,11 @@ func (m *DeviceModelClient) Diff(original, modified []byte) (*gpb.Notification, ...@@ -82,7 +93,11 @@ func (m *DeviceModelClient) Diff(original, modified []byte) (*gpb.Notification,
Original: original, Original: original,
Modified: modified, Modified: modified,
}) })
return resp.GetNotification(), err if err != nil {
return nil, err
}
return resp.GetNotification(), nil
} }
// ValidateChange calls the ValidateChange method of the DeviceModelClients // ValidateChange calls the ValidateChange method of the DeviceModelClients
...@@ -95,7 +110,11 @@ func (m *DeviceModelClient) ValidateChange(operation mnepb.ApiOperation, path *g ...@@ -95,7 +110,11 @@ func (m *DeviceModelClient) ValidateChange(operation mnepb.ApiOperation, path *g
Path: path, Path: path,
Value: value, Value: value,
}) })
return resp.GetModel(), err if err != nil {
return nil, err
}
return resp.GetModel(), nil
} }
// PruneConfigFalse calls the PruneConfigFalse method of the DeviceModelClients // PruneConfigFalse calls the PruneConfigFalse method of the DeviceModelClients
...@@ -106,6 +125,10 @@ func (m *DeviceModelClient) PruneConfigFalse(value []byte) ([]byte, error) { ...@@ -106,6 +125,10 @@ func (m *DeviceModelClient) PruneConfigFalse(value []byte) ([]byte, error) {
resp, err := m.client.PruneConfigFalse(context.Background(), &pb.PruneConfigFalseRequest{ resp, err := m.client.PruneConfigFalse(context.Background(), &pb.PruneConfigFalseRequest{
Value: value, Value: value,
}) })
if err != nil {
return nil, err
}
return resp.GetModel(), err return resp.GetModel(), err
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment