"OperationParams" Type Mismatch in Individual VNF Operation Occurrence Compliance Test

Bug #2052585 reported by Shivam Shukla
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tacker
New
Medium
renu rani

Bug Description

[Issue]

Zuul job for compliance testing in Tacker is currently in a non-voting state. While addressing compliance test , "OperationParams" type mismatch issue is found in Individual VNF Operation Occurrence Compliance Test.

[Issue Detail]

Executed Individual VNF operation occurrence compliance test in Tacker.

<Testcase>
tacker.tests.compliance.sol003.test_vnflcm.IndividualVnfLcmOperationOccurenceTest.test_get_ind_vnf_lcm_op_occs

<Encountered an error> 'operationParam' is not of type object.

<Error message>
<status status="FAIL" starttime="20230904 08:49:24.324" endtime="20230904 08:49:24.423" critical="yes">ValidationError: Validation error for schema VnfLcmOpOcc.schema.json: '{"flavourId": "simple", "extVirtualLinks": [{"id": "net0", "resourceId": "c4370d60-e1bf-4608-be5c-5fc5d31d9b3a", "extCps": [{"cpdId": "CP1", "cpConfig": [{"cpProtocolData": [{"layerProtocol": "IP_OVER_ETHERNET"}]}]}]}], "vimConnectionInfo": [{"id": "16dfa727-a452-4713-912d-db2834479361", "vimId": "752e5d3e-3ebc-4ac8-bc92-a6fcbc291cf8", "vimType": "ETSINFV.OPENSTACK_KEYSTONE.v_2"}]}' is not of type 'object'</status>

<Error location> https://opendev.org/openstack/tacker/src/branch/master/tacker/objects/vnf_lcm_op_occs.py#L250

[Cause]

In NFV-TST 010 “~/api-tests/SOL003/VNFLifecycleManagementAPI/schemas/VnfLcmOpOcc.schema.json” file, there is a validation check that "operationParams" should be of object type.

The type of ‘operationParams’ was validated in the Tacker code side, and it was observed that 'operationParams' is of type string.

<Cause code>
Validation check in ~/apitests/SOL003/VNFLifecycleManagementAPI/schemas/VnfLcmOpOcc.schema.json.

'operationParams' is defined as of type 'string' . https://opendev.org/openstack/tacker/src/branch/master/tacker/objects/vnf_lcm_op_occs.py#L250

[Proposal]

Tacker side code need to be fixed in file ~/tacker/tacker/api/vnflcm/v1/controller.py under “_notification_process” function by converting json_string to dictionary by using json.loads function.

<Impact of approach>
Below LCM operations are directly impacted while changing operation_param data type from string to object.

•Instantiate
def _instantiate : https://github.com/openstack/tacker/blob/c738e956c62b64a42b1cbec120c31ff38d964cb1/tacker/api/vnflcm/v1/controller.py#L729

•Terminate
def _terminate :
https://github.com/openstack/tacker/blob/c738e956c62b64a42b1cbec120c31ff38d964cb1/tacker/api/vnflcm/v1/controller.py#L800

•Heal
def _heal:
https://github.com/openstack/tacker/blob/c738e956c62b64a42b1cbec120c31ff38d964cb1/tacker/api/vnflcm/v1/controller.py#L849

•Cancel
def cancel:
https://github.com/openstack/tacker/blob/c738e956c62b64a42b1cbec120c31ff38d964cb1/tacker/api/vnflcm/v1/controller.py#L1557

•Fail
def _fail:
https://github.com/openstack/tacker/blob/c738e956c62b64a42b1cbec120c31ff38d964cb1/tacker/api/vnflcm/v1/controller.py#L1727

•change external connectivity
def _change_ext_conn:
https://github.com/openstack/tacker/blob/c738e956c62b64a42b1cbec120c31ff38d964cb1/tacker/api/vnflcm/v1/controller.py#L1927

<Impact on db>
Table vnf_lcm_op_occs will be impacted as currently data type of operation_params is longtext.

description: updated
renu rani (renur)
Changed in tacker:
assignee: nobody → renu rani (renur)
description: updated
description: updated
Yasufumi Ogawa (yasufum)
Changed in tacker:
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.