/** * Copyright Notification * No part of this document may be reproduced, in an electronic retrieval system or otherwise, except as authorized by written permission. * The copyright and the foregoing restriction extend to reproduction in all media. * © 2016, oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC). * All rights reserved. * * @author ETSI * @version $URL: https://oldforge.etsi.org/svn/oneM2M/branches/Release1/ttcn/OneM2M_Testcases.ttcn $ * $Id: OneM2M_Testcases.ttcn 347 2017-08-11 08:48:20Z reinaortega $ * @desc Module containing test cases for oneM2M * */ module OneM2M_Testcases_CSE { import from OneM2M_TestSystem all; import from OneM2M_Templates all; import from OneM2M_Types all;//{type XSD.ID}; import from OneM2M_TypesAndValues all; import from OneM2M_Pixits all; import from LibCommon_Time all; import from OneM2M_Pics all; import from OneM2M_Functions all; import from XSD all; //Demos used for validation purposes group oneM2M_demos { group helpingTestCases {//These are not part of the test suite, just for verification purposes testcase TC_DELETE_RESOURCES() runs on AeSimu system CseSystem { timer t_ac := 5.0; var integer i; var XSD.ID v_resourceAddress; var RequestPrimitive v_request; map(self:mcaPort, system:mcaPort); for (i:=0; i<lengthof(PX_RESOURCES_TO_BE_DELETED); i:= i+1) { v_resourceAddress := f_getResourceAddress() & "/" & PX_RESOURCES_TO_BE_DELETED[i]; v_request := valueof(m_delete(v_resourceAddress, PX_SUPER_AE_ID)); mcaPort.send(m_request(v_request)); t_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { t_ac.stop; log(__SCOPE__ & ":Resource deleted"); setverdict(pass); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { t_ac.stop; log(__SCOPE__ & ":Error while deleting resource"); setverdict(fail); } [] mcaPort.receive { t_ac.stop; log(__SCOPE__ & ":Unexpected message received"); setverdict(inconc); } [] t_ac.timeout { log(__SCOPE__ & ":No answer while deleting resource"); setverdict(inconc); } } } unmap(self:mcaPort, system:mcaPort); stop; } }//end group helpingTestCases }//end group oneM2M_demos group CSE { group Generic { group Create { group g_CSE_GEN_CRE_001 { /** * @desc Check that the IUT accepts the creation of a resource using unstructured resource identifier * */ testcase TC_CSE_GEN_CRE_001_CSR() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_GEN_CRE_001(e_cseRelative)); v_ae1.done; } testcase TC_CSE_GEN_CRE_001_SPR() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_GEN_CRE_001(e_spRelative)); v_ae1.done; } testcase TC_CSE_GEN_CRE_001_ABS() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_GEN_CRE_001(e_absolute)); v_ae1.done; } function f_CSE_GEN_CRE_001(in PrimitiveScope p_primitiveScope) runs on AeSimu { // Local variables var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var AddressingMethod v_addressingMethod; var PrimitiveScope v_primitiveScope; // Test control if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { setverdict(inconc, __SCOPE__ & ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case"); stop; } // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); // Test Body //Force usage of Non-Hierarchical addressing method v_addressingMethod := e_nonHierarchical; v_primitiveScope := p_primitiveScope; v_request := f_getCreateRequestPrimitive(int3, m_createContainerBase, v_resourceIndex); v_request.to_ := f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Container resource created using non-hierarchical addressing method"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while creating container resource using non-hierarchical addressing method"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_GEN_CRE_001 } // end of group g_CSE_GEN_CRE_001 group g_CSE_GEN_CRE_002 { /** * @desc Check that the IUT accepts the creation of a resource using structured resource identifier * */ testcase TC_CSE_GEN_CRE_002_CSR() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_GEN_CRE_002(e_cseRelative)); v_ae1.done; } testcase TC_CSE_GEN_CRE_002_SPR() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_GEN_CRE_002(e_spRelative)); v_ae1.done; } testcase TC_CSE_GEN_CRE_002_ABS() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_GEN_CRE_002(e_absolute)); v_ae1.done; } function f_CSE_GEN_CRE_002(in PrimitiveScope p_primitiveScope) runs on AeSimu { // Local variables var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var AddressingMethod v_addressingMethod; var PrimitiveScope v_primitiveScope; // Test control if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case"); stop; } // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); // Test Body //Force usage of Non-Hierarchical addressing method v_addressingMethod := e_hierarchical; v_primitiveScope := p_primitiveScope; v_request := f_getCreateRequestPrimitive(int3, m_createContainerBase, v_resourceIndex); v_request.to_ := f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Container resource created using hierarchical addressing method"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while creating container resource using hierarchical addressing method"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_GEN_CRE_002 } // end of group g_CSE_GEN_CRE_002 } // end of group Create group Retrieve { group g_CSE_GEN_RET_001 { /** * @desc Check that the IUT accepts the retrieval of a <container> resource using unstructured resource identifier * */ testcase TC_CSE_GEN_RET_001_CSR() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_GEN_RET_001(e_cseRelative)); v_ae1.done; } testcase TC_CSE_GEN_RET_001_SPR() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_GEN_RET_001(e_spRelative)); v_ae1.done; } testcase TC_CSE_GEN_RET_001_ABS() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_GEN_RET_001(e_absolute)); v_ae1.done; } function f_CSE_GEN_RET_001(in PrimitiveScope p_primitiveScope) runs on AeSimu { // Local variables var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var AddressingMethod v_addressingMethod; var PrimitiveScope v_primitiveScope; // Test control if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { setverdict(inconc, __SCOPE__ & ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case"); stop; } // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); // Test Body //Force usage of Non-Hierarchical addressing method v_addressingMethod := e_nonHierarchical; v_primitiveScope := p_primitiveScope; mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope), f_getOriginator(v_resourceIndex)))); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Container resource retrieved using non-hierarchical addressing method"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving container resource using non-hierarchical addressing method"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_GEN_RET_001 } // end of group g_CSE_GEN_RET_001 group g_CSE_GEN_RET_002 { /** * @desc Check that the IUT accepts the retrieval of a <container> resource using structured resource identifier * */ testcase TC_CSE_GEN_RET_002_CSR() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_GEN_RET_002(e_cseRelative)); v_ae1.done; } testcase TC_CSE_GEN_RET_002_SPR() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_GEN_RET_002(e_spRelative)); v_ae1.done; } testcase TC_CSE_GEN_RET_002_ABS() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_GEN_RET_002(e_absolute)); v_ae1.done; } function f_CSE_GEN_RET_002(in PrimitiveScope p_primitiveScope) runs on AeSimu { // Local variables var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var AddressingMethod v_addressingMethod; var PrimitiveScope v_primitiveScope; // Test control if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case"); stop; } // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); // Test Body //Force usage of Non-Hierarchical addressing method v_addressingMethod := e_hierarchical; v_primitiveScope := p_primitiveScope; mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope), f_getOriginator(v_resourceIndex))));tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Container resource retrieved using hierarchical addressing method"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving container resource using hierarchical addressing method"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_GEN_RET_002 } // end of group g_CSE_GEN_RET_002 } // end of group Retrieve group Update { group g_CSE_GEN_UPD_001 { /** * @desc Check that the IUT accepts the update of a <container> resource using unstructured resource identifier * */ testcase TC_CSE_GEN_UPD_001_CSR() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_GEN_UPD_001(e_cseRelative)); v_ae1.done; } testcase TC_CSE_GEN_UPD_001_SPR() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_GEN_UPD_001(e_spRelative)); v_ae1.done; } testcase TC_CSE_GEN_UPD_001_ABS() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_GEN_UPD_001(e_absolute)); v_ae1.done; } function f_CSE_GEN_UPD_001(in PrimitiveScope p_primitiveScope) runs on AeSimu { // Local variables var RequestPrimitive v_updateRequest := valueof(m_updateContainerBase); var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var AddressingMethod v_addressingMethod; var PrimitiveScope v_primitiveScope; // Test control if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { setverdict(inconc, __SCOPE__ & ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case"); stop; } // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); // Test Body //Force usage of Non-Hierarchical addressing method v_addressingMethod := e_nonHierarchical; v_primitiveScope := p_primitiveScope; v_updateRequest.primitiveContent.container.labels := {"MyLabel"}; v_updateRequest := f_getUpdateRequestPrimitive(int3, v_resourceIndex, v_updateRequest); v_updateRequest.to_ := f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope); mcaPort.send(m_request(v_updateRequest)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Container resource updated using non-hierarchical addressing method"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while updating container resource using non-hierarchical addressing method"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while updating resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_GEN_UPD_001 } // end of group g_CSE_GEN_UPD_001 group g_CSE_GEN_UPD_002 { /** * @desc Check that the IUT accepts the update of a <container> resource using structured resource identifier * */ testcase TC_CSE_GEN_UPD_002_CSR() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_GEN_UPD_002(e_cseRelative)); v_ae1.done; } testcase TC_CSE_GEN_UPD_002_SPR() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_GEN_UPD_002(e_spRelative)); v_ae1.done; } testcase TC_CSE_GEN_UPD_002_ABS() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_GEN_UPD_002(e_absolute)); v_ae1.done; } function f_CSE_GEN_UPD_002(in PrimitiveScope p_primitiveScope) runs on AeSimu { // Local variables var RequestPrimitive v_updateRequest := valueof(m_updateContainerBase); var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var AddressingMethod v_addressingMethod; var PrimitiveScope v_primitiveScope; // Test control if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case"); stop; } // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); // Test Body //Force usage of Non-Hierarchical addressing method v_addressingMethod := e_hierarchical; v_primitiveScope := p_primitiveScope; v_updateRequest.primitiveContent.container.labels := {"MyLabel"}; v_updateRequest := f_getUpdateRequestPrimitive(int3, v_resourceIndex, v_updateRequest); v_updateRequest.to_ := f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope); mcaPort.send(m_request(v_updateRequest)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Container resource updated using hierarchical addressing method"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while updating container resource using hierarchical addressing method"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while updating resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_GEN_UPD_002 } // end of group g_CSE_GEN_UPD_002 } // end of group Update group Delete { group g_CSE_GEN_DEL_001 { /** * @desc Check that the IUT accepts the deletion of a <container> resource using unstructured resource identifier * */ testcase TC_CSE_GEN_DEL_001_CSR() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_GEN_DEL_001(e_cseRelative)); v_ae1.done; } testcase TC_CSE_GEN_DEL_001_SPR() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_GEN_DEL_001(e_spRelative)); v_ae1.done; } testcase TC_CSE_GEN_DEL_001_ABS() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_GEN_DEL_001(e_absolute)); v_ae1.done; } function f_CSE_GEN_DEL_001(in PrimitiveScope p_primitiveScope) runs on AeSimu { // Local variables var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var AddressingMethod v_addressingMethod; var PrimitiveScope v_primitiveScope; // Test control if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { setverdict(inconc, __SCOPE__ & ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case"); stop; } // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); // Test Body //Force usage of Non-Hierarchical addressing method v_addressingMethod := e_nonHierarchical; v_primitiveScope := p_primitiveScope; v_request := valueof(m_delete(f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope), f_getOriginator(v_resourceIndex))); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Container resource deleted using non-hierarchical addressing method"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while deleting container resource using non-hierarchical addressing method"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while deleting resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_GEN_DEL_001 } // end of group g_CSE_GEN_DEL_001 group g_CSE_GEN_DEL_002 { /** * @desc Check that the IUT accepts the deletion of a <container> resource using structured resource identifier * */ testcase TC_CSE_GEN_DEL_002_CSR() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_GEN_DEL_002(e_cseRelative)); v_ae1.done; } testcase TC_CSE_GEN_DEL_002_SPR() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_GEN_DEL_002(e_spRelative)); v_ae1.done; } testcase TC_CSE_GEN_DEL_002_ABS() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_GEN_DEL_002(e_absolute)); v_ae1.done; } function f_CSE_GEN_DEL_002(in PrimitiveScope p_primitiveScope) runs on AeSimu { // Local variables var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var AddressingMethod v_addressingMethod; var PrimitiveScope v_primitiveScope; // Test control if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case"); stop; } // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); // Test Body //Force usage of Non-Hierarchical addressing method v_addressingMethod := e_hierarchical; v_primitiveScope := p_primitiveScope; v_request := valueof(m_delete(f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope), f_getOriginator(v_resourceIndex))); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Container resource deleted using hierarchical addressing method"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while deleting container resource using hierarchical addressing method"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while deleting resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_GEN_DEL_002 } // end of group g_CSE_GEN_DEL_002 } // end of group Delete } // end of group Generic group Registration { group Create{ /** * @desc Check that the IUT accepts an AE registration (allowed App-ID, C-AE-ID-STEM not provided by AE) * */ testcase TC_CSE_REG_CRE_001() runs on AeSimu system CseSystem { var MsgIn v_response; var RequestPrimitive v_request; var integer v_cseBaseIndex := -1; var ResourceType v_resourceType := int2; // Test component configuration f_cf01Up(); //Preamble //Test Body v_request := valueof(m_createAe(PX_APP_ID, omit, "SAE-ID-STEM")); v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, -1); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { tc_ac.stop; f_checkAttributesToBeSaved(int2, v_request, v_response.primitive.responsePrimitive); vc_aeAuxIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int2); setverdict(pass, __SCOPE__ & ": AE successfully created."); } [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int2001))) -> value v_response{ tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while creating AE with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating AE"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } /** * @desc Check that the IUT sends a registration CREATE Request with the value of the attribute ATTRIBUTE_NAME of the AE resource * */ testcase TC_CSE_REG_CRE_002() runs on AeSimu system CseSystem { var MsgIn v_response; var RequestPrimitive v_request; var integer v_cseBaseIndex := -1; var ResourceType v_resourceType := int2; // Test component configuration f_cf01Up(); //Preambule //Test Body v_request := valueof(m_createAe(PX_APP_ID, omit, "C-AE-ID-STEM")); v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, -1); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response{ tc_ac.stop; f_checkAttributesToBeSaved(int2, v_request, v_response.primitive.responsePrimitive); vc_aeAuxIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int2); setverdict(pass, __SCOPE__ & ": AE successfully created."); } [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int2001))) -> value v_response{ tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while creating AE with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating AE"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } /** * @desc Check that the IUT accepts a create request of <AE> resource with attributes multiplicity equals to 1 and provided preprovisioned SP_relative_AE_ID. */ testcase TC_CSE_REG_CRE_003() runs on CseSimu system CseSystem{ var integer v_remoteCseIndex := -1; //Test Configuration //f_cf02Up(); //Preamble v_remoteCseIndex := f_cse_registrationRemoteCse(); vc_ae1 := AeSimu.create("AE1") alive; //vc_ae1.start(f_a); } /** * @desc Check that the IUT rejects an AE registration (allowed App-ID, not allowed C-AE-ID-STEM provided by AE) * */ testcase TC_CSE_REG_CRE_004() runs on AeSimu system CseSystem { var MsgIn v_response; var RequestPrimitive v_request; var integer v_cseBaseIndex := -1; var ResourceType v_resourceType := int2; // Test component configuration f_cf01Up(); //Preambule //vc_remoteCseIndex := f_cse_registrationRemoteCse(mw_createRemoteCSEBase); //TODO: create serviceSubscribedProfile, Node, and serviceSubscribedAppRule //v_cseBaseIndex := f_cse_preamble_createServiceSubscribedProfile({"C*"}); //c_CRUDNDi); //Test Body //v_request := valueof(m_createAe(PX_APP_ID, omit, "C-AE-ID-STEM")); f_cse_createResource(int2, m_createAe(PX_APP_ID, omit, "C")); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) { tc_ac.stop; setverdict(pass, __SCOPE__ & ": AE creation rejected."); } [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4005))) -> value v_response{ tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while creating AE with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating AE"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } /** * @desc Check that the IUT accepts an AE registration (allowed App-ID, S-AE-ID-STEM not provided by AE) * */ testcase TC_CSE_REG_CRE_005() runs on InCseSimu system CseSystem { var RequestPrimitive v_request; var integer v_cseBaseIndex := -1; var ResourceType v_resourceType := int2; // Test component configuration f_cf02UpCseSimuMaster(); //Preambule //v_cseBaseIndex := f_cse_preamble_createServiceSubscribedAppRule({"S"});//c_CRUDNDi); vc_remoteCseIndex := f_cse_registrationRemoteCse(mw_createRemoteCSEBase); //Test Body vc_ae1.start(f_cse_createResource(int2, m_createAe(PX_APP_ID, omit, omit))); //v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, v_cseBaseIndex); //mcaPort.send(m_request(v_request)); tc_ac.start; alt{ []mccPort.receive(mw_request(mw_createAEAnnc(f_getResourceAddress(-1,e_hierarchical, e_spRelative) & "/S", "CSE_ID", -))){ tc_ac.stop; setverdict(pass, __SCOPE__ & ": AE creation redirected."); } []mccPort.receive(mw_request(mw_createAEAnnc(f_getResourceAddress(-1,e_hierarchical, e_absolute) & "/S", "CSE_ID", -))){ tc_ac.stop; setverdict(pass, __SCOPE__ & ": AE creation redirected."); } [] mccPort.receive { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while creating AE"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating AE"); } } /*vc_cse1.start(f_cse_receiveCreateRequest(mw_createAEAnnc(-, -, -))); vc_cse1.done;*/ // Postamble f_cse_postamble_deleteResourcesCSE(); // Tear down f_cf02DownCseSimuMaster(); } /** * @desc Check that the IUT accepts an AE re-registration (allowed M2M-SP-assigned AE-ID, S-AE-ID-STEM provided by AE), transfer request to the IN-CSE * */ testcase TC_CSE_REG_CRE_008() runs on InCseSimu system CseSystem { var RequestPrimitive v_request; var integer v_cseBaseIndex := -1; var ResourceType v_resourceType := int2; // Test component configuration f_cf02UpCseSimuMaster(); //Preambule vc_remoteCseIndex := f_cse_registrationRemoteCse(mw_createRemoteCSEBase); vc_ae1.start(f_cse_createResource(int2, m_createAe(PX_APP_ID, omit, "S"))); vc_ae1.done; //TODO: //v_request := valueof(m_delete(f_getResourceAddress(v_aeIndex), f_getOriginator(v_aeIndex))); //mcaPort.send(m_request(v_request)); //Test Body vc_ae1.start(f_cse_createResource(int2, m_createAe(PX_APP_ID, omit, "S"))); tc_ac.start; alt { [] mccPort.receive(mw_request(mw_createAEAnnc(f_getResourceAddress(-1,e_hierarchical, e_spRelative) & "/S", "CSE_ID", -))) { tc_ac.stop; setverdict(pass, __SCOPE__ & ": AE creation redirected."); } [] mccPort.receive(mw_request(mw_createAEAnnc(f_getResourceAddress(-1,e_hierarchical, e_absolute) & "/S", "CSE_ID", -))) { tc_ac.stop; setverdict(pass, __SCOPE__ & ": AE creation redirected."); } [] mccPort.receive { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while creating AE"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating AE"); } } // Postamble f_cse_postamble_deleteResourcesCSE(); // Tear down f_cf02DownCseSimuMaster(); } /** * @desc Check that the IUT accepts an AE re-registration (allowed M2M-SP-assigned AE-ID, S-AE-ID-STEM provided by AE), communication between MN-CSE and IN-CSE * */ testcase TC_CSE_REG_CRE_009() runs on MnCseSimu system CseSystem { var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeAnncIndex := -1; var ResourceType v_resourceType := int2; // Test component configuration f_cf04Up(); //Preambule vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSEBase); v_aeAnncIndex := f_cse_announceResource(int2, m_createAEAnnc(-, -, -, PX_APP_ID, -)); //Test Body v_request := valueof(m_updateAEAnnc(-, -, -, PX_APP_ID, -)); //TODO to double check all parameters v_request := f_getUpdateRequestPrimitive(f_getAnnouncedResourceType(int2),v_aeAnncIndex, v_request);//TODO v_request.from_ := f_getResourceAddress(-1,e_hierarchical, e_absolute) & "/S"; v_request.primitiveContent.aEAnnc.app_ID := PX_APP_ID; v_request.primitiveContent.aEAnnc.labels := {"Credential-ID:None"}; mccPort.send(m_request(v_request)); tc_ac.start; alt { [] mccPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": AE creation redirected."); //continue to test the content } [] mccPort.receive { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while creating AE"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating AE"); } } //v_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); // Postamble f_cse_postamble_deleteResourcesCSE(); // Tear down f_cf04Down(); } /** * @desc Check that the IUT accepts an AE re-registration (allowed M2M-SP-assigned AE-ID, S-AE-ID-STEM provided by AE), transfer response to the AE * */ testcase TC_CSE_REG_CRE_010() runs on AeSimu system CseSystem { var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; // Test component configuration f_cf02Up(); //Preambule vc_cse1.start(f_cse_registrationRemoteCse(mw_createRemoteCSEBase)); vc_cse1.done; v_aeIndex := f_cse_createResource(int2, m_createAe(PX_APP_ID, omit, "S-AE-ID-STEM")); vc_cse1.start(f_cse_resourceAnnouncementHandler()); vc_cse1.done; //TODO Deregister //f_cse_deleteResource(v_aeIndex); v_request := valueof(m_delete(f_getResourceAddress(v_aeIndex), f_getOriginator(v_aeIndex))); mcaPort.send(m_request(v_request)); //Test Body f_cse_createResource(int2, m_createAe(PX_APP_ID, omit, f_getResourceId(vc_resourcesList[v_aeIndex].resource))); vc_cse1.start(f_cse_resourceAnnouncementHandler(PX_CSE_ID, f_getResourceAddress(v_aeIndex, e_nonHierarchical, e_spRelative))); vc_cse1.done; tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { tc_ac.stop; //continue to test the content if (ischosen(v_response.primitive.responsePrimitive.primitiveContent.aE)){ if (v_response.primitive.responsePrimitive.primitiveContent.aE.app_ID == PX_APP_ID){ setverdict(pass, __SCOPE__ & ": AE creation success."); }else{ setverdict(fail, __SCOPE__ & ": Error in AE content."); } }else{ setverdict(fail, __SCOPE__ & ": primitiveContent doesn't exist"); } } [] mcaPort.receive { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while creating AE"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating AE"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf02Down(); }; //end TC_CSE_REG_CRE_010 group g_CSE_REG_CRE_012 { testcase TC_CSE_REG_CRE_012_AE_LBL() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_create := m_createAe(PX_APP_ID, omit, omit); v_create.primitiveContent.aE.labels := {"labels"}; v_ae1.start(TC_CSE_REG_CRE_012(v_create)); v_ae1.done; } testcase TC_CSE_REG_CRE_012_AE_APN() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_create := m_createAe(PX_APP_ID, omit, omit); v_create.primitiveContent.aE.appName := "AeAppName"; v_ae1.start(TC_CSE_REG_CRE_012(v_create)); v_ae1.done; } testcase TC_CSE_REG_CRE_012_AE_POA() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_create := m_createAe(PX_APP_ID, omit, omit); v_create.primitiveContent.aE.pointOfAccess := {PX_AE1_ADDRESS}; v_ae1.start(TC_CSE_REG_CRE_012(v_create)); v_ae1.done; } testcase TC_CSE_REG_CRE_012_AE_NL() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_create := m_createAe(PX_APP_ID, omit, omit); v_create.primitiveContent.aE.nodeLink := "http://127.0.0.1/"; v_ae1.start(TC_CSE_REG_CRE_012(v_create)); v_ae1.done; } testcase TC_CSE_REG_CRE_012_AE_OR() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_create := m_createAe(PX_APP_ID, omit, omit); v_create.primitiveContent.aE.ontologyRef := "MyOntologyRef"; v_ae1.start(TC_CSE_REG_CRE_012(v_create)); v_ae1.done; } function TC_CSE_REG_CRE_012(in template RequestPrimitive p_createAe) runs on AeSimu { //Local variables var MsgIn v_response; var RequestPrimitive v_request; var ResourceType v_resourceType := int2; //AE // Test control // Test component configuration f_cf01Up(); //Test Body v_request := valueof(p_createAe); v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, -1); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) { tc_ac.stop; setverdict(pass, __SCOPE__ & ": AE creation successfull."); } [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int2001))) -> value v_response{ tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while creating AE with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating AE"); } } //Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } } group g_CSE_REG_CRE_013 { /** * @desc Check that the IUT accepts a create request of <remoteCSE> resource with OPTIONAL_ATTRIBUTE. * */ testcase TC_CSE_REG_CRE_013_LBL() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createRemoteCSEBase; const AttributeAux c_optionalAttribute := {"labels", omit}; var CseSimu v_cse1 := CseSimu.create("CSE1") alive; v_createRequest.primitiveContent.remoteCSE.labels := {"MyLabel"}; v_cse1.start(f_CSE_REG_CRE_013(v_createRequest, c_optionalAttribute)); v_cse1.done; } testcase TC_CSE_REG_CRE_013_CST() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createRemoteCSEBase; const AttributeAux c_optionalAttribute := {"cseType", omit}; var CseSimu v_cse1 := CseSimu.create("CSE1") alive; v_createRequest.primitiveContent.remoteCSE.cseType := int1; v_cse1.start(f_CSE_REG_CRE_013(v_createRequest, c_optionalAttribute)); v_cse1.done; } testcase TC_CSE_REG_CRE_013_POA() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createRemoteCSEBase; const AttributeAux c_optionalAttribute := {"pointOfAccess", omit}; var CseSimu v_cse1 := CseSimu.create("CSE1") alive; v_createRequest.primitiveContent.remoteCSE.pointOfAccess := {"http://" & PX_CSE1_ADDRESS & "/"}; v_cse1.start(f_CSE_REG_CRE_013(v_createRequest, c_optionalAttribute)); v_cse1.done; } testcase TC_CSE_REG_CRE_013_NL() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createRemoteCSEBase; const AttributeAux c_optionalAttribute := {"nodeLink", omit}; var CseSimu v_cse1 := CseSimu.create("CSE1") alive; v_createRequest.primitiveContent.remoteCSE.nodeLink := c_defaultNodeID; v_cse1.start(f_CSE_REG_CRE_013(v_createRequest, c_optionalAttribute)); v_cse1.done; } function f_CSE_REG_CRE_013(template RequestPrimitive p_requestPrimitive, in AttributeAux p_optionalAttribute) runs on CseSimu { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var ResourceType v_resourceType := int16; //remoteCSE // Test control // Test component configuration f_cf04Up(); // Test adapter configuration // Preamble // Test Body v_request := f_getCreateRequestPrimitive(v_resourceType, p_requestPrimitive, -1); mccPort.send(m_request(v_request)); tc_ac.start; alt { [] mccPort.receive(mw_response(mw_responsePrimitive(int2001, f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Accepted creation for resource type remoteCSE containing attribute " & p_optionalAttribute.name); f_setResource(v_request.primitiveContent,int16); } [] mccPort.receive(mw_response(mw_responsePrimitiveOK(f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); f_setResource(v_request.primitiveContent,int16); } [] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Accepted creation for resource type remoteCSE without containing attribute " & p_optionalAttribute.name); f_setResource(v_request.primitiveContent,int16); } [] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Rejected creation of resource type remoteCSE containing attribute " & p_optionalAttribute.name); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource type remoteCSE"); } } // Postamble f_cse_postamble_deleteResourcesCSE(); // Tear down f_cf04Down(); }//end f_CSE_REG_CRE_BV_013 }// end group g_CSE_REG_CRE_BV_013 /** * @desc Check that the IUT rejects an AE registration (not allowed App-ID) * */ testcase TC_CSE_REG_CRE_016() runs on AeSimu system CseSystem { var MsgIn v_response; var RequestPrimitive v_request; var integer v_cseBaseIndex := -1; var ResourceType v_resourceType := int2; // Test component configuration f_cf01Up(); //Preambule v_cseBaseIndex := f_cse_preamble_createServiceSubscribedAppRule(-);//c_CRUDNDi); // Test Body v_request := valueof(m_createAe(PX_APP_ID, omit, omit)); v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, v_cseBaseIndex); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) { tc_ac.stop; setverdict(pass, __SCOPE__ & ": AE creation rejected."); } [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4005))) -> value v_response{ tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while creating AE with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating AE"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } /** * @desc Check that the IUT rejects a create request of <AE> resource that doesn’t include the MANDATORY_ATTRIBUTE * */ group g_CSE_REG_CRE_017 { testcase TC_CSE_REG_CRE_017_API() runs on Tester system CseSystem { //Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createAe(PX_APP_ID); v_createRequest.primitiveContent.aE.app_ID := omit; //Mandatory app_ID field is being set empty v_ae1.start(f_CSE_REG_CRE_017(v_createRequest)); v_ae1.done; }//end TC_CSE_REG_CRE_017_API testcase TC_CSE_REG_CRE_017_RR() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createAe(PX_APP_ID); v_createRequest.primitiveContent.aE.requestReachability := omit; //Mandatory requestReachability field is being set empty v_ae1.start(f_CSE_REG_CRE_017(v_createRequest)); v_ae1.done; }//end TC_CSE_REG_CRE_017_RR function f_CSE_REG_CRE_017(template RequestPrimitive p_createRequestPrimitive) runs on AeSimu { //Local variables var ResourceType v_resourceType := int2; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble // Test Body f_cse_createResource(v_resourceType, p_createRequestPrimitive); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) { //BAD REQUEST tc_ac.stop; setverdict(pass, __SCOPE__ & ": Request successfully rejected"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)){ tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error, AE has been registered"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } }//end g_CSE_REG_CRE_017 /** * @desc Check that the IUT accepts an create request of <remoteCSE> resource with attributes multiplicity equals to 1. * */ testcase TC_CSE_REG_CRE_018() runs on CseSimu system CseSystem { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var RequestPrimitive v_createRequestPrimitive := valueof(m_createRemoteCSEBase); var ResourceType v_resourceType := int16; //remoteCSE // Test control // Test component configuration f_cf04Up(); // Test adapter configuration // Preamble // Test Body v_request := f_getCreateRequestPrimitive(v_resourceType, v_createRequestPrimitive, -1); mccPort.send(m_request(v_request)); tc_ac.start; alt { [] mccPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Resource type remoteCSE created successfully"); f_checkAttributesToBeSaved(int16, v_request, v_response.primitive.responsePrimitive); vc_aeAuxIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int16); } [] mccPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); } [] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while creating resource type remoteCSE"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource type remoteCSE"); } } // Postamble f_cse_postamble_deleteResourcesCSE(); // Tear down f_cf04Down(); }//end TC_CSE_REG_CRE_018 /** * @desc Check that the IUT accepts an create request of <remoteCSE> resource with attributes multiplicity equals to 1 without the preconfigured CSE-ID * */ testcase TC_CSE_REG_CRE_019() runs on CseSimu system CseSystem { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var RequestPrimitive v_createRequestPrimitive := valueof(m_createRemoteCSEBase); var ResourceType v_resourceType := int16; //remoteCSE // Test control // Test component configuration f_cf04Up(); // Test adapter configuration // Preamble // Test Body v_request := f_getCreateRequestPrimitive(v_resourceType, v_createRequestPrimitive, -1); mccPort.send(m_request(v_request)); tc_ac.start; alt { [] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Resource type remoteCSE created successfully"); f_checkAttributesToBeSaved(int16, v_request, v_response.primitive.responsePrimitive); vc_aeAuxIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int16); } [] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while creating resource type remoteCSE"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource type remoteCSE"); } } // Postamble f_cse_postamble_deleteResourcesCSE(); // Tear down f_cf04Down(); }//end TC_CSE_REG_CRE_019 /** * @desc Check that the IUT rejects the create request of <CSEBase> resource. * */ testcase TC_CSE_REG_CRE_021() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var ResourceType v_resourceType := int5; //CSEBase // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); // Test Body v_request := f_getCreateRequestPrimitive(v_resourceType, m_createCSEBaseBase, -1); v_request.from_ := f_getOriginator(v_aeIndex); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) { tc_ac.stop; setverdict(pass, __SCOPE__ & ": CSEBase creation rejected."); } [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4005))) -> value v_response{ tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while creating CSEBase with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating CSEBase"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end TC_CSE_REG_CRE_021 /** * @desc Check that the IUT rejects the create request of <CSEBase> resource. * testcase TC_CSE_REG_CRE_027() runs on AeSimu system CseSystem { // Local variables var RequestPrimitive v_request; var integer v_cseBaseIndex := -1; var ResourceType v_resourceType := int2; // Test control // Test component configuration f_cf02Up(); // Test adapter configuration // Preamble vc_cse1.start(f_cse_registrationRemoteCse(mw_createRemoteCSEBase)); // Test Body f_cse_createResource(int2, m_createAe(PX_APP_ID, omit, omit)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) { tc_ac.stop; setverdict(pass, __SCOPE__ & ": AE creation successful."); } [] mcaPort.receive { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while creating AE"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating AE"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf02Down(); }end TC_CSE_REG_CRE_027*/ /** * @desc Check that the IUT rejects registration of already registered AE (C-AE-ID-STEM provided by AE) * */ testcase TC_CSE_REG_CRE_023() runs on AeSimu system CseSystem { var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var ResourceType v_resourceType := int2; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAeWithId("C-AE-ID-STEM");//c_CRUDNDi); //Test Body v_request := valueof(m_createAe(PX_APP_ID, omit, "C-AE-ID-STEM")); v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, v_aeIndex); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4105))) { tc_ac.stop; setverdict(pass, __SCOPE__ & ": AE creation rejected."); } [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4105))) -> value v_response{ tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while creating AE with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating AE"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } /*testcase TC_CSE_REG_CRE_029() runs on CseSimu system CseSystem { var MsgIn v_response; var RequestPrimitive v_request; var RequestPrimitive v_createRequestPrimitive := valueof(m_createRemoteCSEBase); var ResourceType v_resourceType := int16; // Test control // Test component configuration f_cf04Up(); // Test adapter configuration // Preamble v_request := f_getCreateRequestPrimitive(v_resourceType, v_createRequestPrimitive, -1); tc_ac.start; alt { [] mccPort.receive(mw_request(mw_createRemoteCSEBase(PX_CSE_ID,f_getResourceAddress(-1)))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Resource type remoteCSE created successfully"); } [] mccPort.receive { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while creating resource type remoteCSE"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource type remoteCSE"); } } // Postamble f_cse_postamble_deleteResourcesCSE(); // Tear down f_cf04Down(); }*/ /** * @desc Check that IUT accepts a CSE registration request with cseType attribute set to ‘MN_CSE’ * */ testcase TC_CSE_REG_CRE_027() runs on CseSimu system CseSystem { //Local variables var ResourceType v_resourceType := int16; //remoteCSE var RequestPrimitive v_request; var template PrimitiveContent v_contentResponse; // Test control // Test component configuration f_cf04Up(); // Test adapter configuration // Preamble v_request := valueof(m_createRemoteCSEBase); v_request.primitiveContent.remoteCSE.cseType := int2; //MN_CSE v_contentResponse.remoteCSE := mw_contentRemoteCSEBase; v_contentResponse.remoteCSE.cseType := int2; //MN_CSE //Test Body vc_remoteCseIndex := f_cse_registerRemoteCse(v_request, v_contentResponse); //Check if the resource has been deleted or not if(f_cse_isResourcePresent(vc_remoteCseIndex)) { setverdict(pass, __SCOPE__ & ":INFO: Resource created"); } else { setverdict(fail, __SCOPE__ & ":INFO: Resource not created"); } // Postamble f_cse_postamble_deleteResourcesCSE(); // Tear down f_cf04Down(); }//end TC_CSE_REG_CRE_027 /** * @desc Check that IUT accepts a CSE registration request with OPTIONAL_ATTRIBUTE attribute * */ group g_CSE_REG_CRE_028 { testcase TC_CSE_REG_CRE_028_RN() runs on Tester system CseSystem { //Local variables var CseSimu v_cse1 := CseSimu.create("CSE1") alive; var RequestPrimitive v_request; var template PrimitiveContent v_contentResponse; v_request := valueof(m_createRemoteCSEBase); v_request.primitiveContent.remoteCSE.cseType := int2; //MN_CSE v_request.primitiveContent.remoteCSE.resourceName := c_defaultRemoteCSEResourceName; v_contentResponse.remoteCSE := mw_contentRemoteCSEBase; v_contentResponse.remoteCSE.cseType := int2; //MN_CSE v_contentResponse.remoteCSE.resourceName := c_defaultRemoteCSEResourceName; v_cse1.start(f_CSE_REG_CRE_028(v_request, v_contentResponse)); v_cse1.done; } testcase TC_CSE_REG_CRE_028_ET() runs on Tester system CseSystem { //Local variables var CseSimu v_cse1 := CseSimu.create("CSE1") alive; var RequestPrimitive v_request; var template PrimitiveContent v_contentResponse; v_request := valueof(m_createRemoteCSEBase); v_request.primitiveContent.remoteCSE.cseType := int2; //MN_CSE v_request.primitiveContent.remoteCSE.expirationTime := "20301231T012345"; v_contentResponse.remoteCSE := mw_contentRemoteCSEBase; v_contentResponse.remoteCSE.cseType := int2; //MN_CSE v_contentResponse.remoteCSE.expirationTime := "20301231T012345"; v_cse1.start(f_CSE_REG_CRE_028(v_request, v_contentResponse)); v_cse1.done; } testcase TC_CSE_REG_CRE_028_LBL() runs on Tester system CseSystem { //Local variables var CseSimu v_cse1 := CseSimu.create("CSE1") alive; var RequestPrimitive v_request; var template PrimitiveContent v_contentResponse; var Labels v_labels_1 := {"VALUE_1"}; v_request := valueof(m_createRemoteCSEBase); v_request.primitiveContent.remoteCSE.cseType := int2; //MN_CSE v_request.primitiveContent.remoteCSE.labels := v_labels_1; v_contentResponse.remoteCSE := mw_contentRemoteCSEBase; v_contentResponse.remoteCSE.cseType := int2; //MN_CSE v_contentResponse.remoteCSE.labels := v_labels_1; v_cse1.start(f_CSE_REG_CRE_028(v_request, v_contentResponse)); v_cse1.done; } testcase TC_CSE_REG_CRE_028_POA() runs on Tester system CseSystem { //Local variables var CseSimu v_cse1 := CseSimu.create("CSE1") alive; var RequestPrimitive v_request; var template PrimitiveContent v_contentResponse; v_request := valueof(m_createRemoteCSEBase); v_request.primitiveContent.remoteCSE.cseType := int2; //MN_CSE v_request.primitiveContent.remoteCSE.pointOfAccess := {"http://" & PX_CSE1_ADDRESS & "/"}; v_contentResponse.remoteCSE := mw_contentRemoteCSEBase; v_contentResponse.remoteCSE.cseType := int2; //MN_CSE v_contentResponse.remoteCSE.pointOfAccess := {"http://" & PX_CSE1_ADDRESS & "/"}; v_cse1.start(f_CSE_REG_CRE_028(v_request, v_contentResponse)); v_cse1.done; } testcase TC_CSE_REG_CRE_028_NL() runs on Tester system CseSystem { //Local variables var CseSimu v_cse1 := CseSimu.create("CSE1") alive; var RequestPrimitive v_request; var template PrimitiveContent v_contentResponse; v_request := valueof(m_createRemoteCSEBase); v_request.primitiveContent.remoteCSE.cseType := int2; //MN_CSE v_request.primitiveContent.remoteCSE.nodeLink := c_defaultNodeID; v_contentResponse.remoteCSE := mw_contentRemoteCSEBase; v_contentResponse.remoteCSE.cseType := int2; //MN_CSE v_contentResponse.remoteCSE.nodeLink := c_defaultNodeID; v_cse1.start(f_CSE_REG_CRE_028(v_request, v_contentResponse)); v_cse1.done; } function f_CSE_REG_CRE_028(RequestPrimitive p_request, template PrimitiveContent p_contentResponse) runs on CseSimu{ //system CseSystem { //Local variables var ResourceType v_resourceType := int16; //remoteCSE // Test control // Test component configuration f_cf04Up(); // Test adapter configuration // Preamble //Test Body vc_remoteCseIndex := f_cse_registerRemoteCse(p_request, p_contentResponse); //Check if the resource has been deleted or not if(f_cse_isResourcePresent(vc_remoteCseIndex)) { setverdict(pass, __SCOPE__ & ":INFO: Resource created"); } else { setverdict(fail, __SCOPE__ & ":INFO: Resource not created"); } // Postamble f_cse_postamble_deleteResourcesCSE(); // Tear down f_cf04Down(); }//end TC_CSE_REG_CRE_028 }//end g_CSE_REG_CRE_028 } //end group Create group Retrieve{ /** * @desc Check that the IUT accepts an retrieval request of <CSEBase> resource and responds with all attributes that have multiplicity equals to 1. * */ testcase TC_CSE_REG_RET_001() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var template PrimitiveContent v_contentResponse; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); // Test Body v_contentResponse.cSEBase := mw_contentCSEBase_rc1; mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(v_aeIndex))));//TODO Maybe PX_SUPER_AE_ID tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Response OK for retrieving"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end TC_CSE_REG_RET_001 /** * @desc Check that the IUT accepts a retrieval request of <CSEBase> resource with the optional ATTRIBUTE * */ group g_CSE_REG_RET_002 { testcase TC_CSE_REG_RET_002_CST() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.cSEBase := mw_contentCSEBase_rc1; v_contentResponse.cSEBase.cseType := ?; v_ae1.start(f_CSE_REG_RET_002(v_contentResponse)); v_ae1.done; } testcase TC_CSE_REG_RET_002_NL() runs on Tester system CseSystem { //Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.cSEBase := mw_contentCSEBase_rc1; v_contentResponse.cSEBase.nodeLink := ?; v_ae1.start(f_CSE_REG_RET_002(v_contentResponse)); v_ae1.done; } function f_CSE_REG_RET_002(template PrimitiveContent p_contentResponse) runs on AeSimu { //Local variables var MsgIn v_response; var integer v_aeIndex := -1; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(v_aeIndex)))); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Response OK for retrieving for attribute"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } //end f_CSE_REG_RET_002 } //end g_CSE_REG_RET_002 /** * @desc Check that the IUT accepts a retrieval request of <AE> resource with attributes multiplicity equals to 1 * */ testcase TC_CSE_REG_RET_003() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var template PrimitiveContent v_contentResponse; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); // Test Body v_contentResponse.aE := mw_contentAeBase; mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(v_aeIndex))));//TODO Maybe PX_SUPER_AE_ID tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Response OK for retrieving"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end TC_CSE_REG_RET_003 /** * @desc Check that the IUT accepts a retrieval request of <AE> resource with optional ATTRIBUTE * */ group g_CSE_REG_RET_004 { testcase TC_CSE_REG_RET_004_LBL() runs on Tester system CseSystem { // Local variables var Labels v_labels_1 := {"VALUE_1"}; var template RequestPrimitive v_createRequest := m_createAe(PX_APP_ID); var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_createRequest.primitiveContent.aE.labels := v_labels_1; v_contentResponse.aE := mw_contentAeBase; v_contentResponse.aE.labels := ?; v_ae1.start(f_CSE_REG_RET_004(v_createRequest, v_contentResponse)); v_ae1.done; } testcase TC_CSE_REG_RET_004_APN() runs on Tester system CseSystem { //Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createAe(PX_APP_ID); var template PrimitiveContent v_contentResponse; v_createRequest.primitiveContent.aE.appName := "AeAppName"; v_contentResponse.aE := mw_contentAeBase; v_contentResponse.aE.appName := ?; v_ae1.start(f_CSE_REG_RET_004(v_createRequest,v_contentResponse)); v_ae1.done; } testcase TC_CSE_REG_RET_004_POA() runs on Tester system CseSystem { //Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createAe(PX_APP_ID); var template PrimitiveContent v_contentResponse; v_createRequest.primitiveContent.aE.pointOfAccess := {PX_AE1_ADDRESS}; v_contentResponse.aE := mw_contentAeBase; v_contentResponse.aE.pointOfAccess := ?; v_ae1.start(f_CSE_REG_RET_004(v_createRequest, v_contentResponse)); v_ae1.done; } testcase TC_CSE_REG_RET_004_NL() runs on Tester system CseSystem { //Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createAe(PX_APP_ID); var template PrimitiveContent v_contentResponse; v_createRequest.primitiveContent.aE.nodeLink := "http://127.0.0.1/"; v_contentResponse.aE := mw_contentAeBase; v_contentResponse.aE.nodeLink := ?; v_ae1.start(f_CSE_REG_RET_004(v_createRequest,v_contentResponse)); v_ae1.done; } testcase TC_CSE_REG_RET_004_CSZ() runs on Tester system CseSystem { //Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createAe(PX_APP_ID); var template PrimitiveContent v_contentResponse; v_createRequest.primitiveContent.aE.contentSerialization := {applicationxml}; v_contentResponse.aE := mw_contentAeBase; v_contentResponse.aE.contentSerialization := ?; v_ae1.start(f_CSE_REG_RET_004(v_createRequest,v_contentResponse)); v_ae1.done; } function f_CSE_REG_RET_004(template RequestPrimitive p_createRequestPrimitive, template PrimitiveContent p_contentResponse) runs on AeSimu { //Local variables var MsgIn v_response; var integer v_aeIndex := -1; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_createResource(int2, p_createRequestPrimitive, -1); mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(v_aeIndex))));//TODO Maybe PX_SUPER_AE_ID tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Response OK for retrieving for attribute"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } //end f_CSE_REG_RET_004 } //end g_CSE_REG_RET_004 /** * @desc Check that the IUT accepts a retrieval request of <CSEBase> resource including the cseType attribute * */ testcase TC_CSE_REG_RET_005() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var template PrimitiveContent v_contentResponse; // Test control if(not(PICS_IN_CSE)) { setverdict(inconc, __SCOPE__ & ": IUT shall be IN-CSE to run this test case"); stop; } // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); // Test Body v_contentResponse.cSEBase := mw_contentCSEBase_rc1; v_contentResponse.cSEBase.cseType := int1; mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(v_aeIndex))));//TODO Maybe PX_SUPER_AE_ID tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": cseType attribute is set to 1 (IN_CSE)"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end TC_CSE_REG_RET_BV_005 /** * @desc Check that the IUT accepts a retrieval request of <remoteCSE> resource * */ testcase TC_CSE_REG_RET_006() runs on CseSimu system CseSystem { //Local variables //Local variables var MsgIn v_response; var RequestPrimitive v_request; var ResourceType v_resourceType := int16; //remoteCSE var template PrimitiveContent v_contentResponse; // Test control // Test component configuration f_cf04Up(); // Test adapter configuration // Preamble if(PICS_IN_CSE){ vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSEBase); v_contentResponse.remoteCSE := mw_contentRemoteCSEBase; mccPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(vc_remoteCseIndex)))); tc_ac.start; alt { [] mccPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Response OK for retrieving"); } [] mccPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements"); } [] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } } else if (PICS_MN_CSE) { vc_remoteCseIndex := f_cse_registrationRemoteCse(m_createRemoteCSEBase); v_contentResponse.remoteCSE := mw_contentRemoteCSEBase; mccPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(vc_remoteCseIndex)))); tc_ac.start; alt { [] mccPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Response OK for retrieving"); } [] mccPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements"); } [] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } } // Postamble f_cse_postamble_deleteResourcesCSE(); // Tear down f_cf04Down(); }//end TC_CSE_REG_RET_006 /** * @desc Check that the IUT accepts an retrieval request of <remoteCSE> resource with optional ATTRIBUTE * */ group g_CSE_REG_RET_007 { testcase TC_CSE_REG_RET_007_LBL() runs on Tester system CseSystem { // Local variables var CseSimu v_cse1 := CseSimu.create("CSE1") alive; var Labels v_labels_1 := {"VALUE_1"}; var template RequestPrimitive v_createRequest := m_createRemoteCSEBase; var template PrimitiveContent v_contentResponse; v_createRequest.primitiveContent.remoteCSE.labels := v_labels_1; v_contentResponse.remoteCSE := mw_contentRemoteCSEBase; v_contentResponse.remoteCSE.labels := ?; v_cse1.start(f_CSE_REG_RET_007(v_createRequest, v_contentResponse)); v_cse1.done; } testcase TC_CSE_REG_RET_007_CST() runs on Tester system CseSystem { // Local variables var CseSimu v_cse1 := CseSimu.create("CSE1") alive; var template RequestPrimitive v_createRequest := m_createRemoteCSEBase; var template PrimitiveContent v_contentResponse; v_createRequest.primitiveContent.remoteCSE.cseType := int1; v_contentResponse.remoteCSE := mw_contentRemoteCSEBase; v_contentResponse.remoteCSE.cseType := ?; v_cse1.start(f_CSE_REG_RET_007(v_createRequest, v_contentResponse)); v_cse1.done; } testcase TC_CSE_REG_RET_007_POA() runs on Tester system CseSystem { // Local variables var CseSimu v_cse1 := CseSimu.create("CSE1") alive; var template RequestPrimitive v_createRequest := m_createRemoteCSEBase; var template PrimitiveContent v_contentResponse; v_createRequest.primitiveContent.remoteCSE.pointOfAccess := {"http://" & PX_CSE1_ADDRESS & "/"}; v_contentResponse.remoteCSE := mw_contentRemoteCSEBase; v_contentResponse.remoteCSE.pointOfAccess := ?; v_cse1.start(f_CSE_REG_RET_007(v_createRequest, v_contentResponse)); v_cse1.done; } testcase TC_CSE_REG_RET_007_NL() runs on Tester system CseSystem { // Local variables var CseSimu v_cse1 := CseSimu.create("CSE1") alive; var template RequestPrimitive v_createRequest := m_createRemoteCSEBase; var template PrimitiveContent v_contentResponse; v_createRequest.primitiveContent.remoteCSE.nodeLink := c_defaultNodeID; v_contentResponse.remoteCSE := mw_contentRemoteCSEBase; v_contentResponse.remoteCSE.nodeLink := ?; v_cse1.start(f_CSE_REG_RET_007(v_createRequest, v_contentResponse)); v_cse1.done; } function f_CSE_REG_RET_007(template RequestPrimitive p_createRequestPrimitive, template PrimitiveContent p_contentResponse) runs on CseSimu { var MsgIn v_response; var RequestPrimitive v_request; var ResourceType v_resourceType := int16; //remoteCSE var template PrimitiveContent v_contentResponse; // Test control // Test component configuration f_cf04Up(); // Test adapter configuration // Preamble if(PICS_IN_CSE){ vc_remoteCseIndex := f_cse_registerRemoteCse(p_createRequestPrimitive); mccPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(vc_remoteCseIndex)))); tc_ac.start; alt { [] mccPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Response OK for retrieving for attribute"); } [] mccPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements"); } [] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } } else if (PICS_MN_CSE){ vc_remoteCseIndex := f_cse_registrationRemoteCse(p_createRequestPrimitive); mccPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(vc_remoteCseIndex)))); tc_ac.start; alt { [] mccPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Response OK for retrieving for attribute"); } [] mccPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements"); } [] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } } //Postamble f_cse_postamble_deleteResourcesCSE(); // Tear down f_cf04Down(); } // f_CSE_REG_RET_007 } //end g_CSE_REG_RET_007 /** * @desc Check that the IUT accepts a retrieval request of <CSEBase> resource and responds with supportedResourceTypes attribute containing a list of the supported resources and pointOfAccess containing the list of physical addresses to be used by Registree to connect to this CSE (e.g. IP address, FQDN). * */ testcase TC_CSE_REG_RET_008() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var template PrimitiveContent v_contentResponse; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); // Test Body v_contentResponse.cSEBase := mw_contentCSEBase_rc1; mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(v_aeIndex))));//TODO Maybe PX_SUPER_AE_ID tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))) -> value v_response { tc_ac.stop; if (v_response.primitive.responsePrimitive.primitiveContent.cSEBase.supportedResourceType == PX_SRT) { setverdict(pass, __SCOPE__ & ": supportedResourceTypes attribute is set according to PX_SRT"); }else{ setverdict(fail, __SCOPE__ & ": supportedResourceTypes attribute is not set according to PX_SRT"); } if (v_response.primitive.responsePrimitive.primitiveContent.cSEBase.pointOfAccess==PX_POA){ setverdict(pass, __SCOPE__ & ": supportedResourceTypes attribute is set according to PX_POA"); }else{ setverdict(fail, __SCOPE__ & ": supportedResourceTypes attribute is not set according to PX_POA"); } } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end TC_CSE_REG_RET_008 /** * @desc Check that the IUT sends a <remoteCSE> retrieve request on TARGET_REMOTE_CSE_ADDRESS * */ testcase TC_CSE_REG_RET_009() runs on CseSimu system CseSystem { //Local variables //Local variables var MsgIn v_response; var RequestPrimitive v_request; var ResourceType v_resourceType := int16; //remoteCSE var template PrimitiveContent v_contentResponse; var template UtTriggerPrimitive v_utRequest; // Test control if(not(PICS_MN_CSE)) { setverdict(inconc, __SCOPE__ & ": IUT shall be MN-CSE to run this test case"); stop; } // Test component configuration f_cf04Up(); // Test adapter configuration // Preamble vc_remoteCseIndex := f_cse_registrationRemoteCse(m_createRemoteCSEBase); //Send Trigger Message v_utRequest := m_utRetrieveResource(f_getLocalResourceAddress(vc_remoteCseIndex), PX_CSE_ID); v_utRequest.from_ := "UNINITIALIZED"; f_sendUtPrimitive(v_utRequest); tc_ac.start; alt { [] mccPortIn.receive(mw_request(mw_retrieveResource(f_getResourceAddress()))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Retrieve Request received successfully"); } [] mccPortIn.receive { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error Retrieve request was not received"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while waiting to receive Retrieve request"); } } // Postamble f_cse_postamble_deleteResourcesCSE(); // Tear down f_cf04Down(); }//end TC_CSE_REG_RET_009 /** * @desc Check that IUT accepts a <remoteCSE> retrieve request * */ testcase TC_CSE_REG_RET_010() runs on CseSimu system CseSystem { //Local variables var MsgIn v_response; var RequestPrimitive v_request; var ResourceType v_resourceType := int16; //remoteCSE var template PrimitiveContent v_contentResponse; var template UtTriggerPrimitive v_utRequest := m_utCreateRemoteCSE; // Test control if(not(PICS_MN_CSE)) { setverdict(inconc, __SCOPE__ & ": IUT shall be MN-CSE to run this test case"); stop; } // Test component configuration f_cf04Up(); // Test adapter configuration // Preamble vc_remoteCseIndex := f_cse_registrationRemoteCse(m_createRemoteCSEBase); v_contentResponse.remoteCSE := mw_contentRemoteCSEBase; mccPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(vc_remoteCseIndex)))); tc_ac.start; alt { [] mccPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Response OK for retrieving"); } [] mccPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements"); } [] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } // Postamble f_cse_postamble_deleteResourcesCSE(); // Tear down f_cf04Down(); }//end TC_CSE_REG_RET_010 }//end group Retrieve group Update{ /** * @desc Check that the IUT rejects the update request of <CSEBase> resource. * */ testcase TC_CSE_REG_UPD_001() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var Labels v_labels_1 := {"VALUE_1"}; var template RequestPrimitive v_updateRequest := m_updateCSEBaseBase; const integer c_cseBaseIndex := -1; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); // Test Body v_updateRequest.primitiveContent.cSEBase.labels := v_labels_1; v_request := f_getUpdateRequestPrimitive(int5, c_cseBaseIndex, v_updateRequest); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) { tc_ac.stop; setverdict(pass, __SCOPE__ & ": CSEBase update rejected."); } [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4005))) -> value v_response{ tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while updating CSEBase with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while updating CSEBase"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }; //end TC_CSE_REG_UPD_BI_001 /** * @desc Check that the IUT accepts an update request of <remoteCSE> resource with OPTIONAL_ATTRIBUTE. * */ group g_CSE_REG_UPD_002 { testcase TC_CSE_REG_UPD_002_ET() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase; var CseSimu v_cse1 := CseSimu.create("CSE1") alive; v_updateRequest.primitiveContent.remoteCSE.expirationTime := "20301231T012345"; v_cse1.start(f_CSE_REG_UPD_002(v_updateRequest)); v_cse1.done; } testcase TC_CSE_REG_UPD_002_LBL() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase; var CseSimu v_cse1 := CseSimu.create("CSE1") alive; v_updateRequest.primitiveContent.remoteCSE.labels := {"MyLabel"}; v_cse1.start(f_CSE_REG_UPD_002(v_updateRequest)); v_cse1.done; } testcase TC_CSE_REG_UPD_002_POA() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase; var CseSimu v_cse1 := CseSimu.create("CSE1") alive; v_updateRequest.primitiveContent.remoteCSE.pointOfAccess := {"http://" & PX_CSE1_ADDRESS & "/"}; v_cse1.start(f_CSE_REG_UPD_002(v_updateRequest)); v_cse1.done; } testcase TC_CSE_REG_UPD_002_NL() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase; var CseSimu v_cse1 := CseSimu.create("CSE1") alive; v_updateRequest.primitiveContent.remoteCSE.nodeLink := c_defaultNodeID; v_cse1.start(f_CSE_REG_UPD_002(v_updateRequest)); v_cse1.done; } testcase TC_CSE_REG_UPD_002_RR() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase; var CseSimu v_cse1 := CseSimu.create("CSE1") alive; v_updateRequest.primitiveContent.remoteCSE.requestReachability := true; v_cse1.start(f_CSE_REG_UPD_002(v_updateRequest)); v_cse1.done; } function f_CSE_REG_UPD_002(template RequestPrimitive p_requestPrimitive) runs on CseSimu { //Local variables var MsgIn v_response; var RequestPrimitive v_request; var ResourceType v_resourceType := int16; //remoteCSE // Test control // Test component configuration f_cf04Up(); // Test adapter configuration // Preamble vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSEBase); // Test Body v_request := f_getUpdateRequestPrimitive(int16, vc_remoteCseIndex, p_requestPrimitive); mccPort.send(m_request(v_request)); tc_ac.start; alt { [] mccPort.receive(mw_response(mw_responsePrimitive(int2004, f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Accepted updation for resource type remoteCSE containing attribute "); } [] mccPort.receive(mw_response(mw_responsePrimitiveOK(f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); } [] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Accepted updation for resource type remoteCSE without containing attribute "); } [] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Rejected updation of resource type remoteCSE containing attribute"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while updating resource type remoteCSE"); } } // Postamble f_cse_postamble_deleteResourcesCSE(); // Tear down f_cf04Down(); }//end f_CSE_REG_UPD_002 } //end g_CSE_REG_UPD_002 group g_CSE_REG_UPD_003 { testcase TC_CSE_REG_UPD_003_ET() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase; const AttributeAux c_optionalAttribute := {"expirationTime", omit}; var CseSimu v_cse1 := CseSimu.create("CSE1") alive; v_updateRequest.primitiveContent.remoteCSE.expirationTime := "20301231T012345"; v_cse1.start(f_CSE_REG_UPD_003(v_updateRequest, c_optionalAttribute)); v_cse1.done; } testcase TC_CSE_REG_UPD_003_LBL() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase; const AttributeAux c_optionalAttribute := {"labels", omit}; var CseSimu v_cse1 := CseSimu.create("CSE1") alive; v_updateRequest.primitiveContent.remoteCSE.labels := {"MyLabel"}; v_cse1.start(f_CSE_REG_UPD_003(v_updateRequest, c_optionalAttribute)); v_cse1.done; } testcase TC_CSE_REG_UPD_003_POA() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase; const AttributeAux c_optionalAttribute := {"pointofAccess", omit}; var CseSimu v_cse1 := CseSimu.create("CSE1") alive; v_updateRequest.primitiveContent.remoteCSE.pointOfAccess := {"http://" & PX_CSE1_ADDRESS & "/"}; v_cse1.start(f_CSE_REG_UPD_003(v_updateRequest, c_optionalAttribute)); v_cse1.done; } testcase TC_CSE_REG_UPD_003_NL() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase; const AttributeAux c_optionalAttribute := {"nodeLink", omit}; var CseSimu v_cse1 := CseSimu.create("CSE1") alive; v_updateRequest.primitiveContent.remoteCSE.nodeLink := c_defaultNodeID; v_cse1.start(f_CSE_REG_UPD_003(v_updateRequest, c_optionalAttribute)); v_cse1.done; } testcase TC_CSE_REG_UPD_003_RR() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase; const AttributeAux c_optionalAttribute := {"requestReachability", omit}; var CseSimu v_cse1 := CseSimu.create("CSE1") alive; v_updateRequest.primitiveContent.remoteCSE.requestReachability := true; v_cse1.start(f_CSE_REG_UPD_003(v_updateRequest, c_optionalAttribute)); v_cse1.done; } function f_CSE_REG_UPD_003(template RequestPrimitive p_requestPrimitive, in AttributeAux p_Attribute) runs on CseSimu { // Local variables //Local variables var MsgIn v_response; var RequestPrimitive v_request; var ResourceType v_resourceType := int16; //remoteCSE var template UtTriggerPrimitive v_utRequest := m_utCreateRemoteCSE; // Test control if(not(PICS_MN_CSE)) { setverdict(inconc, __SCOPE__ & ": IUT shall be MN-CSE to run this test case"); stop; } // Test component configuration f_cf04Up(); // Test adapter configuration // Preamble vc_remoteCseIndex := f_cse_registrationRemoteCse(m_createRemoteCSEBase); //Send Trigger Message v_utRequest.to_ := f_getResourceAddress(); v_utRequest.from_ := "UNINITIALIZED"; f_sendUtPrimitive(v_utRequest); // Test Body v_request := f_getUpdateRequestPrimitive(int16, vc_remoteCseIndex, p_requestPrimitive); mccPort.send(m_request(v_request)); tc_ac.start; alt { [] mccPort.receive(mw_response(mw_responsePrimitive(int2004, f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Accepted updation for resource type remoteCSE containing attribute " & p_Attribute.name); f_setResource(v_request.primitiveContent,int16); } [] mccPort.receive(mw_response(mw_responsePrimitiveOK(f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); f_setResource(v_request.primitiveContent,int16); } [] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Accepted updation for resource type remoteCSE without containing attribute " & p_Attribute.name); f_setResource(v_request.primitiveContent,int16); } [] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Rejected updation of resource type remoteCSE containing attribute" & p_Attribute.name); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while updating resource type remoteCSE"); } } // Postamble f_cse_postamble_deleteResourcesCSE(); // Tear down f_cf04Down(); }//end f_CSE_REG_UPD_003 } //end g_CSE_REG_UPD_003 }// end group Update group Delete{ /** * @desc Check that the IUT rejects the delete request of <CSEBase> resource. * */ testcase TC_CSE_REG_DEL_001() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); // Test Body v_request := valueof(m_delete(f_getResourceAddress(), f_getOriginator())); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) { tc_ac.stop; setverdict(pass, __SCOPE__ & ": CSEBase deletion rejected."); } [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4005))) -> value v_response{ tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while deleting CSEBase with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while deleting CSEBase"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end TC_CSE_REG_DEL_001 /** * @desc Check that IUT accepts a <remoteCSE> delete request on TARGET_REMOTE_CSE_ADDRESS, and deletes the <remoteCSE> resource * */ testcase TC_CSE_REG_DEL_002() runs on CseSimu system CseSystem { //Local variables var RequestPrimitive v_request; // Test control // Test component configuration f_cf04Up(); // Test adapter configuration // Preamble vc_remoteCseIndex := f_cse_registrationRemoteCse(mw_createRemoteCSEBase); // Test Body v_request := valueof(m_delete(f_getResourceAddress(vc_remoteCseIndex), f_getOriginator(vc_remoteCseIndex))); mccPort.send(m_request(v_request)); tc_ac.start; alt { [] mccPort.receive(mw_response(mw_responsePrimitive(int2002))) { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Deletion of <remoteCSE> resource has been accepted"); } [] mccPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); } [] mccPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while deleting <remoteCSE> resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while deleting resource"); } } // Check if the resource has been deleted or not if(f_cse_isResourcePresent(vc_remoteCseIndex)) { setverdict(fail, __SCOPE__ & ":INFO: Resource not deleted"); } else { setverdict(pass, __SCOPE__ & ":INFO: Resource deleted"); } // Postamble f_cse_postamble_deleteResourcesCSE(); // Tear down f_cf04Down(); }//end TC_CSE_REG_DEL_002 /** * @desc Check that the IUT accepts an AE de-registration * */ testcase TC_CSE_REG_DEL_003() runs on AeSimu system CseSystem { //Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); // Test Body v_request := valueof(m_delete(f_getResourceAddress(v_aeIndex), f_getOriginator(v_aeIndex))); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) { tc_ac.stop; setverdict(pass, __SCOPE__ & ": AE has been de-registered successfully"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while de-registering AE"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while de-registering AE"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end TC_CSE_REG_DEL_003 /** * @desc Check that IUT sends a <remoteCSE> delete request on TARGET_REMOTE_CSE_ADDRESS * */ testcase TC_CSE_REG_DEL_004() runs on CseSimu system CseSystem { //Local variables var template UtTriggerPrimitive v_utRequest := m_utDeleteRequest; var UtTriggerAckPrimitive v_trigger_response; var integer v_auxInteger; // Test control // Test component configuration f_cf04Up(); // Test adapter configuration // Preamble vc_remoteCseIndex := f_cse_registrationRemoteCse(mw_createRemoteCSEBase); //Send Trigger Message v_auxInteger := f_setResource(valueof(m_primitiveContentRemoteCSE(m_contentCreateRemoteCSE(omit,omit,omit,omit))), int16); v_utRequest.to_ := f_getResourceAddress(v_auxInteger); v_utRequest.from_ := "UNINITIALIZED"; f_sendUtPrimitive(v_utRequest); // Test Body tc_ac.start; alt { [] mccPortIn.receive(mw_request(mw_deleteRequest( f_getResourceAddress(vc_remoteCseIndex), PX_CSE_ID))) { tc_ac.stop; setverdict(pass, __SCOPE__ & ": <remoteCSE> delete request has been received"); } [] mccPortIn.receive { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while receiving <remoteCSE> delete request"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while receiving <remoteCSE> delete request"); } } // Postamble f_cse_postamble_deleteResourcesCSE(); // Tear down f_cf04Down(); }//end TC_CSE_REG_DEL_004 }// end group Delete }//end Registration group Data_Management_and_Repository { group Create { group g_CSE_DMR_CRE_001 { /** * @desc Check that the IUT accepts the creation of a RESOURCE_TYPE resource on the TARGET_RESOURCE_ADDRESS of type PARENT_RESOURCE_TYPE with resource name not provided * */ testcase TC_CSE_DMR_CRE_001_CNT_CB() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createContainerBase; var ResponsePrimitive v_responsePrimitive; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_createRequest.primitiveContent.container.resourceName := omit; v_ae1.start(f_CSE_DMR_CRE_001(int3, v_createRequest, -)); //Container v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(not ispresent(v_responsePrimitive.primitiveContent.container.resourceName)){ setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); } } } testcase TC_CSE_DMR_CRE_001_CNT_AE() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createContainerBase; var ResponsePrimitive v_responsePrimitive; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_createRequest.primitiveContent.container.resourceName := omit; v_ae1.start(f_CSE_DMR_CRE_001(int3, v_createRequest, m_createAeAux(omit,omit)));//Container v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(not ispresent(v_responsePrimitive.primitiveContent.container.resourceName)){ setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); } } } testcase TC_CSE_DMR_CRE_001_CNT_CNT() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createContainerBase; var ResponsePrimitive v_responsePrimitive; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_createRequest.primitiveContent.container.resourceName := omit; v_ae1.start(f_CSE_DMR_CRE_001(int3, v_createRequest, m_createContainerBase));//Container v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(not ispresent(v_responsePrimitive.primitiveContent.container.resourceName)){ setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); } } } testcase TC_CSE_DMR_CRE_001_GRP_CB() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createGroupBase; var ResponsePrimitive v_responsePrimitive; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_createRequest.primitiveContent.group_.resourceName := omit; v_ae1.start(f_CSE_DMR_CRE_001(int9, v_createRequest, -));//Group v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(not ispresent(v_responsePrimitive.primitiveContent.group_.resourceName)){ setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); } } } testcase TC_CSE_DMR_CRE_001_GRP_AE() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createGroupBase; var ResponsePrimitive v_responsePrimitive; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_createRequest.primitiveContent.group_.resourceName := omit; v_ae1.start(f_CSE_DMR_CRE_001(int9, v_createRequest, m_createAeAux(omit,omit)));//Group v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(not ispresent(v_responsePrimitive.primitiveContent.group_.resourceName)){ setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); } } } testcase TC_CSE_DMR_CRE_001_ACP_CB() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createAcpBase; var ResponsePrimitive v_responsePrimitive; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_createRequest.primitiveContent.accessControlPolicy.resourceName := omit; v_ae1.start(f_CSE_DMR_CRE_001(int1, v_createRequest, -));//AccessControlPolicy v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(not ispresent(v_responsePrimitive.primitiveContent.accessControlPolicy.resourceName)){ setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); } } } testcase TC_CSE_DMR_CRE_001_ACP_AE() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createAcpBase; var ResponsePrimitive v_responsePrimitive; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_createRequest.primitiveContent.accessControlPolicy.resourceName := omit; v_ae1.start(f_CSE_DMR_CRE_001(int1, v_createRequest, m_createAeAux(omit,omit)));//AccessControlPolicy v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(not ispresent(v_responsePrimitive.primitiveContent.accessControlPolicy.resourceName)){ setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); } } } testcase TC_CSE_DMR_CRE_001_SCH_CB() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createScheduleBase; var ResponsePrimitive v_responsePrimitive; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_createRequest.primitiveContent.schedule.resourceName := omit; v_ae1.start(f_CSE_DMR_CRE_001(int18, v_createRequest, -));//Schedule v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(not ispresent(v_responsePrimitive.primitiveContent.schedule.resourceName)){ setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); } } } testcase TC_CSE_DMR_CRE_001_SCH_AE() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createScheduleBase; var ResponsePrimitive v_responsePrimitive; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_createRequest.primitiveContent.schedule.resourceName := omit; v_ae1.start(f_CSE_DMR_CRE_001(int18, v_createRequest, m_createAeAux(omit,omit)));//Schedule v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(not ispresent(v_responsePrimitive.primitiveContent.schedule.resourceName)){ setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); } } } testcase TC_CSE_DMR_CRE_001_SCH_SUB() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createScheduleBase; var ResponsePrimitive v_responsePrimitive; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_createRequest.primitiveContent.schedule.resourceName := omit; v_ae1.start(f_CSE_DMR_CRE_001(int18, v_createRequest, m_createSubscriptionBase));//Schedule v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(not ispresent(v_responsePrimitive.primitiveContent.schedule.resourceName)){ setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); } } } testcase TC_CSE_DMR_CRE_001_PCH_AE() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createPollingChannelBase; var ResponsePrimitive v_responsePrimitive; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_createRequest.primitiveContent.pollingChannel.resourceName := omit; v_ae1.start(f_CSE_DMR_CRE_001(int15, v_createRequest, m_createAeAux(omit,omit)));//PollingChannel v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(not ispresent(v_responsePrimitive.primitiveContent.pollingChannel.resourceName)){ setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); } } } testcase TC_CSE_DMR_CRE_001_SUB_CB() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createSubscriptionBase; var ResponsePrimitive v_responsePrimitive; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_createRequest.primitiveContent.subscription.resourceName := omit; v_ae1.start(f_CSE_DMR_CRE_001(int23, v_createRequest, -));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(not ispresent(v_responsePrimitive.primitiveContent.subscription.resourceName)){ setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); } } } testcase TC_CSE_DMR_CRE_001_SUB_AE() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createSubscriptionBase; var ResponsePrimitive v_responsePrimitive; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_createRequest.primitiveContent.subscription.resourceName := omit; v_ae1.start(f_CSE_DMR_CRE_001(int23, v_createRequest, m_createAeAux(omit,omit)));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(not ispresent(v_responsePrimitive.primitiveContent.subscription.resourceName)){ setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); } } } testcase TC_CSE_DMR_CRE_001_SUB_CNT() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createSubscriptionBase; var ResponsePrimitive v_responsePrimitive; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_createRequest.primitiveContent.subscription.resourceName := omit; v_ae1.start(f_CSE_DMR_CRE_001(int23, v_createRequest, m_createContainerBase));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(not ispresent(v_responsePrimitive.primitiveContent.subscription.resourceName)){ setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); } } } testcase TC_CSE_DMR_CRE_001_SUB_ACP() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createSubscriptionBase; var ResponsePrimitive v_responsePrimitive; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_createRequest.primitiveContent.subscription.resourceName := omit; v_ae1.start(f_CSE_DMR_CRE_001(int23, v_createRequest, m_createAcpBase));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(not ispresent(v_responsePrimitive.primitiveContent.subscription.resourceName)){ setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); } } } testcase TC_CSE_DMR_CRE_001_SUB_SCH() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createSubscriptionBase; var ResponsePrimitive v_responsePrimitive; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_createRequest.primitiveContent.subscription.resourceName := omit; v_ae1.start(f_CSE_DMR_CRE_001(int23, v_createRequest, m_createScheduleBase));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(not ispresent(v_responsePrimitive.primitiveContent.subscription.resourceName)){ setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); } } } testcase TC_CSE_DMR_CRE_001_SUB_GRP() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createSubscriptionBase; var ResponsePrimitive v_responsePrimitive; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_createRequest.primitiveContent.subscription.resourceName := omit; v_ae1.start(f_CSE_DMR_CRE_001(int23, v_createRequest, m_createGroupBase));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(not ispresent(v_responsePrimitive.primitiveContent.subscription.resourceName)){ setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); } } } testcase TC_CSE_DMR_CRE_001_NOD_CB() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createNodeBase; var ResponsePrimitive v_responsePrimitive; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_createRequest.primitiveContent.node.resourceName := omit; v_ae1.start(f_CSE_DMR_CRE_001(int14, v_createRequest, -));//Node v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(not ispresent(v_responsePrimitive.primitiveContent.node.resourceName)){ setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); } } } testcase TC_CSE_DMR_CRE_001_MGC_CB() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createMgmtCmdBase; var ResponsePrimitive v_responsePrimitive; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_createRequest.primitiveContent.mgmtResource.resourceName := omit; v_ae1.start(f_CSE_DMR_CRE_001(int12, v_createRequest, -));//Management Command v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(not ispresent(v_responsePrimitive.primitiveContent.mgmtResource.resourceName)){ setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); } } } testcase TC_CSE_DMR_CRE_001_LCP_CB() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createLocationPolicyBase; var ResponsePrimitive v_responsePrimitive; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_createRequest.primitiveContent.locationPolicy.resourceName := omit; v_ae1.start(f_CSE_DMR_CRE_001(int10, v_createRequest, -));//Location Policy v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(not ispresent(v_responsePrimitive.primitiveContent.locationPolicy.resourceName)){ setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); } } } testcase TC_CSE_DMR_CRE_001_STCG_CB() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createStatsConfigBase; var ResponsePrimitive v_responsePrimitive; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_createRequest.primitiveContent.statsConfig.resourceName := omit; v_ae1.start(f_CSE_DMR_CRE_001(int22, v_createRequest, -));//Stats Config v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(not ispresent(v_responsePrimitive.primitiveContent.statsConfig.resourceName)){ setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); } } } testcase TC_CSE_DMR_CRE_001_STCL_CB() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createStatsCollectBase; var ResponsePrimitive v_responsePrimitive; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_createRequest.primitiveContent.statsCollect.resourceName := omit; v_ae1.start(f_CSE_DMR_CRE_001(int21, v_createRequest, -));//Stats Collect v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(not ispresent(v_responsePrimitive.primitiveContent.statsCollect.resourceName)){ setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); } } } testcase TC_CSE_DMR_CRE_001_MSSP_CB() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createM2mServiceSubscriptionProfileBase; var ResponsePrimitive v_responsePrimitive; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_createRequest.primitiveContent.m2mServiceSubscriptionProfile.resourceName := omit; v_ae1.start(f_CSE_DMR_CRE_001(int11, v_createRequest, -));//Subscription Profile v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(not ispresent(v_responsePrimitive.primitiveContent.m2mServiceSubscriptionProfile.resourceName)){ setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); } } } testcase TC_CSE_DMR_CRE_001_ASAR_CB() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createServiceSubscribedAppRuleBase; var ResponsePrimitive v_responsePrimitive; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_createRequest.primitiveContent.serviceSubscribedAppRule.resourceName := omit; v_ae1.start(f_CSE_DMR_CRE_001(int19, v_createRequest, -));//Service Subscribed App v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(not ispresent(v_responsePrimitive.primitiveContent.serviceSubscribedAppRule.resourceName)){ setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); } } } testcase TC_CSE_DMR_CRE_001_CIN_CNT() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createContentInstanceBase; var ResponsePrimitive v_responsePrimitive; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_createRequest.primitiveContent.contentInstance.resourceName := omit; v_ae1.start(f_CSE_DMR_CRE_001(int4, v_createRequest, m_createContainerBase));//ContentInstance v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(not ispresent(v_responsePrimitive.primitiveContent.contentInstance.resourceName)){ setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); } } } function f_CSE_DMR_CRE_001(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, in template (omit) RequestPrimitive p_parentRequestPrimitive := omit) runs on AeSimu return ResponsePrimitive { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_parentIndex := -1; var integer v_resourceIndex := -1; var integer v_ae2Index := -1; var integer v_acpAuxIndex := -1; var PoaList v_poaList := {"http://" & PX_AE2_ADDRESS & "/"}; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble if(ispresent(p_parentRequestPrimitive)) { if(match(int23, p_parentRequestPrimitive.resourceType)){ vc_ae2.start(f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, "MyAe2", v_poaList), -1)); // AE2 is registred vc_ae2.done; v_ae2Index := f_getResource(vc_ae2); p_parentRequestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_ae2Index)}; vc_ae2.start(f_cse_notifyProcedure_subscriptionVerificationHandler()); } if(ischosen(p_parentRequestPrimitive.primitiveContent.group_)){ f_cse_preamble_registerAe(); } v_parentIndex := f_cse_createResource(valueof(p_parentRequestPrimitive.resourceType), p_parentRequestPrimitive, v_parentIndex); } else {//Resource under CSEBase if(p_resourceType != int1) { v_acpAuxIndex := f_cse_createAccessControlPolicyAux(-, -, -); p_requestPrimitive := f_setAcpId(p_requestPrimitive, {vc_resourcesList[v_acpAuxIndex].resource.accessControlPolicy.resourceID}); } if(ischosen(p_requestPrimitive.primitiveContent.group_)){ f_cse_preamble_registerAe(); } } // Test Body if(match(int23, p_requestPrimitive.resourceType)){ vc_ae2.start(f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, "MyAe2", v_poaList), -1)); // AE2 is registred vc_ae2.done; v_ae2Index := f_getResource(vc_ae2); p_requestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_ae2Index)}; vc_ae2.start(f_cse_notifyProcedure_subscriptionVerificationHandler()); } v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_parentIndex); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value vc_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(p_resourceType)) & " created successfully"); f_checkAttributesToBeSaved(p_resourceType, v_request, vc_response.primitive.responsePrimitive); v_resourceIndex := f_setResource(vc_response.primitive.responsePrimitive.primitiveContent, p_resourceType, v_parentIndex); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while creating resource type " & int2str(enum2int(p_resourceType))); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(p_resourceType))); } } f_checkAeSimuStatus(); //Check to see if the resource is present or not if (f_isResourcePresent(v_resourceIndex)){ setverdict(pass, __SCOPE__ & ":INFO: Resource created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); return vc_response.primitive.responsePrimitive; }//end f_CSE_DMR_CRE_001 } // end g_CSE_DMR_CRE_001 group g_CSE_DMR_CRE_002 { /** * @desc Check that the IUT accepts the creation of a RESOURCE_TYPE resource with a non-existing resource name provided by AE * */ testcase TC_CSE_DMR_CRE_002_CNT() runs on Tester system CseSystem { // Local variables var ResponsePrimitive v_responsePrimitive; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_CRE_002(int3, m_createContainerBase));//container v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(not ispresent(v_responsePrimitive.primitiveContent.container.resourceName)){ setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); } else { if(v_responsePrimitive.primitiveContent.container.resourceName != c_defaultContainerResourceName){ setverdict(fail, __SCOPE__, ": Error, resourceName attribute not correct"); } } } } testcase TC_CSE_DMR_CRE_002_GRP() runs on Tester system CseSystem { // Local variables var ResponsePrimitive v_responsePrimitive; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_CRE_002(int9, m_createGroupBase));//group v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(not ispresent(v_responsePrimitive.primitiveContent.group_.resourceName)){ setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); } else { if(v_responsePrimitive.primitiveContent.group_.resourceName != c_defaultGroupResourceName){ setverdict(fail, __SCOPE__, ": Error, resourceName attribute not correct"); } } } } testcase TC_CSE_DMR_CRE_002_ACP() runs on Tester system CseSystem { // Local variables var ResponsePrimitive v_responsePrimitive; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_CRE_002(int1, m_createAcpBase ));//accessControlPolicy v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(not ispresent(v_responsePrimitive.primitiveContent.accessControlPolicy.resourceName)){ setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); } else { if(v_responsePrimitive.primitiveContent.accessControlPolicy.resourceName != c_defaultAccessControlPolicyResourceName){ setverdict(fail, __SCOPE__, ": Error, resourceName attribute not correct"); } } } } testcase TC_CSE_DMR_CRE_002_SCH() runs on Tester system CseSystem { // Local variables var ResponsePrimitive v_responsePrimitive; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_CRE_002(int18, m_createScheduleBase));//Schedule v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(not ispresent(v_responsePrimitive.primitiveContent.schedule.resourceName)){ setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); } else { if(v_responsePrimitive.primitiveContent.schedule.resourceName != c_defaultScheduleResourceName){ setverdict(fail, __SCOPE__, ": Error, resourceName attribute not correct"); } } } } testcase TC_CSE_DMR_CRE_002_PCH() runs on Tester system CseSystem { // Local variables var ResponsePrimitive v_responsePrimitive; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_CRE_002(int15, m_createPollingChannelBase));//Pollingchannel v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(not ispresent(v_responsePrimitive.primitiveContent.pollingChannel.resourceName)){ setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); } else { if(v_responsePrimitive.primitiveContent.pollingChannel.resourceName != c_defaultPollingChannelResourceName){ setverdict(fail, __SCOPE__, ": Error, resourceName attribute not correct"); } } } } testcase TC_CSE_DMR_CRE_002_SUB() runs on Tester system CseSystem { // Local variables var ResponsePrimitive v_responsePrimitive; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_CRE_002(int23, m_createSubscriptionBase));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(not ispresent(v_responsePrimitive.primitiveContent.subscription.resourceName)){ setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); } else { if(v_responsePrimitive.primitiveContent.subscription.resourceName != c_defaultSubscriptionResourceName){ setverdict(fail, __SCOPE__, ": Error, resourceName attribute not correct"); } } } } function f_CSE_DMR_CRE_002(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu return ResponsePrimitive{//system CseSystem { MRO system keyword not supported on functions in Titan // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_ae2Index := -1; var integer v_resourceIndex := -1; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); // Test Body v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value vc_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(p_resourceType)) & " created successfully"); f_checkAttributesToBeSaved(p_resourceType, v_request, vc_response.primitive.responsePrimitive); v_resourceIndex := f_setResource(vc_response.primitive.responsePrimitive.primitiveContent, p_resourceType, v_aeIndex); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while creating resource type " & int2str(enum2int(p_resourceType))); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(p_resourceType))); } } f_checkAeSimuStatus(); //Check to see if the resource is present or not if(f_isResourcePresent(v_resourceIndex)){ setverdict(pass, __SCOPE__ & ":INFO: Resource created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); return vc_response.primitive.responsePrimitive; }//end f_CSE_DMR_CRE_002 }// end group g_CSE_DMR_CRE_002 group g_CSE_DMR_CRE_003 { /** * @desc Check that the IUT rejects the creation of a RESOURCE_TYPE resource with an existing resource name provided by AE * */ testcase TC_CSE_DMR_CRE_003_CNT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_CRE_003(int3, m_createContainerBase));//container v_ae1.done; } testcase TC_CSE_DMR_CRE_003_GRP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_CRE_003(int9, m_createGroupBase));//group v_ae1.done; } testcase TC_CSE_DMR_CRE_003_ACP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_CRE_003(int1, m_createAcpBase));//accessControlPolicy v_ae1.done; } testcase TC_CSE_DMR_CRE_003_SCH() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_CRE_003(int18, m_createScheduleBase));//Schedule v_ae1.done; } testcase TC_CSE_DMR_CRE_003_PCH() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_CRE_003(int15, m_createPollingChannelBase));//Pollingchannel v_ae1.done; } testcase TC_CSE_DMR_CRE_003_SUB() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_CRE_003(int23, m_createSubscriptionBase));//Subscription v_ae1.done; } function f_CSE_DMR_CRE_003(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu {//system CseSystem { MRO system keyword not supported on functions in Titan // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var integer v_ae2Index := -1; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi) f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); if(p_resourceType == int23){ vc_ae2.start(f_cse_notifyProcedure_subscriptionVerificationHandler()); } v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex); // Test Body v_request.requestIdentifier := "Existing resource"; mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4105))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Resource already exists"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while creating an already existing resource"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Creating a resource that already exists"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_DMR_CRE_003 }// end group g_CSE_DMR_CRE_003 group g_CSE_DMR_CRE_004 { /** * @desc Check that the IUT rejects the creation of a RESOURCE_TYPE resource when AE has no privileges * */ testcase TC_CSE_DMR_CRE_004_CNT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_CRE_004(int3, m_createContainerBase));//container v_ae1.done; } testcase TC_CSE_DMR_CRE_004_GRP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_CRE_004(int9, m_createGroupBase));//group v_ae1.done; } testcase TC_CSE_DMR_CRE_004_ACP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_CRE_004(int1, m_createAcpBase));//accessControlPolicy v_ae1.done; } testcase TC_CSE_DMR_CRE_004_SCH() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_CRE_004(int18, m_createScheduleBase));//Schedule v_ae1.done; } testcase TC_CSE_DMR_CRE_004_PCH() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_CRE_004(int15, m_createPollingChannelBase));//Pollingchannel v_ae1.done; } testcase TC_CSE_DMR_CRE_004_SUB() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_CRE_004(int23, m_createSubscriptionBase));//Subscription v_ae1.done; } function f_CSE_DMR_CRE_004(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu {//system CseSystem { MRO system keyword not supported on functions in Titan // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_acpAuxIndex := -1; var integer v_aeIndex := -1; // Test control if(not(PICS_ACP_SUPPORT)) { setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); stop; } // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble if (p_resourceType != int23) { v_acpAuxIndex := f_cse_preamble_createAcpAux(-, int62);//c_RUDNDi) } else { v_acpAuxIndex := f_cse_preamble_createAcpAux(-, int60);//c_UDNDi); } v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}, -); // Test Body v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Access denied to create a resource"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while creating a resource without privileges"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Resource created without creation privileges"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } } f_checkAeSimuStatus(); //Check to see if the resource is NOT present if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_DMR_CRE_004 }// end group g_CSE_DMR_CRE_004 group g_CSE_DMR_CRE_005 { /** * @desc Check that the IUT rejects the CREATE Request of container resource when the RW ATTRIBUTE is provided with an invalid value * */ testcase TC_CSE_DMR_CRE_005_MNI() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createContainerBase; var AttributeAux v_invalidAttribute; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_createRequest.primitiveContent.container.maxNrOfInstances := 0; v_invalidAttribute := {name := "maxNrOfInstances", value_ := "-1"}; v_ae1.start(f_CSE_DMR_CRE_005(int3, v_createRequest, v_invalidAttribute)); v_ae1.done; } testcase TC_CSE_DMR_CRE_005_MBS() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createContainerBase; var AttributeAux v_invalidAttribute; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_createRequest.primitiveContent.container.maxByteSize := 0; v_invalidAttribute := {name := "maxByteSize", value_ := "-1"}; v_ae1.start(f_CSE_DMR_CRE_005(int3, v_createRequest, v_invalidAttribute)); v_ae1.done; } testcase TC_CSE_DMR_CRE_005_MIA() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createContainerBase; var AttributeAux v_invalidAttribute; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_createRequest.primitiveContent.container.maxInstanceAge := 0; v_invalidAttribute := {name := "maxInstanceAge", value_ := "-1"}; v_ae1.start(f_CSE_DMR_CRE_005(int3, v_createRequest, v_invalidAttribute)); v_ae1.done; } function f_CSE_DMR_CRE_005(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, in AttributeAux p_invalidAttribute) runs on AeSimu { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); // Test Body v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex); mcaPort.send(m_request(v_request, {p_invalidAttribute})); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Creation rejected for resource type " & int2str(enum2int(p_resourceType)) & " containing an invalid value for attribute " & p_invalidAttribute.name); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Accepted creation of resource type " & int2str(enum2int(p_resourceType)) & " containing an invalid value for attribute" & p_invalidAttribute.name); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(p_resourceType))); } } f_checkAeSimuStatus(); //Check to see if the resource is NOT present if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_DMR_CRE_005 }// end group g_CSE_DMR_CRE_005 group g_CSE_DMR_CRE_006 { /** * @desc Check that the IUT returns a default value to RW ATTRIBUTE in the response of a <container> CREATE Request where no a RW ATTRIBUTE is provided by AE * */ testcase TC_CSE_DMR_CRE_006_MNI() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createContainerBase; var ResponsePrimitive v_responsePrimitive; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_CRE_006(int3, v_createRequest)); v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(not ispresent(v_responsePrimitive.primitiveContent.container.maxNrOfInstances)){ setverdict(fail, __SCOPE__, ": Error, maxNrOfInstances attribute not provided"); } } } testcase TC_CSE_DMR_CRE_006_MBS() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createContainerBase; var ResponsePrimitive v_responsePrimitive; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_CRE_006(int3, v_createRequest)); v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(not ispresent(v_responsePrimitive.primitiveContent.container.maxByteSize)){ setverdict(fail, __SCOPE__, ": Error, maxByteSize attribute not provided"); } } } testcase TC_CSE_DMR_CRE_006_MIA() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createContainerBase; var ResponsePrimitive v_responsePrimitive; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_CRE_006(int3, v_createRequest)); v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(not ispresent(v_responsePrimitive.primitiveContent.container.maxInstanceAge)){ setverdict(fail, __SCOPE__, ": Error, maxInstanceAge attribute not provided"); } } } function f_CSE_DMR_CRE_006(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu return ResponsePrimitive { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); // Test Body v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value vc_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Accepted creation rejected for resource type " & int2str(enum2int(p_resourceType))); f_checkAttributesToBeSaved(p_resourceType, v_request, vc_response.primitive.responsePrimitive); v_resourceIndex := f_setResource(vc_response.primitive.responsePrimitive.primitiveContent, p_resourceType, v_aeIndex); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Creation rejected of resource type " & int2str(enum2int(p_resourceType))); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(p_resourceType))); } } f_checkAeSimuStatus(); //Check to see if the resource is present or not if(f_isResourcePresent(v_resourceIndex)){ setverdict(pass, __SCOPE__ & ":INFO: Resource created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); return vc_response.primitive.responsePrimitive; }//end f_CSE_DMR_CRE_006 }// end group g_CSE_DMR_CRE_006 group g_CSE_DMR_CRE_007 { /** * @desc Check that the IUT responds with error when the newly created <contentInstance> results in that the field value of attribute currentNrOfInstances exceeds the field value of maxNrOfInstances in the parent container resource. * */ testcase TC_CSE_DMR_CRE_007() runs on AeSimu system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createContainerBase; var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_containerIndex := -1; const integer c_maxNumberOfInstances := 0; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); v_createRequest.primitiveContent.container.maxNrOfInstances := c_maxNumberOfInstances; v_containerIndex := f_cse_createResource(int3, v_createRequest, v_aeIndex); // Test Body v_request := f_getCreateRequestPrimitive(int4, m_createContentInstance(f_getResourceAddress(v_containerIndex), "MyValue"), v_containerIndex); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int5207))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Maximun number of instances exceeded"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Bad responseStatusCode in response"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Accepted creation of contentInstance exceding maximum number of instances"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource type 4"); } } f_checkAeSimuStatus(); //Check to see if the resource is NOT present if(f_isResourceNotPresent(v_containerIndex, f_getResourceName(v_request.primitiveContent))){ setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end TC_CSE_DMR_CRE_007 }// end group g_CSE_DMR_CRE_007 group g_CSE_DMR_CRE_008 { /** * @desc Checks that the IUT accepts a newly created contentInstance when the currentByteSize exceeds the field value set in maxByteSize in the parent container resource by removing enough of the oldest <contentInstance> resources to allow the creation of the new <contentInstance> resource. * */ testcase TC_CSE_DMR_CRE_008() runs on AeSimu system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createContainerBase; var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_containerIndex := -1; const integer c_maxByteSize := 0; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); v_createRequest.primitiveContent.container.maxByteSize := c_maxByteSize; v_containerIndex := f_cse_createResource(int3, v_createRequest, v_aeIndex); // Test Body v_request := f_getCreateRequestPrimitive(int4, m_createContentInstanceBase, v_containerIndex); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int5207))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Maximun byte size exceeded"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Bad responseStatusCode in response"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Accepted creation of contentInstance exceding maximum byte size"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource type 4"); } } f_checkAeSimuStatus(); //Check to see if the resource is present or not if(f_isResourceNotPresent(v_containerIndex, f_getResourceName(v_request.primitiveContent))){ setverdict(pass, __SCOPE__ & ":INFO: Resource created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end TC_CSE_DMR_CRE_008 }// end group g_CSE_DMR_CRE_008 group g_CSE_DMR_CRE_009 { /** * @desc Check that the IUT increaments and then copies the field value of attribute stateTag in parent container resource when contentInstance resource is created as the direct child of the parent container * */ testcase TC_CSE_DMR_CRE_009() runs on AeSimu system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createContainerBase; var MsgIn v_response; var integer v_aeIndex := -1; var integer v_containerIndex := -1; var integer v_contentInstanceIndex := -1; var template PrimitiveContent v_contentResponse; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); v_containerIndex := f_cse_createResource(int3, v_createRequest, v_aeIndex); v_contentInstanceIndex := f_cse_createResource(int4, m_createContentInstanceBase, v_containerIndex); // Test Body mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_containerIndex), f_getOriginator(v_containerIndex)))); v_contentResponse.container := mw_contentContainerBase; tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Response OK for retrieving"); if(v_response.primitive.responsePrimitive.primitiveContent.container.stateTag == vc_resourcesList[v_containerIndex].resource.container.stateTag + 1) { setverdict(pass, __SCOPE__ & ": stateTag attribute increased after creation of contentInstance resource"); } else { setverdict(fail, __SCOPE__ & ": stateTag attribute not incremented correctly after creation of contentInstance resource"); } } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end TC_CSE_DMR_CRE_009 }// end group g_CSE_DMR_CRE_009 group g_CSE_DMR_CRE_010 { /** * @desc Check that the IUT rejects the CREATE Request of a container resource named “la” as a direct child of a container resource * */ testcase TC_CSE_DMR_CRE_010() runs on AeSimu system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createContainerBase; var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_containerIndex := -1; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); // Test Body v_createRequest.primitiveContent.container.resourceName := c_resourceShortNameLatest; v_request := f_getCreateRequestPrimitive(int3, v_createRequest, v_containerIndex); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Not allowed to create a contentInstance resource named 'la'"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Rejected creation of contentInstance named 'la' with wrong ResponseStatusCode"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Accepted creation of contentInstance named 'la'"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource type 4"); } } f_checkAeSimuStatus(); //Check to see if the resource is NOT present if(f_isResourceNotPresent(v_containerIndex, f_getResourceName(v_request.primitiveContent))){ setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end TC_CSE_DMR_CRE_010 }// end group g_CSE_DMR_CRE_010 group g_CSE_DMR_CRE_011 { /** * @desc Check that the IUT rejects the CREATE Request of a container resource named “ol” as a direct child of a container resource * */ testcase TC_CSE_DMR_CRE_011() runs on AeSimu system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createContainerBase; var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_containerIndex := -1; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); // Test Body v_createRequest.primitiveContent.container.resourceName := c_resourceShortNameOldest; v_request := f_getCreateRequestPrimitive(int3, v_createRequest, v_containerIndex); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Not allowed to create a contentInstance resource named 'ol'"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Rejected creation of contentInstance named 'ol' with wrong ResponseStatusCode"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Accepted creation of contentInstance named 'ol'"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource type 4"); } } f_checkAeSimuStatus(); //Check to see if the resource is NOT present if(f_isResourceNotPresent(v_containerIndex, f_getResourceName(v_request.primitiveContent))){ setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end TC_CSE_DMR_CRE_011 }// end group g_CSE_DMR_CRE_011 group g_CSE_DMR_CRE_012 { /** * @desc Check that the IUT returns successfully after a CREATE request an empty content of created resource when the ResultContent set to 0 (Nothing) * */ testcase TC_CSE_DMR_CRE_012_CNT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_CRE_012(int3, m_createContainerBase));//Container v_ae1.done; } testcase TC_CSE_DMR_CRE_012_GRP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_CRE_012(int9, m_createGroupBase));//Group v_ae1.done; } testcase TC_CSE_DMR_CRE_012_ACP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_CRE_012(int1, m_createAcpBase));//AccessControlPolicy v_ae1.done; } testcase TC_CSE_DMR_CRE_012_SCH() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_CRE_012(int18, m_createScheduleBase));//Schedule v_ae1.done; } testcase TC_CSE_DMR_CRE_012_PCH() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_CRE_012(int15, m_createPollingChannelBase));//PollingChannel v_ae1.done; } testcase TC_CSE_DMR_CRE_012_SUB() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_CRE_012(int23, m_createSubscriptionBase));//Subscription v_ae1.done; } function f_CSE_DMR_CRE_012(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_ae2Index := -1; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); // Test Body v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex); v_request.resultContent := int0;//Attributes mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001, omit))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": No content provided with RC set to 0"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(omit))) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Content provided with RC set to 0"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while creating resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_DMR_CRE_012 } // end g_CSE_DMR_CRE_012 group g_CSE_DMR_CRE_013 { /** * @desc Check that the IUT returns successfully after a CREATE request only hierarchichal address of the created resource when the Result Content is set to 2 (hierarchical address) * */ testcase TC_CSE_DMR_CRE_013_CNT() runs on Tester system CseSystem { // Local variables var template PrimitiveContent v_contentResponse; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_contentResponse.uRI := mw_contentContainer_rc2; v_ae1.start(f_CSE_DMR_CRE_013(int3, m_createContainerBase, v_contentResponse));//Container v_ae1.done; } testcase TC_CSE_DMR_CRE_013_GRP() runs on Tester system CseSystem { // Local variables var template PrimitiveContent v_contentResponse; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_contentResponse.uRI := mw_contentGroup_rc2; v_ae1.start(f_CSE_DMR_CRE_013(int9, m_createGroupBase, v_contentResponse));//Group v_ae1.done; } testcase TC_CSE_DMR_CRE_013_ACP() runs on Tester system CseSystem { // Local variables var template PrimitiveContent v_contentResponse; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_contentResponse.uRI := mw_contentAcp_rc2; v_ae1.start(f_CSE_DMR_CRE_013(int1, m_createAcpBase,v_contentResponse));//AccessControlPolicy v_ae1.done; } testcase TC_CSE_DMR_CRE_013_SCH() runs on Tester system CseSystem { // Local variables var template PrimitiveContent v_contentResponse; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_contentResponse.uRI := mw_contentSchedule_rc2; v_ae1.start(f_CSE_DMR_CRE_013(int18, m_createScheduleBase, v_contentResponse));//Schedule v_ae1.done; } testcase TC_CSE_DMR_CRE_013_PCH() runs on Tester system CseSystem { // Local variables var template PrimitiveContent v_contentResponse; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_contentResponse.uRI := mw_contentPollingChannel_rc2; v_ae1.start(f_CSE_DMR_CRE_013(int15, m_createPollingChannelBase, v_contentResponse));//PollingChannel v_ae1.done; } testcase TC_CSE_DMR_CRE_013_SUB() runs on Tester system CseSystem { // Local variables var template PrimitiveContent v_contentResponse; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_contentResponse.uRI := mw_contentSubscription_rc2; v_ae1.start(f_CSE_DMR_CRE_013(int23, m_createSubscriptionBase, v_contentResponse));//Subscription v_ae1.done; } function f_CSE_DMR_CRE_013(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on AeSimu { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_ae2Index := -1; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); // Test Body v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex); v_request.resultContent := int2;//Attributes mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001, p_contentResponse))) -> value v_response { tc_ac.stop; if(f_isHierarchical(v_response.primitive.responsePrimitive.primitiveContent.uRI)) { setverdict(pass, __SCOPE__ & ": Response returning correctly only the hierarchical address of the created resource"); } else { setverdict(fail, __SCOPE__ & ": Response returning the address of the created resource with wrong format"); } } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong content provided with RC set to 2"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while creating resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_DMR_CRE_013 } // end g_CSE_DMR_CRE_013 group g_CSE_DMR_CRE_014 { /** * @desc Check that the IUT returns successfully after a CREATE request only attributes and hierarchichal address of the created resource when Result Content is set 3 (attributes and hierarchichal address) * */ testcase TC_CSE_DMR_CRE_014_CNT() runs on Tester system CseSystem { // Local variables var template PrimitiveContent v_contentResponse; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_contentResponse.resource := mw_contentContainer_rc3; v_ae1.start(f_CSE_DMR_CRE_014(int3, m_createContainerBase, v_contentResponse));//Container v_ae1.done; } testcase TC_CSE_DMR_CRE_014_GRP() runs on Tester system CseSystem { // Local variables var template PrimitiveContent v_contentResponse; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_contentResponse.resource := mw_contentGroup_rc3; v_ae1.start(f_CSE_DMR_CRE_014(int9, m_createGroupBase, v_contentResponse));//Group v_ae1.done; } testcase TC_CSE_DMR_CRE_014_ACP() runs on Tester system CseSystem { // Local variables var template PrimitiveContent v_contentResponse; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_contentResponse.resource := mw_contentAcp_rc3; v_ae1.start(f_CSE_DMR_CRE_014(int1, m_createAcpBase,v_contentResponse));//AccessControlPolicy v_ae1.done; } testcase TC_CSE_DMR_CRE_014_SCH() runs on Tester system CseSystem { // Local variables var template PrimitiveContent v_contentResponse; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_contentResponse.resource := mw_contentSchedule_rc3; v_ae1.start(f_CSE_DMR_CRE_014(int18, m_createScheduleBase, v_contentResponse));//Schedule v_ae1.done; } testcase TC_CSE_DMR_CRE_014_PCH() runs on Tester system CseSystem { // Local variables var template PrimitiveContent v_contentResponse; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_contentResponse.resource := mw_contentPollingChannel_rc3; v_ae1.start(f_CSE_DMR_CRE_014(int15, m_createPollingChannelBase, v_contentResponse));//PollingChannel v_ae1.done; } testcase TC_CSE_DMR_CRE_014_SUB() runs on Tester system CseSystem { // Local variables var template PrimitiveContent v_contentResponse; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_contentResponse.resource := mw_contentSubscription_rc3; v_ae1.start(f_CSE_DMR_CRE_014(int23, m_createSubscriptionBase, v_contentResponse));//Subscription v_ae1.done; } function f_CSE_DMR_CRE_014(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on AeSimu { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_ae2Index := -1; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); // Test Body v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex); v_request.resultContent := int3;//Attributes + Hierarchichal Address mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001, p_contentResponse))) -> value v_response { tc_ac.stop; if(f_isHierarchical(v_response.primitive.responsePrimitive.primitiveContent.resource.uRI)) { setverdict(pass, __SCOPE__ & ": Response returning correctly the hierarchical address of the created resource and resource representation"); } else { setverdict(fail, __SCOPE__ & ": Response returning the address of the created resource with wrong format"); } } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong content provided with RC set to 3"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while creating resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_DMR_CRE_014 } // end g_CSE_DMR_CRE_014 group g_CSE_DMR_CRE_015 { /** * @desc Check that the IUT accepts the creation of a RESOURCE_TYPE resource with the optional attribute OPTIONAL_ATTRIBUTE provided * */ testcase TC_CSE_DMR_CRE_015_CNT_ACPI() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createContainerBase; const AttributeAux c_optionalAttribute := {"accessControlPolicyIDs", omit}; v_createRequest.primitiveContent.container.accessControlPolicyIDs := {"NotInitialized"}; v_ae1.start(f_CSE_DMR_CRE_015(int3, v_createRequest, c_optionalAttribute)); v_ae1.done; } testcase TC_CSE_DMR_CRE_015_CNT_ET() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createContainerBase; const AttributeAux c_optionalAttribute := {"expirationTime", omit}; v_createRequest.primitiveContent.container.expirationTime := "20301231T012345"; v_ae1.start(f_CSE_DMR_CRE_015(int3, v_createRequest, c_optionalAttribute)); v_ae1.done; } testcase TC_CSE_DMR_CRE_015_CNT_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createContainerBase; const AttributeAux c_optionalAttribute := {"labels", omit}; v_createRequest.primitiveContent.container.labels := {"MyLabel"}; v_ae1.start(f_CSE_DMR_CRE_015(int3, v_createRequest, c_optionalAttribute)); v_ae1.done; } testcase TC_CSE_DMR_CRE_015_CNT_MNI() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createContainerBase; const AttributeAux c_optionalAttribute := {"maxNrOfInstances", omit}; v_createRequest.primitiveContent.container.maxNrOfInstances := 0; v_ae1.start(f_CSE_DMR_CRE_015(int3, v_createRequest, c_optionalAttribute)); v_ae1.done; } testcase TC_CSE_DMR_CRE_015_CNT_MBS() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createContainerBase; const AttributeAux c_optionalAttribute := {"maxByteSize", omit}; v_createRequest.primitiveContent.container.maxByteSize := 0; v_ae1.start(f_CSE_DMR_CRE_015(int3, v_createRequest, c_optionalAttribute)); v_ae1.done; } testcase TC_CSE_DMR_CRE_015_CNT_MIA() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createContainerBase; const AttributeAux c_optionalAttribute := {"maxInstanceAge", omit}; v_createRequest.primitiveContent.container.maxInstanceAge := 0; v_ae1.start(f_CSE_DMR_CRE_015(int3, v_createRequest, c_optionalAttribute)); v_ae1.done; } testcase TC_CSE_DMR_CRE_015_CNT_OR() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createContainerBase; const AttributeAux c_optionalAttribute := {"ontologyRef", omit}; v_createRequest.primitiveContent.container.ontologyRef := "MyOntologyRef"; v_ae1.start(f_CSE_DMR_CRE_015(int3, v_createRequest, c_optionalAttribute)); v_ae1.done; } testcase TC_CSE_DMR_CRE_015_CIN_ET() runs on Tester system CseSystem {//TODO // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createContentInstanceBase; const AttributeAux c_optionalAttribute := {"expirationTime", omit}; v_createRequest.primitiveContent.contentInstance.expirationTime := "20301231T012345"; v_ae1.start(f_CSE_DMR_CRE_015(int4, v_createRequest, c_optionalAttribute)); v_ae1.done; } testcase TC_CSE_DMR_CRE_015_CIN_LBL() runs on Tester system CseSystem {//TODO // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createContentInstanceBase; const AttributeAux c_optionalAttribute := {"labels", omit}; v_createRequest.primitiveContent.contentInstance.labels := {"MyLabel"}; v_ae1.start(f_CSE_DMR_CRE_015(int4, v_createRequest, c_optionalAttribute)); v_ae1.done; } testcase TC_CSE_DMR_CRE_015_CIN_CR() runs on Tester system CseSystem {//TODO // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createContentInstanceBase; const AttributeAux c_optionalAttribute := {"creator", omit}; v_createRequest.primitiveContent.contentInstance.creator := "MyCreator"; v_ae1.start(f_CSE_DMR_CRE_015(int4, v_createRequest, c_optionalAttribute)); v_ae1.done; } testcase TC_CSE_DMR_CRE_015_CIN_CNF() runs on Tester system CseSystem {//TODO // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createContentInstanceBase; const AttributeAux c_optionalAttribute := {"contentInfo", omit}; v_createRequest.primitiveContent.contentInstance.contentInfo := "MyContentInfo"; v_ae1.start(f_CSE_DMR_CRE_015(int4, v_createRequest, c_optionalAttribute)); v_ae1.done; } testcase TC_CSE_DMR_CRE_015_CIN_OR() runs on Tester system CseSystem {//TODO // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createContentInstanceBase; const AttributeAux c_optionalAttribute := {"ontologyRef", omit}; v_createRequest.primitiveContent.contentInstance.ontologyRef := "MyOntologyRef"; v_ae1.start(f_CSE_DMR_CRE_015(int4, v_createRequest, c_optionalAttribute)); v_ae1.done; } testcase TC_CSE_DMR_CRE_015_ACP_ET() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createAcpBase; const AttributeAux c_optionalAttribute := {"expirationTime", omit}; v_createRequest.primitiveContent.accessControlPolicy.expirationTime := "20301231T012345"; v_ae1.start(f_CSE_DMR_CRE_015(int1, v_createRequest, c_optionalAttribute)); v_ae1.done; } testcase TC_CSE_DMR_CRE_015_ACP_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createAcpBase; const AttributeAux c_optionalAttribute := {"labels", omit}; v_createRequest.primitiveContent.accessControlPolicy.labels := {"MyLabel"}; v_ae1.start(f_CSE_DMR_CRE_015(int1, v_createRequest, c_optionalAttribute)); v_ae1.done; } testcase TC_CSE_DMR_CRE_015_SUB_ACPI() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; const AttributeAux c_optionalAttribute := {"accessControlPolicyIDs", omit}; v_createRequest.primitiveContent.subscription.accessControlPolicyIDs := {"NotInitialized"}; v_ae1.start(f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute)); v_ae1.done; } testcase TC_CSE_DMR_CRE_015_SUB_ET() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; const AttributeAux c_optionalAttribute := {"expirationTime", omit}; v_createRequest.primitiveContent.subscription.expirationTime := "20301231T012345"; v_ae1.start(f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute)); v_ae1.done; } testcase TC_CSE_DMR_CRE_015_SUB_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; const AttributeAux c_optionalAttribute := {"labels", omit}; v_createRequest.primitiveContent.subscription.labels := {"MyLabel"}; v_ae1.start(f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute)); v_ae1.done; } testcase TC_CSE_DMR_CRE_015_SUB_ENC() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; const AttributeAux c_optionalAttribute := {"eventNotificationCriteria", omit}; v_createRequest.primitiveContent.subscription.eventNotificationCriteria := valueof(m_eventNotificationCriteria({int1}, -)); v_ae1.start(f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute)); v_ae1.done; } testcase TC_CSE_DMR_CRE_015_SUB_EXC() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; const AttributeAux c_optionalAttribute := {"expirationCounter", omit}; v_createRequest.primitiveContent.subscription.expirationCounter := 1; v_ae1.start(f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute)); v_ae1.done; } testcase TC_CSE_DMR_CRE_015_SUB_GPI() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; const AttributeAux c_optionalAttribute := {"groupID", omit}; v_createRequest.primitiveContent.subscription.groupID := "MyGroupID"; v_ae1.start(f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute)); v_ae1.done; } testcase TC_CSE_DMR_CRE_015_SUB_NFU() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; const AttributeAux c_optionalAttribute := {"notificationForwardingURI", omit}; v_createRequest.primitiveContent.subscription.notificationForwardingURI := "MyForwardingURI"; v_ae1.start(f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute)); v_ae1.done; } testcase TC_CSE_DMR_CRE_015_SUB_BN() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; const AttributeAux c_optionalAttribute := {"batchNotify", omit}; v_createRequest.primitiveContent.subscription.batchNotify := {0, "PT1S"}; v_ae1.start(f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute)); v_ae1.done; } testcase TC_CSE_DMR_CRE_015_SUB_RL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; const AttributeAux c_optionalAttribute := {"rateLimit", omit}; v_createRequest.primitiveContent.subscription.rateLimit := {0, omit}; v_ae1.start(f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute)); v_ae1.done; } testcase TC_CSE_DMR_CRE_015_SUB_PSN() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; const AttributeAux c_optionalAttribute := {"preSubscriptionNotify", omit}; v_createRequest.primitiveContent.subscription.preSubscriptionNotify := 1; v_ae1.start(f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute)); v_ae1.done; } testcase TC_CSE_DMR_CRE_015_SUB_PN() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; const AttributeAux c_optionalAttribute := {"pendingNotification", omit}; v_createRequest.primitiveContent.subscription.pendingNotification := int1; v_ae1.start(f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute)); v_ae1.done; } testcase TC_CSE_DMR_CRE_015_SUB_NSP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; const AttributeAux c_optionalAttribute := {"notificationStoragePriority", omit}; v_createRequest.primitiveContent.subscription.notificationStoragePriority := 1; v_ae1.start(f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute)); v_ae1.done; } testcase TC_CSE_DMR_CRE_015_SUB_LN() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; const AttributeAux c_optionalAttribute := {"latestNotify", omit}; v_createRequest.primitiveContent.subscription.latestNotify := true; v_ae1.start(f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute)); v_ae1.done; } testcase TC_CSE_DMR_CRE_015_SUB_NCT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; const AttributeAux c_optionalAttribute := {"notificationContentType", omit}; v_createRequest.primitiveContent.subscription.notificationContentType := int1; v_ae1.start(f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute)); v_ae1.done; } testcase TC_CSE_DMR_CRE_015_SUB_NEC() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; const AttributeAux c_optionalAttribute := {"notificationEventCat", omit}; v_createRequest.primitiveContent.subscription.notificationEventCat := {alt_1 := 100}; v_ae1.start(f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute)); v_ae1.done; } testcase TC_CSE_DMR_CRE_015_SUB_CR() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; const AttributeAux c_optionalAttribute := {"creator", omit}; v_createRequest.primitiveContent.subscription.creator := "MyCreator"; v_ae1.start(f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute)); v_ae1.done; } testcase TC_CSE_DMR_CRE_015_SUB_SU() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; const AttributeAux c_optionalAttribute := {"subscriberURI", omit}; v_createRequest.primitiveContent.subscription.subscriberURI := "MySubscriberURI"; v_ae1.start(f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute)); v_ae1.done; } function f_CSE_DMR_CRE_015(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, in AttributeAux p_optionalAttribute) runs on AeSimu { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_containerIndex := -1; var integer v_parentIndex := -1; var integer v_acpAuxIndex := -1; var integer v_ae2Index := -1; const XSD.NCName c_accessControlPolicyIDs := "accessControlPolicyIDs"; var integer v_resourceIndex := -1; // Test control if(match(c_accessControlPolicyIDs,p_optionalAttribute.name)) { if(not(PICS_ACP_SUPPORT)) { setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); stop; } } // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble if (match(c_accessControlPolicyIDs, p_optionalAttribute.name)) { v_acpAuxIndex := f_cse_preamble_createAcpAux();//c_CRUDNDi) } v_parentIndex := f_cse_preamble_registerAe();//c_CRUDNDi); f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); if(p_resourceType == int4) { v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_parentIndex); v_parentIndex := v_containerIndex; } // Test Body v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_parentIndex); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001, f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Accepted creation for resource type " & int2str(enum2int(p_resourceType)) & " containing attribute " & p_optionalAttribute.name); f_checkAttributesToBeSaved(p_resourceType, v_request, v_response.primitive.responsePrimitive); v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, p_resourceType, v_parentIndex); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Accepted creation for resource type " & int2str(enum2int(p_resourceType)) & " with incorrect attributes"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Rejected creation of resource type " & int2str(enum2int(p_resourceType))); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(p_resourceType))); } } f_checkAeSimuStatus(); //Check to see if the resource is present or not if(f_isResourcePresent(v_resourceIndex)) { setverdict(pass, __SCOPE__ & ":INFO: Resource created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_DMR_CRE_015 }// end group g_CSE_DMR_CRE_015 group g_CSE_DMR_CRE_016 { /** * @desc Check that the IUT accepts the creation of a RESOURCE_TYPE resource with the optional attribute announceTo provided * */ testcase TC_CSE_DMR_CRE_016_ACP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createAcpBase; v_createRequest.primitiveContent.accessControlPolicy.announceTo := {f_getAnnouncementTargetPoA()}; v_ae1.start(f_CSE_DMR_CRE_016(int1, v_createRequest, mw_createAccessControlPolicyAnnc));//AccessControlPolicy v_ae1.done; } testcase TC_CSE_DMR_CRE_016_CNT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createContainerBase; v_createRequest.primitiveContent.container.announceTo := {f_getAnnouncementTargetPoA()}; v_ae1.start(f_CSE_DMR_CRE_016(int3, v_createRequest, mw_createContainerAnncBase));//Container v_ae1.done; } testcase TC_CSE_DMR_CRE_016_CIN() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createContentInstanceBase; v_createRequest.primitiveContent.contentInstance.announceTo := {f_getAnnouncementTargetPoA()}; v_ae1.start(f_CSE_DMR_CRE_016(int4, v_createRequest, mw_createContentInstanceAnncBase));//ContentInstance v_ae1.done; } testcase TC_CSE_DMR_CRE_016_GRP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createGroupBase; v_createRequest.primitiveContent.group_.announceTo := {f_getAnnouncementTargetPoA()}; v_ae1.start(f_CSE_DMR_CRE_016(int9, v_createRequest, mw_createGroupAnncBase));//Group v_ae1.done; } testcase TC_CSE_DMR_CRE_016_LCP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createLocationPolicy(int1, omit, omit, omit, omit); v_createRequest.primitiveContent.locationPolicy.announceTo := {f_getAnnouncementTargetPoA()}; v_ae1.start(f_CSE_DMR_CRE_016(int10, v_createRequest, mw_createLocationPolicyAnncBase));//LocationPolicy v_ae1.done; } testcase TC_CSE_DMR_CRE_016_MGO() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createMgmtObjBase; v_createRequest.primitiveContent.mgmtResource.announceTo := {f_getAnnouncementTargetPoA()}; v_ae1.start(f_CSE_DMR_CRE_016(int13, v_createRequest, mw_createMgmtObjAnncBase));//MgmtObj v_ae1.done; } testcase TC_CSE_DMR_CRE_016_NOD() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createNodeBase; v_createRequest.primitiveContent.node.announceTo := {f_getAnnouncementTargetPoA()}; v_ae1.start(f_CSE_DMR_CRE_016(int14, v_createRequest, mw_createNodeAnnc));//Node v_ae1.done; } testcase TC_CSE_DMR_CRE_016_SCH() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createScheduleBase; v_createRequest.primitiveContent.schedule.announceTo := {f_getAnnouncementTargetPoA()}; v_ae1.start(f_CSE_DMR_CRE_016(int18, v_createRequest, mw_createScheduleAnncBase));//Schedule v_ae1.done; } function f_CSE_DMR_CRE_016(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template (present) RequestPrimitive p_requestAnnc) runs on AeSimu { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_parentIndex := -1; var integer v_containerIndex := -1; // Test control // Test component configuration f_cf02Up(); // Test adapter configuration // Preamble v_parentIndex := f_cse_preamble_registerAe();//c_CRUDNDi); if(p_resourceType == int4) { v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_parentIndex); v_parentIndex := v_containerIndex; } // Test Body v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_parentIndex); mcaPort.send(m_request(v_request)); vc_cse1.start(f_cse_receiveCreateRequest(p_requestAnnc)); vc_cse1.done; // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf02Down(); }//end f_CSE_DMR_CRE_016 } // end g_CSE_DMR_CRE_016 group g_CSE_DMR_CRE_017 { /** * @desc Check that the IUT accepts the creation of a RESOURCE_TYPE resource with the optional attribute announcedAttribute provided * */ testcase TC_CSE_DMR_CRE_017_CNT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createContainerBase; var RequestPrimitive v_requestPrimitive; var XSD.NonNegativeInteger maxByteSize := 512; //Correct value? Shall be indicated in TP? //v_createRequest.primitiveContent.container.announceTo := {f_getAnnouncementTargetPoA()}; v_createRequest.primitiveContent.container.announceTo := {PX_CSE1_ID}; v_createRequest.primitiveContent.container.maxByteSize := maxByteSize; v_createRequest.primitiveContent.container.announcedAttribute := {"maxByteSize"}; //Correct value? Shall be indicated in TP? v_ae1.start(f_CSE_DMR_CRE_017(int3, v_createRequest, mw_createContainerAnncBase()));//Container v_ae1.done; if(getverdict == pass){ //Check if maxByteSize attribute has been announced v_requestPrimitive := f_getRequestPrimitive(v_ae1); if (ispresent(v_requestPrimitive.primitiveContent.containerAnnc.maxByteSize)){ if(v_requestPrimitive.primitiveContent.containerAnnc.maxByteSize != maxByteSize){ setverdict(fail, __SCOPE__ & ": Error: Value of maxByteSize has not been announced successfully"); }else{ setverdict(pass, __SCOPE__ & ": Value of maxByteSize has been announced successfully"); } }else{ setverdict(fail, __SCOPE__ & ": Error: maxByteSize has not been announced"); } } } testcase TC_CSE_DMR_CRE_017_CIN() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createContentInstanceBase; var RequestPrimitive v_requestPrimitive; var XSD.NonNegativeInteger v_contentSize := 512; //Correct value? Shall be indicated in TP? //v_createRequest.primitiveContent.contentInstance.announceTo := {f_getAnnouncementTargetPoA()}; v_createRequest.primitiveContent.contentInstance.announceTo := {PX_CSE1_ID}; v_createRequest.primitiveContent.contentInstance.contentSize := v_contentSize; v_createRequest.primitiveContent.contentInstance.announcedAttribute := {"contentSize"}; //Correct value? Shall be indicated in TP? v_ae1.start(f_CSE_DMR_CRE_017(int4, v_createRequest, mw_createContentInstanceAnncBase()));//ContentInstance v_ae1.done; if(getverdict == pass){ //Check if contentSize attribute has been announced v_requestPrimitive := f_getRequestPrimitive(v_ae1); if (ispresent(v_requestPrimitive.primitiveContent.contentInstanceAnnc.contentSize)){ if(v_requestPrimitive.primitiveContent.contentInstanceAnnc.contentSize != v_contentSize){ setverdict(fail, __SCOPE__ & ": Error: Value of contentSize has not been announced successfully"); }else{ setverdict(pass, __SCOPE__ & ": Value of contentSize has been announced successfully"); } }else{ setverdict(fail, __SCOPE__ & ": Error: contentSize has not been announced"); } } } testcase TC_CSE_DMR_CRE_017_GRP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createGroupBase; var RequestPrimitive v_requestPrimitive; var XSD.PositiveInteger maxNrOfMembers := 10; //Correct value? Shall be indicated in TP? v_createRequest.primitiveContent.group_.announceTo := {f_getAnnouncementTargetPoA()}; v_createRequest.primitiveContent.group_.maxNrOfMembers := maxNrOfMembers; v_createRequest.primitiveContent.group_.announcedAttribute := {"maxNrOfMembers"}; //Correct value? Shall be indicated in TP? v_ae1.start(f_CSE_DMR_CRE_017(int9, v_createRequest, mw_createGroupAnncBase()));//Group v_ae1.done; if(getverdict == pass){ //Check if maxNrOfMembers attribute has been announced v_requestPrimitive := f_getRequestPrimitive(v_ae1); if (ispresent(v_requestPrimitive.primitiveContent.groupAnnc.maxNrOfMembers)){ if(v_requestPrimitive.primitiveContent.groupAnnc.maxNrOfMembers != maxNrOfMembers){ setverdict(fail, __SCOPE__ & ": Error: Value of maxNrOfMembers has not been announced successfully"); }else{ setverdict(pass, __SCOPE__ & ": Value of maxNrOfMembers has been announced successfully"); } }else{ setverdict(fail, __SCOPE__ & ": Error: maxNrOfMembers has not been announced"); } } } testcase TC_CSE_DMR_CRE_017_LCP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createLocationPolicy(int1, omit, omit, omit, omit); var RequestPrimitive v_requestPrimitive; var LocationSource locationSource := int1;//Network-based //Correct value? Shall be indicated in TP? v_createRequest.primitiveContent.locationPolicy.announceTo := {f_getAnnouncementTargetPoA()}; v_createRequest.primitiveContent.locationPolicy.locationSource := locationSource; v_createRequest.primitiveContent.locationPolicy.announcedAttribute := {"locationSource"}; //Correct value? Shall be indicated in TP? v_ae1.start(f_CSE_DMR_CRE_017(int10, v_createRequest, mw_createLocationPolicyAnncBase()));//LocationPolicy v_ae1.done; if(getverdict == pass){ //Check if locationSource attribute has been announced v_requestPrimitive := f_getRequestPrimitive(v_ae1); if (ispresent(v_requestPrimitive.primitiveContent.locationPolicyAnnc.locationSource)){ if(v_requestPrimitive.primitiveContent.locationPolicyAnnc.locationSource != locationSource){ setverdict(fail, __SCOPE__ & ": Error: Value of locationSource has not been announced successfully"); }else{ setverdict(pass, __SCOPE__ & ": Value of locationSource has been announced successfully"); } }else{ setverdict(fail, __SCOPE__ & ": Error: locationSource has not been announced"); } } } testcase TC_CSE_DMR_CRE_017_MGO() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createMgmtObjBase; var RequestPrimitive v_requestPrimitive; var XSD.String description := "Description of mgmtObj"; //Correct value? Shall be indicated in TP? v_createRequest.primitiveContent.mgmtResource.announceTo := {f_getAnnouncementTargetPoA()}; v_createRequest.primitiveContent.mgmtResource.description := description; v_createRequest.primitiveContent.mgmtResource.announcedAttribute := {"description"}; //Correct value? Shall be indicated in TP? v_ae1.start(f_CSE_DMR_CRE_017(int13, v_createRequest, mw_createMgmtObjAnncBase()));//MgmtObj v_ae1.done; if(getverdict == pass){ //Check if description attribute has been announced v_requestPrimitive := f_getRequestPrimitive(v_ae1); if (ispresent(v_requestPrimitive.primitiveContent.announcedMgmtResource.description)){ if(v_requestPrimitive.primitiveContent.announcedMgmtResource.description != description){ setverdict(fail, __SCOPE__ & ": Error: Value of description has not been announced successfully"); }else{ setverdict(pass, __SCOPE__ & ": Value of description has been announced successfully"); } }else{ setverdict(fail, __SCOPE__ & ": Error: description has not been announced"); } } } testcase TC_CSE_DMR_CRE_017_NOD() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createNodeBase; var RequestPrimitive v_requestPrimitive; v_createRequest.primitiveContent.node.announceTo := {f_getAnnouncementTargetPoA()}; //TODO node to be done. hostedCSELink attribute (OA) to be added!!! v_ae1.start(f_CSE_DMR_CRE_017(int14, v_createRequest, mw_createNodeAnnc));//Node v_ae1.done; } testcase TC_CSE_DMR_CRE_017_SCH() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_createRequest := m_createScheduleBase; var RequestPrimitive v_requestPrimitive; var ScheduleEntries scheduleElement := {{"0,0,0 1 2,1,1,*"}}; v_createRequest.primitiveContent.schedule.announceTo := {f_getAnnouncementTargetPoA()}; v_createRequest.primitiveContent.schedule.scheduleElement := scheduleElement; //Correct value? Shall be indicated in TP? v_createRequest.primitiveContent.schedule.announcedAttribute := {"scheduleElement"}; //Correct value? Shall be indicated in TP? v_ae1.start(f_CSE_DMR_CRE_017(int18, v_createRequest, mw_createScheduleAnncBase()));//Schedule v_ae1.done; if(getverdict == pass){ //Check if scheduleElement attribute has been announced v_requestPrimitive := f_getRequestPrimitive(v_ae1); if (ispresent(v_requestPrimitive.primitiveContent.scheduleAnnc.scheduleElement)){ if(v_requestPrimitive.primitiveContent.scheduleAnnc.scheduleElement != scheduleElement){ setverdict(fail, __SCOPE__ & ": Error: Value of scheduleElement has not been announced successfully"); }else{ setverdict(pass, __SCOPE__ & ": Value of scheduleElement has been announced successfully"); } }else{ setverdict(fail, __SCOPE__ & ": Error: scheduleElement has not been announced"); } } } function f_CSE_DMR_CRE_017(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template (present) RequestPrimitive p_requestAnnc) runs on AeSimu{ // Local variables var MsgIn v_anncRequest; var RequestPrimitive v_request; var integer v_parentIndex := -1; var integer v_containerIndex := -1; var integer v_remoteCseIndex; var integer v_aeAnncIndex; var integer v_resourceIndex; // Test control // Test component configuration f_cf02Up(); // Test adapter configuration // Preamble if (PX_IUT_IS_MN_CSE == true) { vc_cse1.start(f_cse_registrationRemoteCse(m_createRemoteCSEBase)); }else if (PX_IUT_IS_IN_CSE == true) { vc_cse1.start(f_cse_registerRemoteCse(m_createRemoteCSEBase)); } vc_cse1.done; vc_cse1.start(f_cse_resourceAnnouncementHandler()); v_resourceIndex := f_cse_createResource(int2, m_createAe(PX_APP_ID, omit, omit)); vc_cse1.done; if(p_resourceType == int4) { v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_parentIndex); v_parentIndex := v_containerIndex; } // Test Body v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_parentIndex); vc_cse1.start(f_cse_receiveCreateRequest(p_requestAnnc)); mcaPort.send(m_request(v_request)); vc_cse1.done; vc_request.primitive.requestPrimitive := f_getRequestPrimitive(vc_cse1); // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf02Down(); //return v_anncRequest.primitive.requestPrimitive; }//end f_CSE_DMR_CRE_017 } // end g_CSE_DMR_CRE_017 group g_CSE_DMR_CRE_020{ /** * @desc Check that the IUT rejects the CREATE Request of a contentInstance resource with error “NOT_ACCEPTABLE” when contentSize exceeds maxByteSize * */ testcase TC_CSE_DMR_CRE_020() runs on AeSimu system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createContainerBase; var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_containerIndex := -1; const integer c_maxByteSize := 0; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); v_createRequest.primitiveContent.container.maxByteSize := c_maxByteSize; v_containerIndex := f_cse_createResource(int3, v_createRequest, v_aeIndex); // Test Body v_request := f_getCreateRequestPrimitive(int4, m_createContentInstanceBase, v_containerIndex); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int5207))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Maximum byte size exceeded"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Bad responseStatusCode in response"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Accepted creation of contentInstance exceding maximum byte size"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource type 4"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end TC_CSE_DMR_CRE_020 }// end group g_CSE_DMR_CRE_020 group g_CSE_DMR_CRE_021{ /** * @desc Check that the IUT updates the currentByteSize attribute in a <container> parent resource when a new <contentInstance> resource is created. * */ testcase TC_CSE_DMR_CRE_021() runs on AeSimu system CseSystem { // Local variables var template RequestPrimitive v_createRequest; var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_containerIndex := -1; var integer v_contentInstanceIndex := -1; const integer c_maxByteSize := 512; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); v_createRequest.primitiveContent.container.maxByteSize := c_maxByteSize; v_createRequest := m_createContainerBase; v_containerIndex := f_cse_createResource(int3, v_createRequest, v_aeIndex); v_contentInstanceIndex := f_cse_createResource(int4, v_createRequest, v_containerIndex); // Test Body v_request := f_getCreateRequestPrimitive(int4, m_createContentInstanceBase, v_containerIndex); //Default content: "AnyValue" (8 bytes length) mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": ContentInstance resource created"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error when creating contentInstance resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource type 4"); } } //Check currentByteSize mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_containerIndex), f_getOriginator(v_containerIndex)))); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; if(v_response.primitive.responsePrimitive.primitiveContent.container.currentByteSize == 8) { //Default content: "AnyValue" (8 bytes length) setverdict(pass, __SCOPE__ & ": CurrentByteSize attribute in content resource is incremented successfully"); } else{ setverdict(fail, __SCOPE__ & ": CurrentByteSize attribute in content resource not incremented successfully"); } } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end TC_CSE_DMR_CRE_021 }// end group g_CSE_DMR_CRE_021 }//end group Create group Retrieve { group g_CSE_DMR_RET_001 { /** * @desc Check that the IUT returns successfully the TARGET_RESOURCE_ADDRESS resource * */ testcase TC_CSE_DMR_RET_001_CNT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var ResponsePrimitive v_responsePrimitive; var template PrimitiveContent v_contentResponse; v_contentResponse.container := mw_contentContainer_rc1; v_ae1.start(f_CSE_DMR_RET_001(int3, m_createContainerBase, v_contentResponse));//Container v_ae1.done; } testcase TC_CSE_DMR_RET_001_GRP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var ResponsePrimitive v_responsePrimitive; var template PrimitiveContent v_contentResponse; v_contentResponse.group_ := mw_contentGroup_rc1; v_ae1.start(f_CSE_DMR_RET_001(int9, m_createGroupBase, v_contentResponse));//Group v_ae1.done; } testcase TC_CSE_DMR_RET_001_ACP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var ResponsePrimitive v_responsePrimitive; var template PrimitiveContent v_contentResponse; v_contentResponse.accessControlPolicy := mw_contentAcp_rc1; v_ae1.start(f_CSE_DMR_RET_001(int1, m_createAcpBase, v_contentResponse));//AccessControlPolicy v_ae1.done; } testcase TC_CSE_DMR_RET_001_SCH() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var ResponsePrimitive v_responsePrimitive; var template PrimitiveContent v_contentResponse; v_contentResponse.schedule := mw_contentSchedule_rc1; v_ae1.start(f_CSE_DMR_RET_001(int18, m_createScheduleBase, v_contentResponse));//Schedule v_ae1.done; } testcase TC_CSE_DMR_RET_001_PCH() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var ResponsePrimitive v_responsePrimitive; var template PrimitiveContent v_contentResponse; v_contentResponse.pollingChannel := mw_contentPollingChannelBase; v_ae1.start(f_CSE_DMR_RET_001(int15, m_createPollingChannelBase, v_contentResponse));//PollingChannel v_ae1.done; } testcase TC_CSE_DMR_RET_001_SUB() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var ResponsePrimitive v_responsePrimitive; var template PrimitiveContent v_contentResponse; v_contentResponse.subscription := mw_contentSubscription_rc1; v_ae1.start(f_CSE_DMR_RET_001(int23, m_createSubscriptionBase, v_contentResponse));//Subscription v_ae1.done; } testcase TC_CSE_DMR_RET_001_CIN() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var ResponsePrimitive v_responsePrimitive; var template PrimitiveContent v_contentResponse; v_contentResponse.contentInstance := mw_contentContentInstance_rc1; v_ae1.start(f_CSE_DMR_RET_001(int4, m_createContentInstanceBase, v_contentResponse));//ContentInstance v_ae1.done; } function f_CSE_DMR_RET_001(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on AeSimu return ResponsePrimitive { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_containerIndex := -1; var integer v_parentIndex := -1; var integer v_resourceIndex := -1; var integer v_ae2Index := -1; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); if(p_resourceType == int4) { //ContentInstance v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); v_parentIndex := v_containerIndex; }else{ v_parentIndex := v_aeIndex; } v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_parentIndex); // Test Body mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)))); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Response OK for retrieving"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); return v_response.primitive.responsePrimitive; }//end f_CSE_DMR_RET_001 } // end g_CSE_DMR_RET_001 group g_CSE_DMR_RET_002 { /** * @desc Check that the IUT responds with an error when the AE tries to retrieve the resource TARGET_RESOURCE_ADDRESS which does not exist * */ testcase TC_CSE_DMR_RET_002() runs on AeSimu system CseSystem{ // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var XSD.ID v_resourceId := "nonExistingId"; var XSD.ID v_resourceName := "nonExistingName"; var XSD.ID v_targetResourceAddress; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); // Test Body if((PX_ADDRESSING_METHOD == e_nonHierarchical) and (PX_PRIMITIVE_SCOPE == e_cseRelative)) { v_targetResourceAddress := v_resourceId; } else if (PX_ADDRESSING_METHOD == e_nonHierarchical) { v_targetResourceAddress := f_getResourceAddress() & "/" & v_resourceId; } else { v_targetResourceAddress := f_getResourceAddress(v_aeIndex) & "/" & v_resourceName; } mcaPort.send(m_request(m_retrieveResource(v_targetResourceAddress, f_getOriginator(v_aeIndex)))); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Resource not found"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_DMR_RET_002 } // end g_CSE_DMR_RET_002 group g_CSE_DMR_RET_003 { /** * @desc Check that the IUT responds with an error when the AE tries to retrieve a resource TARGET_RESOURCE_ADDRESS under AE without having privileges for the RETRIEVE operation * */ testcase TC_CSE_DMR_RET_003_CNT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_RET_003(int3, m_createContainerBase));//Container v_ae1.done; } testcase TC_CSE_DMR_RET_003_GRP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_RET_003(int9, m_createGroupBase));//Group v_ae1.done; } testcase TC_CSE_DMR_RET_003_ACP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_requestPrimitive := m_createAcpBase; v_requestPrimitive.primitiveContent.accessControlPolicy.selfPrivileges.accessControlRule_list[0].accessControlOperations := int61; v_ae1.start(f_CSE_DMR_RET_003(int1, v_requestPrimitive));//AccessControlPolicy v_ae1.done; } testcase TC_CSE_DMR_RET_003_SCH() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_RET_003(int18, m_createScheduleBase));//Schedule v_ae1.done; } testcase TC_CSE_DMR_RET_003_PCH() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_RET_003(int15, m_createPollingChannelBase));//PollingChannel v_ae1.done; } testcase TC_CSE_DMR_RET_003_SUB() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_RET_003(int23, m_createSubscriptionBase));//Subscription v_ae1.done; } function f_CSE_DMR_RET_003(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_acpAuxIndex := -1; var integer v_resourceIndex := -1; var integer v_ae2Index := -1; // Test control if(not(PICS_ACP_SUPPORT)) { log(__SCOPE__ & ":INFO: AccessControlPolicy support is required for executing this test case"); stop; } // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_acpAuxIndex := f_cse_preamble_createAcpAux(-, -);//c_CRUDNDi) v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)});//c_CRUDNDi; f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); f_cse_updateAcpAuxResource(int61); //c_CUDNDi // Test Body mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)))); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Access denied to retrieve attributes from resource type " & int2str(enum2int(p_resourceType))); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving attributes from resource without having privileges"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Retrieving attributes from resource without having privileges"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_DMR_RET_003 } // end g_CSE_DMR_RET_003 group g_CSE_DMR_RET_004 { /** * @desc Check that the IUT returns successfully the ATTRIBUTE of TARGET_RESOURCE_ADDRESS resource (“To” option) * */ testcase TC_CSE_DMR_RET_004_CNT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.container := m_contentContainer_allOmit; v_contentResponse.container.parentID := ?; v_ae1.start(f_CSE_DMR_RET_004(int3, m_createContainerBase, v_contentResponse));//Container v_ae1.done; } testcase TC_CSE_DMR_RET_004_GRP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.group_ := m_contentGroup_allOmit; v_contentResponse.group_.parentID := ?; v_ae1.start(f_CSE_DMR_RET_004(int9, m_createGroupBase, v_contentResponse));//Group v_ae1.done; } testcase TC_CSE_DMR_RET_004_ACP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.accessControlPolicy := m_contentAcp_allOmit; v_contentResponse.accessControlPolicy.parentID := ?; v_ae1.start(f_CSE_DMR_RET_004(int1, m_createAcpBase, v_contentResponse));//AccessControlPolicy v_ae1.done; } testcase TC_CSE_DMR_RET_004_SCH() runs on Tester system CseSystem { // Local variables var template PrimitiveContent v_contentResponse; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_contentResponse.schedule := m_contentSchedule_allOmit; v_contentResponse.schedule.parentID := ?; v_ae1.start(f_CSE_DMR_RET_004(int18, m_createScheduleBase,v_contentResponse));//Schedule v_ae1.done; } testcase TC_CSE_DMR_RET_004_PCH() runs on Tester system CseSystem { // Local variables var template PrimitiveContent v_contentResponse; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_contentResponse.pollingChannel := m_contentPollingChannel_allOmit; v_contentResponse.pollingChannel.parentID := ?; v_ae1.start(f_CSE_DMR_RET_004(int15, m_createPollingChannelBase, v_contentResponse));//PollingChannel v_ae1.done; } testcase TC_CSE_DMR_RET_004_SUB() runs on Tester system CseSystem { // Local variables var template PrimitiveContent v_contentResponse; var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_contentResponse.subscription := m_contentSubscription_allOmit; v_contentResponse.subscription.parentID := ?; v_ae1.start(f_CSE_DMR_RET_004(int23, m_createSubscriptionBase, v_contentResponse));//Subscription v_ae1.done; } function f_CSE_DMR_RET_004(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on AeSimu { // Local variables var MsgIn v_response; var XSD.String v_attribute := "#pi";//Attribute parentId to be retrieved var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var integer v_ae2Index := -1; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); // Test Body mcaPort.send(m_request(m_retrieveResourceAttributeToOption(f_getResourceAddress(v_resourceIndex) & v_attribute, f_getOriginator(v_resourceIndex)))); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Requested attribute retrieved successfully"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error, not only requested attribute retrieved"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource attribute"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attribute"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_DMR_RET_004 } // end g_CSE_DMR_RET_004 group g_CSE_DMR_RET_005 { /** * @desc Check that the IUT returns successfully the ATTRIBUTE of TARGET_RESOURCE_ADDRESS resource (“Content” option) * */ testcase TC_CSE_DMR_RET_005_CNT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.container := m_contentContainer_allOmit; v_contentResponse.container.parentID := ?; v_ae1.start(f_CSE_DMR_RET_005(int3, m_createContainerBase, v_contentResponse));//Container v_ae1.done; } testcase TC_CSE_DMR_RET_005_GRP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.group_ := m_contentGroup_allOmit; v_contentResponse.group_.parentID := ?; v_ae1.start(f_CSE_DMR_RET_005(int9, m_createGroupBase, v_contentResponse));//Group v_ae1.done; } testcase TC_CSE_DMR_RET_005_ACP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.accessControlPolicy := m_contentAcp_allOmit; v_contentResponse.accessControlPolicy.parentID := ?; v_ae1.start(f_CSE_DMR_RET_005(int1, m_createAcpBase, v_contentResponse));//AccessControlPolicy v_ae1.done; } testcase TC_CSE_DMR_RET_005_SCH() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.schedule := m_contentSchedule_allOmit; v_contentResponse.schedule.parentID := ?; v_ae1.start(f_CSE_DMR_RET_005(int18, m_createScheduleBase, v_contentResponse));//Schedule v_ae1.done; } testcase TC_CSE_DMR_RET_005_PCH() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.pollingChannel := m_contentPollingChannel_allOmit; v_contentResponse.pollingChannel.parentID := ?; v_ae1.start(f_CSE_DMR_RET_005(int15, m_createPollingChannelBase, v_contentResponse));//PollingChannel v_ae1.done; } testcase TC_CSE_DMR_RET_005_SUB() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.subscription := m_contentSubscription_allOmit; v_contentResponse.subscription.parentID := ?; v_ae1.start(f_CSE_DMR_RET_005(int23, m_createSubscriptionBase, v_contentResponse));//Subscription v_ae1.done; } function f_CSE_DMR_RET_005(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on AeSimu { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var integer v_ae2Index := -1; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); // Test Body mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex) , {"pi"}, f_getOriginator(v_resourceIndex)))); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Requested attribute retrieved successfully"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error, not only requested attribute retrieved"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource attribute"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attribute"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_DMR_RET_005 } // end g_CSE_DMR_RET_005 group g_CSE_DMR_RET_006 { /** * @desc Check that the IUT returns successfully multiple attributes of TARGET_RESOURCE_ADDRESS resource * */ testcase TC_CSE_DMR_RET_006_CNT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.container := m_contentContainer_allOmit; v_contentResponse.container.parentID := ?; v_contentResponse.container.creationTime := ?; v_ae1.start(f_CSE_DMR_RET_006(int3, m_createContainerBase, v_contentResponse));//Container v_ae1.done; } testcase TC_CSE_DMR_RET_006_GRP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.group_ := m_contentGroup_allOmit; v_contentResponse.group_.parentID := ?; v_contentResponse.group_.creationTime := ?; v_ae1.start(f_CSE_DMR_RET_006(int9, m_createGroupBase, v_contentResponse));//Group v_ae1.done; } testcase TC_CSE_DMR_RET_006_ACP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.accessControlPolicy := m_contentAcp_allOmit; v_contentResponse.accessControlPolicy.parentID := ?; v_contentResponse.accessControlPolicy.creationTime := ?; v_ae1.start(f_CSE_DMR_RET_006(int1, m_createAcpBase, v_contentResponse));//AccessControlPolicy v_ae1.done; } testcase TC_CSE_DMR_RET_006_SCH() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.schedule := m_contentSchedule_allOmit; v_contentResponse.schedule.parentID := ?; v_contentResponse.schedule.creationTime := ?; v_ae1.start(f_CSE_DMR_RET_006(int18, m_createScheduleBase, v_contentResponse));//Schedule v_ae1.done; } testcase TC_CSE_DMR_RET_006_PCH() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.pollingChannel := m_contentPollingChannel_allOmit; v_contentResponse.pollingChannel.parentID := ?; v_contentResponse.pollingChannel.creationTime := ?; v_ae1.start(f_CSE_DMR_RET_006(int15, m_createPollingChannelBase, v_contentResponse));//PollingChannel v_ae1.done; } testcase TC_CSE_DMR_RET_006_SUB() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.subscription := m_contentSubscription_allOmit; v_contentResponse.subscription.parentID := ?; v_contentResponse.subscription.creationTime := ?; v_ae1.start(f_CSE_DMR_RET_006(int23, m_createSubscriptionBase, v_contentResponse));//Subscription v_ae1.done; } function f_CSE_DMR_RET_006(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on AeSimu { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var integer v_ae2Index := -1; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); // Test Body mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex) , {"pi", "ct"}, f_getOriginator(v_resourceIndex)))); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Requested attributes retrieved successfully"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error, not only requested attributes retrieved"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource attributes"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_DMR_RET_006 } // end g_CSE_DMR_RET_006 group g_CSE_DMR_RET_007 { /** * @desc Check that the IUT responds with an error when the AE tries to retrieve a non-existing attribute of the TARGET_RESOURCE_ADDRESS resource (“single” attribute case) * */ testcase TC_CSE_DMR_RET_007_CNT_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_RET_007(int3, m_createContainerBase));//Container v_ae1.done; } testcase TC_CSE_DMR_RET_007_GRP_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_RET_007(int9, m_createGroupBase));//Group v_ae1.done; } testcase TC_CSE_DMR_RET_007_ACP_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_RET_007(int1, m_createAcpBase));//AccessControlPolicy v_ae1.done; } testcase TC_CSE_DMR_RET_007_SCH_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_RET_007(int18, m_createScheduleBase));//Schedule v_ae1.done; } testcase TC_CSE_DMR_RET_007_PCH_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_RET_007(int15, m_createPollingChannelBase));//PollingChannel v_ae1.done; } testcase TC_CSE_DMR_RET_007_SUB_LBL() runs on AeSimu system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_RET_007(int23, m_createSubscriptionBase));//Subscription v_ae1.done; } function f_CSE_DMR_RET_007(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var integer v_ae2Index := -1; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); // Test Body mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex), {"lbl"}, f_getOriginator(v_resourceIndex)))); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { tc_ac.stop; } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error : attribute was retrieved while it doesn't exist"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attribute"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_DMR_RET_007 } // end g_CSE_DMR_RET_007 group g_CSE_DMR_RET_008 { /** * @desc Check that the IUT responds with an error when the AE tries to retrieve a non-existing attributes of the TARGET_RESOURCE_ADDRESS resource (“multiple” attributes case) * */ testcase TC_CSE_DMR_RET_008_CNT_AT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_RET_008(int3, m_createContainerBase));//Container v_ae1.done; } testcase TC_CSE_DMR_RET_008_GRP_AT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_RET_008(int9, m_createGroupBase));//Group v_ae1.done; } testcase TC_CSE_DMR_RET_008_ACP_AT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_RET_008(int1, m_createAcpBase));//AccessControlPolicy v_ae1.done; } testcase TC_CSE_DMR_RET_008_SCH_AT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_RET_008(int18, m_createScheduleBase));//Schedule v_ae1.done; } testcase TC_CSE_DMR_RET_008_PCH_AT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_RET_008(int15, m_createPollingChannelBase));//PollingChannel v_ae1.done; } testcase TC_CSE_DMR_RET_008_SUB_AT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_RET_008(int23, m_createSubscriptionBase));//Subscription v_ae1.done; } function f_CSE_DMR_RET_008(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var integer v_ae2Index := -1; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); // Test Body mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex), {"lbl", "at"}, f_getOriginator(v_resourceIndex)))); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { tc_ac.stop; } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error : attribute was retrieved while it doesn't exist"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_DMR_RET_008 } // end f_CSE_DMR_RET_008 group g_CSE_DMR_RET_009{ /** * @desc Check that the IUT rejects the RETRIEVE Request of a latest resource target to a container resource that has no direct child contentInstance resources. * */ testcase TC_CSE_DMR_RET_009() runs on AeSimu system CseSystem { // Local variables var integer v_aeIndex := -1; var integer v_containerIndex := -1; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); // Test Body mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_containerIndex) & "/" & c_resourceShortNameLatest, f_getOriginator(v_containerIndex)))); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))){ tc_ac.stop; setverdict(pass, __SCOPE__ & ": Resource not found"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end TC_CSE_DMR_RET_009 } // end group g_CSE_DMR_RET_009 group g_CSE_DMR_RET_010{ /** * @desc Check that the IUT accepts the RETRIEVE Request of the oldest contentInstance target to a <container> resource * */ testcase TC_CSE_DMR_RET_010() runs on AeSimu system CseSystem { // Local variables var integer v_aeIndex := -1; var integer v_containerIndex := -1; var integer v_contentInstanceIndex1 := -1; var integer v_contentInstanceIndex2 := -1; var template PrimitiveContent v_contentResponse; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); v_contentInstanceIndex1 := f_cse_createResource(int4, m_createContentInstance_noResourceName, v_containerIndex); v_contentInstanceIndex2 := f_cse_createResource(int4, m_createContentInstance_noResourceName, v_containerIndex); v_contentResponse.contentInstance := mw_contentContentInstanceBase; v_contentResponse.contentInstance.resourceName := vc_resourcesList[v_contentInstanceIndex1].resource.contentInstance.resourceName; // Test Body mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_containerIndex) & "/" & c_resourceShortNameOldest, f_getOriginator(v_containerIndex)))); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))) { tc_ac.stop; setverdict(pass, __SCOPE__ & ": resourceName attribute of <oldest> resource retrieved successfully"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))){ tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)){ tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error, resourceName attribute of <oldest> resource value not expected"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)){ tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving <oldest> resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving <oldest> resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end TC_CSE_DMR_RET_010 } // end group g_CSE_DMR_RET_010 group g_CSE_DMR_RET_011{ /** * @desc Check that the IUT rejects the RETRIEVE Request of a oldest resource target to a container resource that has no direct child contentInstance resources. * */ testcase TC_CSE_DMR_RET_011() runs on AeSimu system CseSystem { // Local variables var integer v_aeIndex := -1; var integer v_containerIndex := -1; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); // Test Body mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_containerIndex) & "/" & c_resourceShortNameOldest, f_getOriginator(v_containerIndex)))); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))){ tc_ac.stop; setverdict(pass, __SCOPE__ & ": Resource not found"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end TC_CSE_DMR_RET_011 } // end group g_CSE_DMR_RET_011 group g_CSE_DMR_RET_012{ /** * @desc Check that the IUT accepts the RETRIEVE Request of the latest contentInstance target to a <container> resource7 * */ testcase TC_CSE_DMR_RET_012() runs on AeSimu system CseSystem { // Local variables var integer v_aeIndex := -1; var integer v_containerIndex := -1; var integer v_contentInstanceIndex1 := -1; var integer v_contentInstanceIndex2 := -1; var template PrimitiveContent v_contentResponse; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); v_contentInstanceIndex1 := f_cse_createResource(int4, m_createContentInstance_noResourceName, v_containerIndex); v_contentInstanceIndex2 := f_cse_createResource(int4, m_createContentInstance_noResourceName, v_containerIndex); v_contentResponse.contentInstance := mw_contentContentInstanceBase; v_contentResponse.contentInstance.resourceName := vc_resourcesList[v_contentInstanceIndex2].resource.contentInstance.resourceName; // Test Body mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_containerIndex) & "/" & c_resourceShortNameLatest, f_getOriginator(v_containerIndex)))); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))){ tc_ac.stop; setverdict(pass, __SCOPE__ & ": resourceName attribute of <latest> resource retrieved successfully"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))){ tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)){ tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error, retrieved contentInstance with incorrect attributes"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)){ tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving <latest> resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving <latest> resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end TC_CSE_DMR_RET_012 } // end group g_CSE_DMR_RET_012 group g_CSE_DMR_RET_013 { /** * @desc Check that the IUT returns successfully the TARGET_RESOURCE_ADDRESS resource under CSEBase * */ testcase TC_CSE_DMR_RET_013_ACP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.accessControlPolicy := mw_contentAcp_rc1; v_ae1.start(f_CSE_DMR_RET_013(int1, m_createAcpBase, v_contentResponse));//AccessControlPolicy v_ae1.done; } testcase TC_CSE_DMR_RET_013_AE() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.aE := mw_contentAeBase; v_ae1.start(f_CSE_DMR_RET_013(int2, m_createAe(PX_APP_ID), v_contentResponse));//AE v_ae1.done; } testcase TC_CSE_DMR_RET_013_CNT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.container := mw_contentContainer_rc1; v_ae1.start(f_CSE_DMR_RET_013(int3, m_createContainerBase, v_contentResponse));//Container v_ae1.done; } testcase TC_CSE_DMR_RET_013_GRP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.group_ := mw_contentGroup_rc1; v_ae1.start(f_CSE_DMR_RET_013(int9, m_createGroupBase, v_contentResponse));//Group v_ae1.done; } testcase TC_CSE_DMR_RET_013_CSR() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.remoteCSE := mw_contentRemoteCSEBase; v_ae1.start(f_CSE_DMR_RET_013(int16, m_createRemoteCSEBase, v_contentResponse));//RemoteCSE v_ae1.done; } testcase TC_CSE_DMR_RET_013_SCH() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.schedule := mw_contentSchedule_rc1; v_ae1.start(f_CSE_DMR_RET_013(int18, m_createScheduleBase, v_contentResponse));//Schedule v_ae1.done; } testcase TC_CSE_DMR_RET_013_SUB() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.subscription := mw_contentSubscription_rc1; v_ae1.start(f_CSE_DMR_RET_013(int23, m_createSubscriptionBase, v_contentResponse));//Subscription v_ae1.done; } function f_CSE_DMR_RET_013(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on AeSimu { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var integer v_ae2Index := -1; var integer v_acpIndex := -1; // Test control // Test component configuration if (p_resourceType!=int16){ //ResourceType != RemoteCSE f_cf01Up(true); } else { f_cf02Up(); } // Test adapter configuration // Preamble if(p_resourceType != int2) { //ResourceType != AE v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); } if(p_resourceType != int1) { v_acpIndex := f_cse_createAccessControlPolicyAux(-, -, -); p_requestPrimitive := f_setAcpId(p_requestPrimitive, {vc_resourcesList[v_acpIndex].resource.accessControlPolicy.resourceID}); } if (p_resourceType!=int16){ //ResourceType != RemoteCSE f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive);//under the CSEBase resource } else { //ResourceType = RemoteCSE vc_cse1.start(f_cse_registerRemoteCse(p_requestPrimitive)); vc_cse1.done; v_resourceIndex := f_getRemoteCseResource(vc_cse1); } // Test Body mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_aeIndex))));//from AE ID tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Response OK for retrieving"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf02Down(); }//end f_CSE_DMR_RET_013 } // end g_CSE_DMR_RET_013 group g_CSE_DMR_RET_014 { /** * @desc Check that the IUT responds with an error when the AE tries to retrieve a resource TARGET_RESOURCE_ADDRESS under CSEBase without having privileges for the RETRIEVE operation * */ testcase TC_CSE_DMR_RET_014_ACP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_requestPrimitive := m_createAcpBase; v_requestPrimitive.primitiveContent.accessControlPolicy.selfPrivileges.accessControlRule_list[0].accessControlOperations := int61; v_ae1.start(f_CSE_DMR_RET_014(int1, v_requestPrimitive));//AccessControlPolicy v_ae1.done; } testcase TC_CSE_DMR_RET_014_AE() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_RET_014(int2, m_createPollingChannelBase));//AE v_ae1.done; } testcase TC_CSE_DMR_RET_014_CNT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_RET_014(int3, m_createContainerBase));//Container v_ae1.done; } testcase TC_CSE_DMR_RET_014_GRP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_RET_014(int9, m_createGroupBase));//Group v_ae1.done; } testcase TC_CSE_DMR_RET_014_SCH() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_RET_014(int18, m_createScheduleBase));//Schedule v_ae1.done; } testcase TC_CSE_DMR_RET_014_SUB() runs on AeSimu system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_RET_014(int23, m_createSubscriptionBase));//Subscription v_ae1.done; } function f_CSE_DMR_RET_014(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_acpAuxIndex := -1; var integer v_resourceIndex := -1; var integer v_ae2Index := -1; // Test control if(not(PICS_ACP_SUPPORT)) { log(__SCOPE__ & ":INFO: AccessControlPolicy support is required for executing this test case"); stop; } // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi; if(p_resourceType != int1) { v_acpAuxIndex := f_cse_createAccessControlPolicyAux(-, -, int61); p_requestPrimitive := f_setAcpId(p_requestPrimitive, {vc_resourcesList[v_acpAuxIndex].resource.accessControlPolicy.resourceID}); } if (p_resourceType!=int16){ //ResourceType != RemoteCSE f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive);//under the CSEBase resource } else { //ResourceType = RemoteCSE vc_cse1.start(f_cse_registerRemoteCse(p_requestPrimitive)); vc_cse1.done; v_resourceIndex := f_getRemoteCseResource(vc_cse1); } // Test Body mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_aeIndex))));//from AE ID tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Access denied to retrieve attributes from resource type " & int2str(enum2int(p_resourceType))); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving attributes from resource without having privileges"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Retrieving attributes from resource without having privileges"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_DMR_RET_014 } // end g_CSE_DMR_RET_014 group g_CSE_DMR_RET_015 { /** * @desc Check that the IUT returns successfully the ATTRIBUTE of TARGET_RESOURCE_ADDRESS resource (“To” option) under CSEBase * */ testcase TC_CSE_DMR_RET_015_ACP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.accessControlPolicy := m_contentAcp_allOmit; v_contentResponse.accessControlPolicy.parentID := ?; v_ae1.start(f_CSE_DMR_RET_015(int1, m_createAcpBase, v_contentResponse));//AccessControlPolicy v_ae1.done; } testcase TC_CSE_DMR_RET_015_AE() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.aE := m_contentAe_allOmit; v_contentResponse.aE.parentID := ?; v_ae1.start(f_CSE_DMR_RET_015(int2, m_createAe(PX_APP_ID), v_contentResponse));//AE v_ae1.done; } testcase TC_CSE_DMR_RET_015_CNT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.container := m_contentContainer_allOmit; v_contentResponse.container.parentID := ?; v_ae1.start(f_CSE_DMR_RET_015(int3, m_createContainerBase, v_contentResponse));//Container v_ae1.done; } testcase TC_CSE_DMR_RET_015_GRP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.group_ := m_contentGroup_allOmit; v_contentResponse.group_.parentID := ?; v_ae1.start(f_CSE_DMR_RET_015(int9, m_createGroupBase, v_contentResponse));//Group v_ae1.done; } testcase TC_CSE_DMR_RET_015_CSR() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.remoteCSE := m_contentRemoteCSE_allOmit; v_contentResponse.remoteCSE.parentID := ?; v_ae1.start(f_CSE_DMR_RET_015(int16, m_createRemoteCSEBase, v_contentResponse));//RemoteCSE v_ae1.done; } testcase TC_CSE_DMR_RET_015_SCH() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.schedule := m_contentSchedule_allOmit; v_contentResponse.schedule.parentID := ?; v_ae1.start(f_CSE_DMR_RET_015(int18, m_createScheduleBase,v_contentResponse));//Schedule v_ae1.done; } testcase TC_CSE_DMR_RET_015_SUB() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.subscription := m_contentSubscription_allOmit; v_contentResponse.subscription.parentID := ?; v_ae1.start(f_CSE_DMR_RET_015(int23, m_createSubscriptionBase, v_contentResponse));//Subscription v_ae1.done; } function f_CSE_DMR_RET_015(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on AeSimu { // Local variables var MsgIn v_response; var XSD.String v_attribute := "#pi";//Attribute parentId to be retrieved var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var integer v_ae2Index := -1; var integer v_acpAuxIndex := -1; // Test control // Test component configuration if (p_resourceType!=int16){ //ResourceType != RemoteCSE f_cf01Up(true); } else { f_cf02Up(); } // Test adapter configuration // Preamble if(p_resourceType != int2) { //ResourceType != AE v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); } if(p_resourceType != int1) { v_acpAuxIndex := f_cse_createAccessControlPolicyAux(-, -, -); p_requestPrimitive := f_setAcpId(p_requestPrimitive, {vc_resourcesList[v_acpAuxIndex].resource.accessControlPolicy.resourceID}); } if (p_resourceType!=int16){ //ResourceType != RemoteCSE f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive);//under the CSEBase resource } else { vc_cse1.start(f_cse_registerRemoteCse(p_requestPrimitive)); vc_cse1.done; v_resourceIndex := f_getRemoteCseResource(vc_cse1); } // Test Body mcaPort.send(m_request(m_retrieveResourceAttributeToOption(f_getResourceAddress(v_resourceIndex) & v_attribute, f_getOriginator(v_aeIndex))));//from AE ID tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Requested attribute retrieved successfully"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error, not only requested attribute retrieved"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource attribute"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attribute"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf02Down(); }//end f_CSE_DMR_RET_015 } // end g_CSE_DMR_RET_015 group g_CSE_DMR_RET_016 { /** * @desc Check that the IUT returns successfully the ATTRIBUTE of TARGET_RESOURCE_ADDRESS resource (“Content” option) under CSEBase * */ testcase TC_CSE_DMR_RET_016_ACP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.accessControlPolicy := m_contentAcp_allOmit; v_contentResponse.accessControlPolicy.parentID := ?; v_ae1.start(f_CSE_DMR_RET_016(int1, m_createAcpBase, v_contentResponse));//AccessControlPolicy v_ae1.done; } testcase TC_CSE_DMR_RET_016_AE() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.aE := m_contentAe_allOmit; v_contentResponse.aE.parentID := ?; v_ae1.start(f_CSE_DMR_RET_016(int2, m_createAe(PX_APP_ID), v_contentResponse));//AE v_ae1.done; } testcase TC_CSE_DMR_RET_016_CNT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.container := m_contentContainer_allOmit; v_contentResponse.container.parentID := ?; v_ae1.start(f_CSE_DMR_RET_016(int3, m_createContainerBase, v_contentResponse));//Container v_ae1.done; } testcase TC_CSE_DMR_RET_016_GRP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.group_ := m_contentGroup_allOmit; v_contentResponse.group_.parentID := ?; v_ae1.start(f_CSE_DMR_RET_016(int9, m_createGroupBase, v_contentResponse));//Group v_ae1.done; } testcase TC_CSE_DMR_RET_016_CSR() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.remoteCSE := m_contentRemoteCSE_allOmit; v_contentResponse.remoteCSE.parentID := ?; v_ae1.start(f_CSE_DMR_RET_016(int16, m_createRemoteCSEBase, v_contentResponse));//RemoteCSE v_ae1.done; } testcase TC_CSE_DMR_RET_016_SCH() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.schedule := m_contentSchedule_allOmit; v_contentResponse.schedule.parentID := ?; v_ae1.start(f_CSE_DMR_RET_016(int18, m_createScheduleBase, v_contentResponse));//Schedule v_ae1.done; } testcase TC_CSE_DMR_RET_016_SUB() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.subscription := m_contentSubscription_allOmit; v_contentResponse.subscription.parentID := ?; v_ae1.start(f_CSE_DMR_RET_016(int23, m_createSubscriptionBase, v_contentResponse));//Subscription v_ae1.done; } function f_CSE_DMR_RET_016(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on AeSimu { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var integer v_ae2Index := -1; var integer v_acpAuxIndex := -1; // Test control // Test component configuration if (p_resourceType!=int16){ //ResourceType != RemoteCSE f_cf01Up(true); } else { f_cf02Up(); } // Test adapter configuration // Preamble if(p_resourceType != int2) { //ResourceType != AE v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); } if(p_resourceType != int1) { v_acpAuxIndex := f_cse_createAccessControlPolicyAux(-, -, -); p_requestPrimitive := f_setAcpId(p_requestPrimitive, {vc_resourcesList[v_acpAuxIndex].resource.accessControlPolicy.resourceID}); } if (p_resourceType!=int16){ //ResourceType != RemoteCSE f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive);//under the CSEBase resource }else{ vc_cse1.start(f_cse_registerRemoteCse(p_requestPrimitive)); vc_cse1.done; v_resourceIndex := f_getRemoteCseResource(vc_cse1); } mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex) , {"pi"}, f_getOriginator(v_aeIndex))));//from AE ID tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Requested attribute retrieved successfully"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error, not only requested attribute retrieved"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource attribute"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attribute"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf02Down(); }//end f_CSE_DMR_RET_016 } // end g_CSE_DMR_RET_016 group g_CSE_DMR_RET_017 { /** * @desc Check that the IUT returns successfully multiple attributes of TARGET_RESOURCE_ADDRESS resource under CSEBase * */ testcase TC_CSE_DMR_RET_017_ACP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.accessControlPolicy := m_contentAcp_allOmit; v_contentResponse.accessControlPolicy.parentID := ?; v_contentResponse.accessControlPolicy.creationTime := ?; v_ae1.start(f_CSE_DMR_RET_017(int1, m_createAcpBase, v_contentResponse));//AccessControlPolicy v_ae1.done; } testcase TC_CSE_DMR_RET_017_AE() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.aE := m_contentAe_allOmit; v_contentResponse.aE.parentID := ?; v_contentResponse.aE.creationTime := ?; v_ae1.start(f_CSE_DMR_RET_017(int2, m_createAe(PX_APP_ID), v_contentResponse));//AE v_ae1.done; } testcase TC_CSE_DMR_RET_017_CNT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.container := m_contentContainer_allOmit; v_contentResponse.container.parentID := ?; v_contentResponse.container.creationTime := ?; v_ae1.start(f_CSE_DMR_RET_017(int3, m_createContainerBase, v_contentResponse));//Container v_ae1.done; } /*testcase TC_CSE_DMR_RET_017_DLV() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.delivery := m_contentDelivery_allOmit; v_contentResponse.delivery.parentID := ?; v_contentResponse.delivery.creationTime := ?; v_ae1.start(f_CSE_DMR_RET_017(int6, m_createDeliveryBase, v_contentResponse));//Delivery v_ae1.done; }*/ testcase TC_CSE_DMR_RET_017_GRP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.group_ := m_contentGroup_allOmit; v_contentResponse.group_.parentID := ?; v_contentResponse.group_.creationTime := ?; v_ae1.start(f_CSE_DMR_RET_017(int9, m_createGroupBase, v_contentResponse));//Group v_ae1.done; } testcase TC_CSE_DMR_RET_017_LCP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.locationPolicy := m_contentLocationPolicy_allOmit; v_contentResponse.locationPolicy.parentID := ?; v_contentResponse.locationPolicy.creationTime := ?; v_ae1.start(f_CSE_DMR_RET_017(int10, m_createLocationPolicyBase, v_contentResponse));//LocationPolicy v_ae1.done; } testcase TC_CSE_DMR_RET_017_MGC() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.mgmtCmd := m_contentMgmtCmd_allOmit; v_contentResponse.mgmtCmd.parentID := ?; v_contentResponse.mgmtCmd.creationTime := ?; v_ae1.start(f_CSE_DMR_RET_017(int12, m_createMgmtCmdBase, v_contentResponse));//MgmtCmd v_ae1.done; } testcase TC_CSE_DMR_RET_017_NOD() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.node := m_contentNode_allOmit; v_contentResponse.node.parentID := ?; v_contentResponse.node.creationTime := ?; v_ae1.start(f_CSE_DMR_RET_017(int14, m_createNodeBase, v_contentResponse));//Node v_ae1.done; } testcase TC_CSE_DMR_RET_017_CSR() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.remoteCSE := m_contentRemoteCSE_allOmit; v_contentResponse.remoteCSE.parentID := ?; v_contentResponse.remoteCSE.creationTime := ?; v_ae1.start(f_CSE_DMR_RET_017(int16, m_createRemoteCSEBase, v_contentResponse));//RemoteCSE v_ae1.done; } testcase TC_CSE_DMR_RET_017_SCH() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.schedule := m_contentSchedule_allOmit; v_contentResponse.schedule.parentID := ?; v_contentResponse.schedule.creationTime := ?; v_ae1.start(f_CSE_DMR_RET_017(int18, m_createScheduleBase, v_contentResponse));//Schedule v_ae1.done; } testcase TC_CSE_DMR_RET_017_STCL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.statsCollect := m_contentStatsCollect_allOmit; v_contentResponse.statsCollect.parentID := ?; v_contentResponse.statsCollect.creationTime := ?; v_ae1.start(f_CSE_DMR_RET_017(int21, m_createStatsCollectBase, v_contentResponse));//StatsCollect v_ae1.done; } testcase TC_CSE_DMR_RET_017_STCG() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.statsConfig := m_contentStatsConfig_allOmit; v_contentResponse.statsConfig.parentID := ?; v_contentResponse.statsConfig.creationTime := ?; v_ae1.start(f_CSE_DMR_RET_017(int22, m_createStatsConfigBase, v_contentResponse));//StatsConfig v_ae1.done; } testcase TC_CSE_DMR_RET_017_SUB() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.subscription := m_contentSubscription_allOmit; v_contentResponse.subscription.parentID := ?; v_contentResponse.subscription.creationTime := ?; v_ae1.start(f_CSE_DMR_RET_017(int23, m_createSubscriptionBase, v_contentResponse));//Subscription v_ae1.done; } function f_CSE_DMR_RET_017(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on AeSimu { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var integer v_ae2Index := -1; var integer v_acpAuxIndex := -1; // Test control // Test component configuration if (p_resourceType!=int16){ //ResourceType != RemoteCSE f_cf01Up(true); } else { f_cf02Up(); } // Test adapter configuration // Preamble if(p_resourceType != int2) { //ResourceType != AE v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); } if(p_resourceType != int1) { v_acpAuxIndex := f_cse_createAccessControlPolicyAux(-, -, -); p_requestPrimitive := f_setAcpId(p_requestPrimitive, {vc_resourcesList[v_acpAuxIndex].resource.accessControlPolicy.resourceID}); } if (p_resourceType!=int16){ //ResourceType != RemoteCSE f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive);//under the CSEBase resource }else{ vc_cse1.start(f_cse_registerRemoteCse(p_requestPrimitive)); vc_cse1.done; v_resourceIndex := f_getRemoteCseResource(vc_cse1); } mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex) , {"pi", "ct"}, f_getOriginator(v_aeIndex))));//from AE ID tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Requested attributes retrieved successfully"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error, not only requested attributes retrieved"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource attributes"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf02Down(); }//end f_CSE_DMR_RET_017 } // end g_CSE_DMR_RET_017 group g_CSE_DMR_RET_018 { /** * @desc Check that the IUT responds with an error when the AE tries to retrieve a non-existing attribute of the TARGET_RESOURCE_ADDRESS resource (“single” attribute case) under CSEBase * */ testcase TC_CSE_DMR_RET_018_ACP_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_RET_018(int1, m_createAcpBase));//AccessControlPolicy v_ae1.done; } testcase TC_CSE_DMR_RET_018_AE_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_RET_018(int2, m_createAe(PX_APP_ID)));//AE v_ae1.done; } testcase TC_CSE_DMR_RET_018_CNT_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_RET_018(int3, m_createContainerBase));//Container v_ae1.done; } testcase TC_CSE_DMR_RET_018_GRP_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_RET_018(int9, m_createGroupBase));//Group v_ae1.done; } testcase TC_CSE_DMR_RET_018_CSR_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_RET_018(int16, m_createRemoteCSEBase));//RemoteCSE v_ae1.done; } testcase TC_CSE_DMR_RET_018_SCH_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_RET_018(int18, m_createScheduleBase));//Schedule v_ae1.done; } testcase TC_CSE_DMR_RET_018_SUB_LBL() runs on AeSimu system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_RET_018(int23, m_createSubscriptionBase));//Subscription v_ae1.done; } function f_CSE_DMR_RET_018(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var integer v_ae2Index := -1; var integer v_acpAuxIndex := -1; // Test control // Test component configuration if (p_resourceType!=int16){ //ResourceType != RemoteCSE f_cf01Up(true); } else { f_cf02Up(); }; // Test adapter configuration // Preamble if(p_resourceType != int2) { //ResourceType != AE v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); } if(p_resourceType != int1) { v_acpAuxIndex := f_cse_createAccessControlPolicyAux(-, -, -); p_requestPrimitive := f_setAcpId(p_requestPrimitive, {vc_resourcesList[v_acpAuxIndex].resource.accessControlPolicy.resourceID}); } if (p_resourceType!=int16){ //ResourceType != RemoteCSE f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive);//under the CSEBase resource }else{ vc_cse1.start(f_cse_registerRemoteCse(p_requestPrimitive)); vc_cse1.done; v_resourceIndex := f_getRemoteCseResource(vc_cse1); } mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex), {"lbl"}, f_getOriginator(v_aeIndex))));//from AE ID tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Retrieved attribute does not exist"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error : attribute was retrieved while it doesn't exist"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attribute"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf02Down(); }//end f_CSE_DMR_RET_018 } // end g_CSE_DMR_RET_018 group g_CSE_DMR_RET_019 { /** * @desc Check that the IUT responds with an error when the AE tries to retrieve a non-existing attribute of the TARGET_RESOURCE_ADDRESS resource (“multiple” attributes case) under CSEBase * */ testcase TC_CSE_DMR_RET_019_ACP_LBL_AT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_RET_019(int1, m_createAcpBase));//AccessControlPolicy v_ae1.done; } testcase TC_CSE_DMR_RET_019_AE_LBL_AT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_RET_019(int2, m_createAe(PX_APP_ID)));//AE v_ae1.done; } testcase TC_CSE_DMR_RET_019_CNT_LBL_AT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_RET_019(int3, m_createContainerBase));//Container v_ae1.done; } testcase TC_CSE_DMR_RET_019_GRP_LBL_AT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_RET_019(int9, m_createGroupBase));//Group v_ae1.done; } testcase TC_CSE_DMR_RET_019_CSR_LBL_AT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_RET_019(int16, m_createRemoteCSEBase));//RemoteCSE v_ae1.done; } testcase TC_CSE_DMR_RET_019_SCH_LBL_AT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_RET_019(int18, m_createScheduleBase));//Schedule v_ae1.done; } testcase TC_CSE_DMR_RET_019_SUB_LBL_AT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_RET_019(int23, m_createSubscriptionBase));//Subscription v_ae1.done; } function f_CSE_DMR_RET_019(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var integer v_ae2Index := -1; var integer v_acpAuxIndex := -1; // Test control // Test component configuration if (p_resourceType!=int16){ //ResourceType != RemoteCSE f_cf01Up(true); } else { f_cf02Up(); } // Test adapter configuration // Preamble if(p_resourceType != int2) { //ResourceType != AE v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); } if(p_resourceType != int1) { v_acpAuxIndex := f_cse_createAccessControlPolicyAux(-, -, -); p_requestPrimitive := f_setAcpId(p_requestPrimitive, {vc_resourcesList[v_acpAuxIndex].resource.accessControlPolicy.resourceID}); } if (p_resourceType!=int16){ //ResourceType != RemoteCSE f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive);//under the CSEBase resource }else{ vc_cse1.start(f_cse_registerRemoteCse(p_requestPrimitive)); vc_cse1.done; v_resourceIndex := f_getRemoteCseResource(vc_cse1); } mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex), {"lbl", "at"}, f_getOriginator(v_aeIndex))));//from AE ID tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Retrieved attribute does not exist"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error : attribute was retrieved while it doesn't exist"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf02Down(); }//end f_CSE_DMR_RET_019 } // end f_CSE_DMR_RET_019 group g_CSE_DMR_RET_020 { /** * @desc Check that the IUT rejects a RETRIEVE Request target to TARGET_RESOURCE_ADDRESS resource when the Result Content set to RESULT_CONTENT * */ testcase TC_CSE_DMR_RET_020_RCN_0() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_RET_020(int3, m_createContainerBase, int0));//ResultContent = 0 (nothing) v_ae1.done; } testcase TC_CSE_DMR_RET_020_RCN_2() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_RET_020(int3, m_createContainerBase, int2));//ResultContent = 2 (hierarchical address) v_ae1.done; } testcase TC_CSE_DMR_RET_020_RCN_3() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_RET_020(int3, m_createContainerBase, int3));//ResultContent = 3 (attributes and hierarchichal address) v_ae1.done; } function f_CSE_DMR_RET_020(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, ResultContent p_resultContent) runs on AeSimu { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); // Test Body v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); v_request.resultContent := p_resultContent; mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) { //BAD REQUEST tc_ac.stop; setverdict(pass, __SCOPE__ & ": Request successfully rejected"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error, Result content set to " & int2str(enum2int(p_resultContent)) & " is impossible for a retrieve request "); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_DMR_RET_020 } // end g_CSE_DMR_RET_020 group g_CSE_DMR_RET_021 { /** * @desc Check that the IUT returns successfully only attributes of TARGET_RESOURCE_ADDRESS resource when the Result Content is set to 1 (attributes) * */ testcase TC_CSE_DMR_RET_021_CNT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.container := mw_contentContainer_rc1; v_ae1.start(f_CSE_DMR_RET_021(int3, m_createContainerBase, v_contentResponse, int3, m_createContainerBase));//Container v_ae1.done; } testcase TC_CSE_DMR_RET_021_GRP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.group_ := mw_contentGroup_rc1; v_ae1.start(f_CSE_DMR_RET_021(int9, m_createGroupBase, v_contentResponse, int23, m_createSubscriptionBase));//Group v_ae1.done; } testcase TC_CSE_DMR_RET_021_ACP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.accessControlPolicy := mw_contentAcp_rc1; v_ae1.start(f_CSE_DMR_RET_021(int1, m_createAcpBase,v_contentResponse, int23, m_createSubscriptionBase));//AccessControlPolicy v_ae1.done; } testcase TC_CSE_DMR_RET_021_SCH() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.schedule := mw_contentSchedule_rc1; v_ae1.start(f_CSE_DMR_RET_021(int18, m_createScheduleBase, v_contentResponse, int23, m_createSubscriptionBase));//Schedule v_ae1.done; } testcase TC_CSE_DMR_RET_021_PCH() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.pollingChannel := mw_contentPollingChannelBase; v_ae1.start(f_CSE_DMR_RET_021(int15, m_createPollingChannelBase, v_contentResponse, omit, omit));//PollingChannel v_ae1.done; } testcase TC_CSE_DMR_RET_021_SUB() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.subscription := mw_contentSubscription_rc1; v_ae1.start(f_CSE_DMR_RET_021(int23, m_createSubscriptionBase, v_contentResponse, int18, m_createScheduleBase));//Subscription v_ae1.done; } function f_CSE_DMR_RET_021(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse, template ResourceType p_childResourceType, template RequestPrimitive p_childRequestPrimitive) runs on AeSimu { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_ae2Index := -1; var integer v_resourceIndex := -1; var integer v_childResourceIndex := -1; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); if(isvalue(p_childResourceType)) { if(valueof(p_childResourceType) == int23) { f_cse_preamble_subscriptionVerification(v_ae2Index, p_childRequestPrimitive, valueof(p_childResourceType)); } else { f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, valueof(p_resourceType)); } } v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); if(p_resourceType != int15) { v_childResourceIndex := f_cse_createResource(valueof(p_childResourceType), p_childRequestPrimitive, v_resourceIndex); } // Test Body v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); v_request.resultContent := int1;//Attributes mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": No child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_DMR_RET_021 } // end g_CSE_DMR_RET_021 group g_CSE_DMR_RET_022 { /** * @desc Check that the IUT returns successfully a list all discovered resource addresses * */ testcase TC_CSE_DMR_RET_022_CNT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.container := mw_contentContainer_rc4; v_ae1.start(f_CSE_DMR_RET_022(int3, m_createContainerBase, v_contentResponse, int3, m_createContainerBase));//Container v_ae1.done; } testcase TC_CSE_DMR_RET_022_GRP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.group_ := mw_contentGroup_rc4; v_ae1.start(f_CSE_DMR_RET_022(int9, m_createGroupBase, v_contentResponse, int23, m_createSubscriptionBase));//Group v_ae1.done; } testcase TC_CSE_DMR_RET_022_ACP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.accessControlPolicy := mw_contentAcp_rc4; v_ae1.start(f_CSE_DMR_RET_022(int1, m_createAcpBase,v_contentResponse, int23, m_createSubscriptionBase));//AccessControlPolicy v_ae1.done; } testcase TC_CSE_DMR_RET_022_SCH() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.schedule := mw_contentSchedule_rc4; v_ae1.start(f_CSE_DMR_RET_022(int18, m_createScheduleBase, v_contentResponse, int23, m_createSubscriptionBase));//Schedule v_ae1.done; } testcase TC_CSE_DMR_RET_022_PCH() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.pollingChannel := mw_contentPollingChannelBase; v_ae1.start(f_CSE_DMR_RET_022(int15, m_createPollingChannelBase, v_contentResponse, omit, omit));//PollingChannel v_ae1.done; } testcase TC_CSE_DMR_RET_022_SUB() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.subscription := mw_contentSubscription_rc4; v_ae1.start(f_CSE_DMR_RET_022(int23, m_createSubscriptionBase, v_contentResponse, int18, m_createScheduleBase));//Subscription v_ae1.done; } function f_CSE_DMR_RET_022(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse, template ResourceType p_childResourceType, template RequestPrimitive p_childRequestPrimitive) runs on AeSimu { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_ae2Index := -1; var integer v_resourceIndex := -1; var integer v_childResourceIndex := -1; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); if(isvalue(p_childResourceType)) { if(valueof(p_childResourceType) == int23) { f_cse_preamble_subscriptionVerification(v_ae2Index, p_childRequestPrimitive, valueof(p_childResourceType)); } else { f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, valueof(p_resourceType)); } } v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); if(p_resourceType != int15) { v_childResourceIndex := f_cse_createResource(valueof(p_childResourceType), p_childRequestPrimitive, v_resourceIndex); } // Test Body v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); v_request.resultContent := int4;//Attributes and child resources mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": No child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_DMR_RET_022 } // end g_CSE_DMR_RET_022 group g_CSE_DMR_RET_023 { /** * @desc Check that the IUT returns successfully only attributes and child resource references of TARGET_RESOURCE_ADDRESS resource when the Result Content is set to 5 (attributes and child resource references) * */ testcase TC_CSE_DMR_RET_023_CNT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.container := mw_contentContainer_rc5; v_ae1.start(f_CSE_DMR_RET_023(int3, m_createContainerBase, v_contentResponse, int3, m_createContainerBase));//Container v_ae1.done; } testcase TC_CSE_DMR_RET_023_GRP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.group_ := mw_contentGroup_rc5; v_ae1.start(f_CSE_DMR_RET_023(int9, m_createGroupBase, v_contentResponse, int23, m_createSubscriptionBase));//Group v_ae1.done; } testcase TC_CSE_DMR_RET_023_ACP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.accessControlPolicy := mw_contentAcp_rc5; v_ae1.start(f_CSE_DMR_RET_023(int1, m_createAcpBase,v_contentResponse, int23, m_createSubscriptionBase));//AccessControlPolicy v_ae1.done; } testcase TC_CSE_DMR_RET_023_SCH() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.schedule := mw_contentSchedule_rc5; v_ae1.start(f_CSE_DMR_RET_023(int18, m_createScheduleBase, v_contentResponse, int23, m_createSubscriptionBase));//Schedule v_ae1.done; } testcase TC_CSE_DMR_RET_023_PCH() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.pollingChannel := mw_contentPollingChannelBase; v_ae1.start(f_CSE_DMR_RET_023(int15, m_createPollingChannelBase, v_contentResponse, omit, omit));//PollingChannel v_ae1.done; } testcase TC_CSE_DMR_RET_023_SUB() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.subscription := mw_contentSubscription_rc5; v_ae1.start(f_CSE_DMR_RET_023(int23, m_createSubscriptionBase, v_contentResponse, int18, m_createScheduleBase));//Subscription v_ae1.done; } function f_CSE_DMR_RET_023(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse, template ResourceType p_childResourceType, template RequestPrimitive p_childRequestPrimitive) runs on AeSimu { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_ae2Index := -1; var integer v_resourceIndex := -1; var integer v_childResourceIndex := -1; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); if(isvalue(p_childResourceType)) { if(valueof(p_childResourceType) == int23) { f_cse_preamble_subscriptionVerification(v_ae2Index, p_childRequestPrimitive, valueof(p_childResourceType)); } else { f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, valueof(p_resourceType)); } } v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); if(p_resourceType != int15) { v_childResourceIndex := f_cse_createResource(valueof(p_childResourceType), p_childRequestPrimitive, v_resourceIndex); } // Test Body v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); v_request.resultContent := int5;//attributes and child resource references mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": No child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_DMR_RET_023 } // end g_CSE_DMR_RET_023 group g_CSE_DMR_RET_024 { /** * @desc Check that the IUT returns successfully only child resource references of TARGET_RESOURCE_ADDRESS resource when Result Content is set to 6 (child resource references) * */ testcase TC_CSE_DMR_RET_024_CNT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.container := mw_contentContainer_rc6; v_ae1.start(f_CSE_DMR_RET_024(int3, m_createContainerBase, v_contentResponse, int3, m_createContainerBase));//Container v_ae1.done; } testcase TC_CSE_DMR_RET_024_GRP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.group_ := mw_contentGroup_rc6; v_ae1.start(f_CSE_DMR_RET_024(int9, m_createGroupBase, v_contentResponse, int23, m_createSubscriptionBase));//Group v_ae1.done; } testcase TC_CSE_DMR_RET_024_ACP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.accessControlPolicy := mw_contentAcp_rc6; v_ae1.start(f_CSE_DMR_RET_024(int1, m_createAcpBase,v_contentResponse, int23, m_createSubscriptionBase));//AccessControlPolicy v_ae1.done; } testcase TC_CSE_DMR_RET_024_SCH() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.schedule := mw_contentSchedule_rc6; v_ae1.start(f_CSE_DMR_RET_024(int18, m_createScheduleBase, v_contentResponse, int23, m_createSubscriptionBase));//Schedule v_ae1.done; } testcase TC_CSE_DMR_RET_024_PCH() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.pollingChannel := mw_contentPollingChannelBase; v_ae1.start(f_CSE_DMR_RET_024(int15, m_createPollingChannelBase, v_contentResponse, omit, omit));//PollingChannel v_ae1.done; } testcase TC_CSE_DMR_RET_024_SUB() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.subscription := mw_contentSubscription_rc6; v_ae1.start(f_CSE_DMR_RET_024(int23, m_createSubscriptionBase, v_contentResponse, int18, m_createScheduleBase));//Subscription v_ae1.done; } function f_CSE_DMR_RET_024(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse, template ResourceType p_childResourceType, template RequestPrimitive p_childRequestPrimitive) runs on AeSimu { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_ae2Index := -1; var integer v_resourceIndex := -1; var integer v_childResourceIndex := -1; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); if(isvalue(p_childResourceType)) { if(valueof(p_childResourceType) == int23) { f_cse_preamble_subscriptionVerification(v_ae2Index, p_childRequestPrimitive, valueof(p_childResourceType)); } else { f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, valueof(p_resourceType)); } } v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); if(p_resourceType != int15) { v_childResourceIndex := f_cse_createResource(valueof(p_childResourceType), p_childRequestPrimitive, v_resourceIndex); } // Test Body v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); v_request.resultContent := int6;//Child resource references mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": No child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_DMR_RET_024 } // end g_CSE_DMR_RET_024 group g_CSE_DMR_RET_025 { /** * @desc Check that the IUT returns successfully only child resources of TARGET_RESOURCE_ADDRESS resource when Result Content is set to 8 (child resources) * */ testcase TC_CSE_DMR_RET_025_CNT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.container := mw_contentContainer_rc8; v_ae1.start(f_CSE_DMR_RET_025(int3, m_createContainerBase, v_contentResponse, int3, m_createContainerBase));//Container v_ae1.done; } testcase TC_CSE_DMR_RET_025_GRP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.group_ := mw_contentGroup_rc8; v_ae1.start(f_CSE_DMR_RET_025(int9, m_createGroupBase, v_contentResponse, int23, m_createSubscriptionBase));//Group v_ae1.done; } testcase TC_CSE_DMR_RET_025_ACP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.accessControlPolicy := mw_contentAcp_rc8; v_ae1.start(f_CSE_DMR_RET_025(int1, m_createAcpBase,v_contentResponse, int23, m_createSubscriptionBase));//AccessControlPolicy v_ae1.done; } testcase TC_CSE_DMR_RET_025_SCH() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.schedule := mw_contentSchedule_rc8; v_ae1.start(f_CSE_DMR_RET_025(int18, m_createScheduleBase, v_contentResponse, int23, m_createSubscriptionBase));//Schedule v_ae1.done; } testcase TC_CSE_DMR_RET_025_PCH() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.pollingChannel := mw_contentPollingChannelBase; v_ae1.start(f_CSE_DMR_RET_025(int15, m_createPollingChannelBase, v_contentResponse, omit, omit));//PollingChannel v_ae1.done; } testcase TC_CSE_DMR_RET_025_SUB() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.subscription := mw_contentSubscription_rc8; v_ae1.start(f_CSE_DMR_RET_025(int23, m_createSubscriptionBase, v_contentResponse, int18, m_createScheduleBase));//Subscription v_ae1.done; } function f_CSE_DMR_RET_025(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse, template ResourceType p_childResourceType, template RequestPrimitive p_childRequestPrimitive) runs on AeSimu { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_ae2Index := -1; var integer v_resourceIndex := -1; var integer v_childResourceIndex := -1; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); if(isvalue(p_childResourceType)) { if(valueof(p_childResourceType) == int23) { f_cse_preamble_subscriptionVerification(v_ae2Index, p_childRequestPrimitive, valueof(p_childResourceType)); } else { f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, valueof(p_resourceType)); } } v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); if(p_resourceType != int15) { v_childResourceIndex := f_cse_createResource(valueof(p_childResourceType), p_childRequestPrimitive, v_resourceIndex); } // Test Body v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); v_request.resultContent := int6;//Child resource references mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": No child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_DMR_RET_025 } // end g_CSE_DMR_RET_025 }//end group Retrieve group Update { group g_CSE_DMR_UPD_001 { /** * @desc Check that the IUT updates successfully the value of the attribute ATTRIBUTE_NAME of the TARGET_RESOURCE_ADDRESS resource * */ testcase TC_CSE_DMR_UPD_001_CNT_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Labels v_labels_1 := {"VALUE_1"}; var Labels v_labels_2:= {"VALUE_2"}; var ResponsePrimitive v_responsePrimitive; var template RequestPrimitive v_createRequest := m_createContainerBase; var template RequestPrimitive v_updateRequest := m_updateContainerBase; var PrimitiveContent v_primitiveContentRetrieveResource; v_createRequest.primitiveContent.container.labels := v_labels_1; v_updateRequest.primitiveContent.container.labels := v_labels_2; v_ae1.start(f_CSE_DMR_UPD_001(int3, v_createRequest, v_updateRequest));//Container v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.container)) { if(v_responsePrimitive.primitiveContent.container.labels != v_labels_2){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.container)) { if(v_primitiveContentRetrieveResource.container.labels != v_labels_2){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_001_GRP_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Labels v_labels_1 := {"VALUE_1"}; var Labels v_labels_2 := {"VALUE_2"}; var template RequestPrimitive v_createRequest := m_createGroupBase; var template RequestPrimitive v_updateRequest := m_updateGroupBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_createRequest.primitiveContent.group_.labels := v_labels_1; v_updateRequest.primitiveContent.group_.labels := v_labels_2; v_ae1.start(f_CSE_DMR_UPD_001(int9, v_createRequest, v_updateRequest));//Group v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.group_)) { if(v_responsePrimitive.primitiveContent.group_.labels != v_labels_2){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.group_)) { if(v_primitiveContentRetrieveResource.group_.labels != v_labels_2){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_001_ACP_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Labels v_labels_1 := {"VALUE_1"}; var Labels v_labels_2 := {"VALUE_2"}; var template RequestPrimitive v_createRequest := m_createAcpBase; var template RequestPrimitive v_updateRequest := m_updateAcpBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_createRequest.primitiveContent.accessControlPolicy.labels := v_labels_1; v_updateRequest.primitiveContent.accessControlPolicy.labels := v_labels_2; v_ae1.start(f_CSE_DMR_UPD_001(int1, v_createRequest, v_updateRequest));//ACP v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.accessControlPolicy)) { if(v_responsePrimitive.primitiveContent.accessControlPolicy.labels != v_labels_2){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.accessControlPolicy)) { if(v_primitiveContentRetrieveResource.accessControlPolicy.labels != v_labels_2){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_001_SCH_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Labels v_labels_1 := {"VALUE_1"}; var Labels v_labels_2 := {"VALUE_2"}; var template RequestPrimitive v_createRequest := m_createScheduleBase; var template RequestPrimitive v_updateRequest := m_updateScheduleBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_createRequest.primitiveContent.schedule.labels := v_labels_1; v_updateRequest.primitiveContent.schedule.labels := v_labels_2; v_ae1.start(f_CSE_DMR_UPD_001(int18, v_createRequest, v_updateRequest));//Schedule v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.schedule)) { if(v_responsePrimitive.primitiveContent.schedule.labels != v_labels_2){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.schedule)) { if(v_primitiveContentRetrieveResource.schedule.labels != v_labels_2){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_001_PCH_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Labels v_labels_1 := {"VALUE_1"}; var Labels v_labels_2 := {"VALUE_2"}; var template RequestPrimitive v_createRequest := m_createPollingChannelBase; var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_createRequest.primitiveContent.pollingChannel.labels := v_labels_1; v_updateRequest.primitiveContent.pollingChannel.labels := v_labels_2; v_ae1.start(f_CSE_DMR_UPD_001(int15, v_createRequest, v_updateRequest));//PollingChannel v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.pollingChannel)) { if(v_responsePrimitive.primitiveContent.pollingChannel.labels != v_labels_2){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.pollingChannel)) { if(v_primitiveContentRetrieveResource.pollingChannel.labels != v_labels_2){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_001_SUB_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Labels v_labels_1 := {"VALUE_1"}; var Labels v_labels_2 := {"VALUE_2"}; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_createRequest.primitiveContent.subscription.labels := v_labels_1; v_updateRequest.primitiveContent.subscription.labels := v_labels_2; v_ae1.start(f_CSE_DMR_UPD_001(int23, v_createRequest, v_updateRequest));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { if(v_responsePrimitive.primitiveContent.subscription.labels != v_labels_2){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.subscription)) { if(v_primitiveContentRetrieveResource.subscription.labels != v_labels_2){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") } } } } function f_CSE_DMR_UPD_001(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive) runs on AeSimu return ResponsePrimitive{ // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var integer v_ae2Index := -1; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); // Test Body v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value vc_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated successfully"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while updating resource type " & int2str(enum2int(p_resourceType))); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); } } f_checkAeSimuStatus(); //Used to check that the resource has been updated vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); return vc_response.primitive.responsePrimitive; }//end f_CSE_DMR_UPD_001 } // end g_CSE_DMR_UPD_001 group g_CSE_DMR_UPD_002 { /** * @desc Check that the IUT adds successfully the attribute ATTRIBUTE_NAME to the TARGET_RESOURCE_ADDRESS resource * */ testcase TC_CSE_DMR_UPD_002_CNT_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Labels v_labels_1 := {"VALUE_1"}; var template RequestPrimitive v_updateRequest := m_updateContainerBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.container.labels := v_labels_1; v_ae1.start(f_CSE_DMR_UPD_002(int3, m_createContainerBase, v_updateRequest));//Container v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.container)) { if(v_responsePrimitive.primitiveContent.container.labels != v_labels_1){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.container)) { if(v_primitiveContentRetrieveResource.container.labels != v_labels_1){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_002_GRP_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Labels v_labels_1 := {"VALUE_1"}; var template RequestPrimitive v_updateRequest := m_updateGroupBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.group_.labels := v_labels_1; v_ae1.start(f_CSE_DMR_UPD_002(int9, m_createGroupBase, v_updateRequest));//Group v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.group_)) { if(v_responsePrimitive.primitiveContent.group_.labels != v_labels_1){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.group_)) { if(v_primitiveContentRetrieveResource.group_.labels != v_labels_1){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_002_ACP_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Labels v_labels_1 := {"VALUE_1"}; var template RequestPrimitive v_updateRequest := m_updateAcpBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.accessControlPolicy.labels := v_labels_1; v_ae1.start(f_CSE_DMR_UPD_002(int1, m_createAcpBase,v_updateRequest));//AccessControlPolicy v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.accessControlPolicy)) { if(v_responsePrimitive.primitiveContent.accessControlPolicy.labels != v_labels_1){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.accessControlPolicy)) { if(v_primitiveContentRetrieveResource.accessControlPolicy.labels != v_labels_1){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_002_SCH_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Labels v_labels_1 := {"VALUE_1"}; var template RequestPrimitive v_updateRequest := m_updateScheduleBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.schedule.labels := v_labels_1; v_ae1.start(f_CSE_DMR_UPD_002(int18, m_createScheduleBase,v_updateRequest));//Schedule v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.schedule)) { if(v_responsePrimitive.primitiveContent.schedule.labels != v_labels_1){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.schedule)) { if(v_primitiveContentRetrieveResource.schedule.labels != v_labels_1){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_002_PCH_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Labels v_labels_1 := {"VALUE_1"}; var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.pollingChannel.labels := v_labels_1; v_ae1.start(f_CSE_DMR_UPD_002(int15, m_createPollingChannelBase,v_updateRequest));//PollingChannel v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.pollingChannel)) { if(v_responsePrimitive.primitiveContent.pollingChannel.labels != v_labels_1){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.pollingChannel)) { if(v_primitiveContentRetrieveResource.pollingChannel.labels != v_labels_1){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_002_SUB_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Labels v_labels_1 := {"VALUE_1"}; var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.subscription.labels := v_labels_1; v_ae1.start(f_CSE_DMR_UPD_002(int23, m_createSubscriptionBase,v_updateRequest));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { if(v_responsePrimitive.primitiveContent.subscription.labels != v_labels_1){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.subscription)) { if(v_primitiveContentRetrieveResource.subscription.labels != v_labels_1){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") } } } } function f_CSE_DMR_UPD_002(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive) runs on AeSimu return ResponsePrimitive { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var integer v_ae2Index := -1; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); // Test Body v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value vc_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated successfully"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while updating resource type " & int2str(enum2int(p_resourceType))); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); } } //Used to check that the resource has been updated vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); return vc_response.primitive.responsePrimitive; }//end f_CSE_DMR_UPD_002 } // end g_CSE_DMR_UPD_002 group g_CSE_DMR_UPD_003 { /** * @desc Check that the IUT deletes successfully the attribute ATTRIBUTE_NAME from the TARGET_RESOURCE_ADDRESS resource * */ testcase TC_CSE_DMR_UPD_003_CNT_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Labels v_labels_1 := {"VALUE_1"}; var Labels v_labels_2 := {"To be deleted"}; var AttributeAux_list v_nullFields; var ResponsePrimitive v_responsePrimitive; var template RequestPrimitive v_createRequest := m_createContainerBase; var template RequestPrimitive v_updateRequest := m_updateContainerBase; var PrimitiveContent v_primitiveContentRetrieveResource; v_createRequest.primitiveContent.container.labels := v_labels_1; v_updateRequest.primitiveContent.container.labels := v_labels_2; v_nullFields := {{"labels", omit}}; v_ae1.start(f_CSE_DMR_UPD_003(int3, v_createRequest, v_updateRequest, v_nullFields));//Container v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.container)) { if(ispresent(v_responsePrimitive.primitiveContent.container.labels)){ if(not(match(v_responsePrimitive.primitiveContent.container.labels,{""}))) { setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly"); } } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.container)) { if(ispresent(v_primitiveContentRetrieveResource.container.labels)) { if(not(match(v_primitiveContentRetrieveResource.container.labels,{""}))){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") } } } } } testcase TC_CSE_DMR_UPD_003_GRP_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Labels v_labels_1 := {"VALUE_1"}; var Labels v_labels_2 := {"To be deleted"}; var AttributeAux_list v_nullFields; var ResponsePrimitive v_responsePrimitive; var template RequestPrimitive v_createRequest := m_createGroupBase; var template RequestPrimitive v_updateRequest := m_updateGroupBase; var PrimitiveContent v_primitiveContentRetrieveResource; v_createRequest.primitiveContent.group_.labels := v_labels_1; v_updateRequest.primitiveContent.group_.labels := v_labels_2; v_nullFields := {{"labels", omit}}; v_ae1.start(f_CSE_DMR_UPD_003(int9, v_createRequest, v_updateRequest, v_nullFields));//Group v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.group_)) { if(ispresent(v_responsePrimitive.primitiveContent.group_.labels)){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.group_)) { if(ispresent(v_primitiveContentRetrieveResource.group_.labels)) { if(not(match(v_primitiveContentRetrieveResource.group_.labels,{""}))){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") } } } } } testcase TC_CSE_DMR_UPD_003_ACP_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Labels v_labels_1 := {"VALUE_1"}; var Labels v_labels_2 := {"To be deleted"}; var AttributeAux_list v_nullFields; var ResponsePrimitive v_responsePrimitive; var template RequestPrimitive v_createRequest := m_createAcpBase; var template RequestPrimitive v_updateRequest := m_updateAcpBase; var PrimitiveContent v_primitiveContentRetrieveResource; v_createRequest.primitiveContent.accessControlPolicy.labels := v_labels_1; v_updateRequest.primitiveContent.accessControlPolicy.labels := v_labels_2; v_nullFields := {{"labels", omit}}; v_ae1.start(f_CSE_DMR_UPD_003(int1, v_createRequest, v_updateRequest, v_nullFields));//AccessControlPolicy v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.accessControlPolicy)) { if(ispresent(v_responsePrimitive.primitiveContent.accessControlPolicy.labels)){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.accessControlPolicy)) { if(ispresent(v_primitiveContentRetrieveResource.accessControlPolicy.labels)) { if(not(match(v_primitiveContentRetrieveResource.accessControlPolicy.labels,{""}))){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") } } } } } testcase TC_CSE_DMR_UPD_003_SCH_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Labels v_labels_1 := {"VALUE_1"}; var Labels v_labels_2 := {"To be deleted"}; var AttributeAux_list v_nullFields; var ResponsePrimitive v_responsePrimitive; var template RequestPrimitive v_createRequest := m_createScheduleBase; var template RequestPrimitive v_updateRequest := m_updateScheduleBase; var PrimitiveContent v_primitiveContentRetrieveResource; v_createRequest.primitiveContent.schedule.labels := v_labels_1; v_updateRequest.primitiveContent.schedule.labels := v_labels_2; v_nullFields := {{"labels", omit}}; v_ae1.start(f_CSE_DMR_UPD_003(int18, v_createRequest, v_updateRequest, v_nullFields));//Schedule v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.schedule)) { if(ispresent(v_responsePrimitive.primitiveContent.schedule.labels)){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.schedule)) { if(ispresent(v_primitiveContentRetrieveResource.schedule.labels)) { if(not(match(v_primitiveContentRetrieveResource.schedule.labels,{""}))){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") } } } } } testcase TC_CSE_DMR_UPD_003_PCH_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Labels v_labels_1 := {"VALUE_1"}; var Labels v_labels_2 := {"To be deleted"}; var AttributeAux_list v_nullFields; var ResponsePrimitive v_responsePrimitive; var template RequestPrimitive v_createRequest := m_createPollingChannelBase; var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase; var PrimitiveContent v_primitiveContentRetrieveResource; v_createRequest.primitiveContent.pollingChannel.labels := v_labels_1; v_updateRequest.primitiveContent.pollingChannel.labels := v_labels_2; v_nullFields := {{"labels", omit}}; v_ae1.start(f_CSE_DMR_UPD_003(int15, v_createRequest, v_updateRequest, v_nullFields));//PollingChannel v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.pollingChannel)) { if(ispresent(v_responsePrimitive.primitiveContent.pollingChannel.labels)){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.pollingChannel)) { if(ispresent(v_primitiveContentRetrieveResource.pollingChannel.labels)) { if(not(match(v_primitiveContentRetrieveResource.pollingChannel.labels,{""}))){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") } } } } } testcase TC_CSE_DMR_UPD_003_SUB_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Labels v_labels_1 := {"VALUE_1"}; var Labels v_labels_2 := {"To be deleted"}; var AttributeAux_list v_nullFields; var ResponsePrimitive v_responsePrimitive; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; var PrimitiveContent v_primitiveContentRetrieveResource; v_createRequest.primitiveContent.subscription.labels := v_labels_1; v_updateRequest.primitiveContent.subscription.labels := v_labels_2; v_nullFields := {{"labels", omit}}; v_ae1.start(f_CSE_DMR_UPD_003(int23, v_createRequest, v_updateRequest, v_nullFields));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { if(ispresent(v_responsePrimitive.primitiveContent.subscription.labels)){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.subscription)) { if(ispresent(v_primitiveContentRetrieveResource.subscription.labels)) { if(not(match(v_primitiveContentRetrieveResource.subscription.labels,{""}))){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") } } } } } function f_CSE_DMR_UPD_003(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, template (omit) AttributeAux_list p_nullFields := omit) runs on AeSimu return ResponsePrimitive { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var integer v_ae2Index := -1; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); //f_match2PrimitiveContent(vc_resourcesList[v_resourceIndex].resource, p_createRequestPrimitive.primitiveContent); TODO fix the match problem // Test Body v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); mcaPort.send(m_request(v_request, p_nullFields)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value vc_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated successfully"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while updating resource type " & int2str(enum2int(p_resourceType))); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); } } vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); return vc_response.primitive.responsePrimitive; }//end f_CSE_DMR_UPD_003 } // end g_CSE_DMR_UPD_003 group g_CSE_DMR_UPD_004 { /** * @desc Check that the IUT updates the value of the attribute ATTRIBUTE_NAME_1, and creates the ATTRIBUTE_NAME_2 and deletes the ATTRIBUTE_NAME_3 of the TARGET_RESOURCE_ADDRESS resource * */ testcase TC_CSE_DMR_UPD_004_CNT_ET_MNI_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Labels v_labels_1 := {"VALUE_1"}; var Labels v_labels_2 := {"To be deleted"}; var template RequestPrimitive v_createRequest := m_createContainerBase; var template RequestPrimitive v_updateRequest := m_updateContainerBase; var ResponsePrimitive v_responsePrimitive; var AttributeAux_list v_nullFields; var PrimitiveContent v_primitiveContentRetrieveResource; v_createRequest.primitiveContent.container.labels := v_labels_1;//Attribute 3 v_updateRequest.primitiveContent.container.expirationTime := "20301231T012345";//Attribute 1 v_updateRequest.primitiveContent.container.maxNrOfInstances := 5;//Attribute 2 v_updateRequest.primitiveContent.container.labels := v_labels_2;//Attribute 3 v_nullFields := {{"labels", omit}}; v_ae1.start(f_CSE_DMR_UPD_004(int3, v_createRequest, v_updateRequest, v_nullFields));//Container v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.container)) { //Check attribute 1 if(v_responsePrimitive.primitiveContent.container.expirationTime != valueof(v_updateRequest.primitiveContent.container.expirationTime)){ setverdict(fail, __SCOPE__ & ": Error: Expiration Time attribute not updated correctly") } //Check attribute 2 if(v_responsePrimitive.primitiveContent.container.maxNrOfInstances != valueof(v_updateRequest.primitiveContent.container.maxNrOfInstances)){ setverdict(fail, __SCOPE__ & ": Error: MaxNrOfInstances attribute not updated correctly") } //Check attribute 3 if(ispresent(v_responsePrimitive.primitiveContent.container.labels)){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.container)) { //Check attribute 1 if(v_primitiveContentRetrieveResource.container.expirationTime != valueof(v_updateRequest.primitiveContent.container.expirationTime)){ setverdict(fail, __SCOPE__ & ": Error: Expiration Time attribute not updated correctly") } //Check attribute 2 if(v_primitiveContentRetrieveResource.container.maxNrOfInstances != valueof(v_updateRequest.primitiveContent.container.maxNrOfInstances)){ setverdict(fail, __SCOPE__ & ": Error: MaxNrOfInstances attribute not updated correctly") } //Check attribute 3 if(ispresent(v_primitiveContentRetrieveResource.container.labels)){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") } } } } testcase TC_CSE_DMR_UPD_004_GRP_ET_GN_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var XSD.String v_groupName_1 := "VALUE_1"; var Labels v_labels_1 := {"VALUE_1"}; var Labels v_labels_2 := {"To be deleted"}; var AttributeAux_list v_nullFields; var template RequestPrimitive v_createRequest := m_createGroupBase; var template RequestPrimitive v_updateRequest := m_updateGroupBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_createRequest.primitiveContent.group_.labels := v_labels_1;//Attribute 3 v_updateRequest.primitiveContent.group_.expirationTime := "20301231T012345";//Attribute 1 v_updateRequest.primitiveContent.group_.groupName:= v_groupName_1;//Attribute 2 v_updateRequest.primitiveContent.group_.labels := v_labels_2;//Attribute 3 v_nullFields := {{"labels", omit}}; v_ae1.start(f_CSE_DMR_UPD_004(int9, v_createRequest, v_updateRequest, v_nullFields));//Group v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.group_)) { //Check attribute 1 if(not match(v_responsePrimitive.primitiveContent.group_.groupName, valueof(v_updateRequest.primitiveContent.group_.groupName))){ setverdict(fail, __SCOPE__ & ": Error: groupName attribute not updated correctly") } //Check attribute 2 if(not match(v_responsePrimitive.primitiveContent.group_.expirationTime, valueof(v_updateRequest.primitiveContent.group_.expirationTime))){ setverdict(fail, __SCOPE__ & ": Error: expirationTime attribute not updated correctly") } //Check attribute 3 if(ispresent(v_responsePrimitive.primitiveContent.group_.labels)){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.group_)) { //Check attribute 1 if(v_primitiveContentRetrieveResource.group_.groupName != valueof(v_updateRequest.primitiveContent.group_.groupName)){ setverdict(fail, __SCOPE__ & ": Error: groupName attribute not updated correctly") } //Check attribute 2 if(v_primitiveContentRetrieveResource.group_.expirationTime != valueof(v_updateRequest.primitiveContent.group_.expirationTime)){ setverdict(fail, __SCOPE__ & ": Error: expirationTime attribute not updated correctly") } //Check attribute 3 if(ispresent(v_primitiveContentRetrieveResource.group_.labels)){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") } } } } testcase TC_CSE_DMR_UPD_004_ACP_PV_AT_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Labels v_labels_1 := {"VALUE_1"}; var Labels v_labels_2 := {"To be deleted"}; var SetOfAcrs v_privileges_2 := {accessControlRule_list := {valueof(m_createAcr({PX_SUPER_AE_ID}, int61))}}; var AttributeAux_list v_nullFields; var template RequestPrimitive v_createRequest := m_createAcpBase;// privileges set by default to 63 for * var template RequestPrimitive v_updateRequest := m_updateAcpBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_createRequest.primitiveContent.accessControlPolicy.labels := v_labels_1;//Attribute 3 v_updateRequest.primitiveContent.accessControlPolicy.privileges := v_privileges_2; //Attribute 1 v_updateRequest.primitiveContent.accessControlPolicy.announceTo := {f_getAnnouncementTargetPoA()};//Attribute 2 v_updateRequest.primitiveContent.accessControlPolicy.labels := v_labels_2;//Attribute 3 v_nullFields := {{"labels", omit}}; v_ae1.start(f_CSE_DMR_UPD_004(int1, v_createRequest, v_updateRequest, v_nullFields));//AccessControlPolicy v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.accessControlPolicy)) { //Check attribute 1 if(not match(v_responsePrimitive.primitiveContent.accessControlPolicy.privileges.accessControlRule_list[0].accessControlOperations, v_privileges_2.accessControlRule_list[0].accessControlOperations)){ setverdict(fail, __SCOPE__ & ": Error: Privileges attribute not updated correctly") } //Check attribute 2 if(not match(v_responsePrimitive.primitiveContent.accessControlPolicy.announceTo, valueof(v_updateRequest.primitiveContent.accessControlPolicy.announceTo))){ setverdict(fail, __SCOPE__ & ": Error: Announce_to attribute not updated correctly") } //Check attribute 3 if(ispresent(v_responsePrimitive.primitiveContent.accessControlPolicy.labels)){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.accessControlPolicy)) { //Check attribute 1 if(not match (v_primitiveContentRetrieveResource.accessControlPolicy.privileges.accessControlRule_list[0].accessControlOperations, v_privileges_2.accessControlRule_list[0].accessControlOperations)){ setverdict(fail, __SCOPE__ & ": Error: Privileges attribute not updated correctly") } //Check attribute 2 if(not match (v_primitiveContentRetrieveResource.accessControlPolicy.announceTo, valueof(v_updateRequest.primitiveContent.accessControlPolicy.announceTo))){ setverdict(fail, __SCOPE__ & ": Error: Announce_to attribute not updated correctly") } //Check attribute 3 if(ispresent(v_primitiveContentRetrieveResource.accessControlPolicy.labels)){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") } } } } testcase TC_CSE_DMR_UPD_004_SCH_SE_AT_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Labels v_labels_1 := {"To be deleted"}; var AttributeAux_list v_nullFields; var template RequestPrimitive v_createRequest := m_createScheduleBase; var template RequestPrimitive v_updateRequest := m_updateScheduleBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_createRequest.primitiveContent.schedule.scheduleElement := {{"0,0,0 1 2,1,1,*"}};//Attribute 1 v_updateRequest.primitiveContent.schedule.scheduleElement := {{"1,1,1 1 2,1,1,*"}}; //Attribute 1 v_updateRequest.primitiveContent.schedule.announceTo := {f_getAnnouncementTargetPoA()};//Attribute 2 v_updateRequest.primitiveContent.schedule.labels := v_labels_1;//Attribute 3 v_nullFields := {{"labels", omit}}; v_ae1.start(f_CSE_DMR_UPD_004(int18, v_createRequest, v_updateRequest, v_nullFields));//Schedule v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.schedule)) { //Check attribute 1 if(v_responsePrimitive.primitiveContent.schedule.scheduleElement != valueof(v_updateRequest.primitiveContent.schedule.scheduleElement)){ setverdict(fail, __SCOPE__ & ": Error: Schedule Element attribute not updated correctly") } //Check attribute 2 if(v_responsePrimitive.primitiveContent.schedule.announceTo != valueof(v_updateRequest.primitiveContent.schedule.announceTo)){ setverdict(fail, __SCOPE__ & ": Error: Announce_To attribute not updated correctly") } //Check attribute 3 if(ispresent(v_responsePrimitive.primitiveContent.schedule.labels)){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.schedule)) { //Check attribute 1 if(v_primitiveContentRetrieveResource.schedule.scheduleElement != valueof(v_updateRequest.primitiveContent.schedule.scheduleElement)){ setverdict(fail, __SCOPE__ & ": Error: Schedule Element attribute not updated correctly") } //Check attribute 2 if(v_primitiveContentRetrieveResource.schedule.announceTo != valueof(v_updateRequest.primitiveContent.schedule.announceTo)){ setverdict(fail, __SCOPE__ & ": Error: Announce_To attribute not updated correctly") } //Check attribute 3 if(ispresent(v_primitiveContentRetrieveResource.schedule.labels)){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") } } } } testcase TC_CSE_DMR_UPD_004_PCH_LBL_ACP_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Labels v_labels_1 := {"VALUE_1"}; var Labels v_labels_2 := {"To be deleted"}; var AttributeAux_list v_nullFields; var template RequestPrimitive v_createRequest := m_createPollingChannelBase; var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_createRequest.primitiveContent.pollingChannel.labels := v_labels_1;//Attribute 3 //No Attribute 1 //v_updateRequest.primitiveContent.pollingChannel.accessControlPolicyIDs := v_acp;//Attribute 2 TODO Find another alternative for Attribute 2 v_updateRequest.primitiveContent.pollingChannel.labels := v_labels_2;//Attribute 3 v_nullFields := {{"labels", omit}}; v_ae1.start(f_CSE_DMR_UPD_004(int15, v_createRequest, v_updateRequest, v_nullFields));//PollingChannel v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.pollingChannel)) { //Check attribute 1 //Check attribute 2 TODO once another alternative is found, activate this checking /*if(not match(v_responsePrimitive.primitiveContent.pollingChannel.accessControlPolicyIDs, valueof(v_updateRequest.primitiveContent.pollingChannel.accessControlPolicyIDs))){ setverdict(fail, __SCOPE__ & ": Error: ACPI attribute not added correctly") }*/ //Check attribute 3 if(ispresent(v_responsePrimitive.primitiveContent.pollingChannel.labels)){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.pollingChannel)) { if(ispresent (v_primitiveContentRetrieveResource.pollingChannel.labels)){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") } } } } testcase TC_CSE_DMR_UPD_004_SUB_ET_LBL_EXC() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Labels v_labels_1 := {"VALUE_1"}; var AttributeAux_list v_nullFields; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_createRequest.primitiveContent.subscription.expirationCounter := 10;//Attribute 3 v_updateRequest.primitiveContent.subscription.expirationTime := "20301231T012345";//Attribute 1 v_updateRequest.primitiveContent.subscription.labels := v_labels_1;//Attribute 2 v_updateRequest.primitiveContent.subscription.expirationCounter := 5;//Attribute 3 v_nullFields := {{"expirationCounter", omit}}; v_ae1.start(f_CSE_DMR_UPD_004(int23, v_createRequest, v_updateRequest, v_nullFields));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { //Check attribute 1 if(not match(v_responsePrimitive.primitiveContent.subscription.labels, valueof(v_updateRequest.primitiveContent.subscription.labels))){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") } //Check attribute 2 if(not match(v_responsePrimitive.primitiveContent.subscription.expirationTime, valueof(v_updateRequest.primitiveContent.subscription.expirationTime))){ setverdict(fail, __SCOPE__ & ": Error: expirationTime attribute not updated correctly") } //Check attribute 3 if(ispresent(v_responsePrimitive.primitiveContent.subscription.expirationCounter)){ setverdict(fail, __SCOPE__ & ": Error: expirationCounter attribute not deleted correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.subscription)) { //Check attribute 1 if(not match (v_primitiveContentRetrieveResource.subscription.labels, valueof(v_updateRequest.primitiveContent.subscription.labels))){ setverdict(fail, __SCOPE__ & ": Error: Label attribute not updated correctly") } //Check attribute 2 if(not match (v_primitiveContentRetrieveResource.subscription.expirationTime, valueof(v_updateRequest.primitiveContent.subscription.expirationTime))){ setverdict(fail, __SCOPE__ & ": Error: expirationTime attribute not updated correctly") } //Check attribute 3 if(ispresent(v_primitiveContentRetrieveResource.subscription.expirationCounter)){ setverdict(fail, __SCOPE__ & ": Error: expirationCounter attribute not deleted correctly") } } } } function f_CSE_DMR_UPD_004(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, template (omit) AttributeAux_list p_nullFields := omit) runs on AeSimu return ResponsePrimitive { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var integer v_ae2Index := -1; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); // Test Body v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); mcaPort.send(m_request(v_request, p_nullFields)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value vc_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated successfully"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while updating resource type " & int2str(enum2int(p_resourceType))); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); } } vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); return vc_response.primitive.responsePrimitive; }//end f_CSE_DMR_UPD_004 } // end g_CSE_DMR_UPD_004 group g_CSE_DMR_UPD_005{ /** * @desc Check that the IUT responds with an error when the AE tries to update an attribute of a TARGET_RESOURCE_ADDRESS resource which does not exist * */ testcase TC_CSE_DMR_UPD_005_CNT_EXC() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var XSD.PositiveInteger v_expirationCounter := 1; var template RequestPrimitive v_createRequest := m_createContainerBase; var template RequestPrimitive v_updateRequest := m_updateContainerBase; v_updateRequest.primitiveContent := {container_update_invalid := m_contentUpdateContainer_invalid}; v_updateRequest.primitiveContent.container_update_invalid.expirationCounter := v_expirationCounter; v_ae1.start(f_CSE_DMR_UPD_005(int3, v_createRequest, v_updateRequest));//Container v_ae1.done; } testcase TC_CSE_DMR_UPD_005_GRP_EXC() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var XSD.PositiveInteger v_expirationCounter := 1; var template RequestPrimitive v_createRequest := m_createGroupBase; var template RequestPrimitive v_updateRequest := m_updateGroupBase; v_updateRequest.primitiveContent := {group_update_invalid := m_contentUpdateGroup_invalid}; v_updateRequest.primitiveContent.group_update_invalid.expirationCounter := v_expirationCounter; v_ae1.start(f_CSE_DMR_UPD_005(int9, v_createRequest, v_updateRequest));//Group v_ae1.done; } testcase TC_CSE_DMR_UPD_005_ACP_EXC() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var XSD.PositiveInteger v_expirationCounter := 1; var template RequestPrimitive v_createRequest := m_createAcpBase; var template RequestPrimitive v_updateRequest := m_updateAcpBase; v_updateRequest.primitiveContent := {aCP_update_invalid := m_contentUpdateAcp_invalid}; v_updateRequest.primitiveContent.aCP_update_invalid.expirationCounter := v_expirationCounter; v_ae1.start(f_CSE_DMR_UPD_005(int1, v_createRequest, v_updateRequest));//AccessControlPolicy v_ae1.done; } testcase TC_CSE_DMR_UPD_005_SCH_EXC() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var XSD.PositiveInteger v_expirationCounter := 1; var template RequestPrimitive v_createRequest := m_createScheduleBase; var template RequestPrimitive v_updateRequest := m_updateScheduleBase; v_updateRequest.primitiveContent := {schedule_update_invalid := m_contentUpdateSchedule_invalid}; v_updateRequest.primitiveContent.schedule_update_invalid.expirationCounter := v_expirationCounter; v_ae1.start(f_CSE_DMR_UPD_005(int18, v_createRequest, v_updateRequest));//Schedule v_ae1.done; } testcase TC_CSE_DMR_UPD_005_PCH_EXC() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var XSD.PositiveInteger v_expirationCounter := 1; var template RequestPrimitive v_createRequest := m_createPollingChannelBase; var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase; v_updateRequest.primitiveContent := {pollingChannel_update_invalid := m_contentUpdatePollingChannel_invalid}; v_updateRequest.primitiveContent.pollingChannel_update_invalid.expirationCounter := v_expirationCounter; v_ae1.start(f_CSE_DMR_UPD_005(int15, v_createRequest, v_updateRequest));//PollingChannel v_ae1.done; } testcase TC_CSE_DMR_UPD_005_SUB_MNI() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var XSD.NonNegativeInteger v_maxNrOfInstances := 5; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; v_updateRequest.primitiveContent := {subscription_update_invalid := m_contentUpdateSubscription_invalid}; v_updateRequest.primitiveContent.subscription_update_invalid.maxNrOfInstances := v_maxNrOfInstances; v_ae1.start(f_CSE_DMR_UPD_005(int23, v_createRequest, v_updateRequest));//Subscription v_ae1.done; } function f_CSE_DMR_UPD_005(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive) runs on AeSimu { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_ae2Index := -1; var integer v_resourceIndex := -1; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive , v_aeIndex); // Test Body v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Resource " & c_defaultResourceName & " of type " & int2str(enum2int(p_resourceType)) & " not found"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while updating an unexisting resource type " & int2str(enum2int(p_resourceType))); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_DMR_UPD_005 } // end g_CSE_DMR_UPD_005 group g_CSE_DMR_UPD_006{ /** * @desc Check that the IUT responds with an error when the AE tries to update the attribute ATTRIBUTE_NAME of a TARGET_RESOURCE_ADDRESS resource without having privileges for the UPDATE operation * */ testcase TC_CSE_DMR_UPD_006_CNT_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Labels v_labels_1 := {"VALUE_1"}; var template RequestPrimitive v_updateRequest := m_updateContainerBase; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.container.labels := v_labels_1; v_ae1.start(f_CSE_DMR_UPD_006(int3, m_createContainerBase, v_updateRequest));//Container v_ae1.done; if(getverdict == pass){ v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has NOT been udpated if(ischosen(v_primitiveContentRetrieveResource.container)) { if(v_primitiveContentRetrieveResource.container.labels == v_labels_1){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute updated") } } } } testcase TC_CSE_DMR_UPD_006_GRP_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Labels v_labels_1 := {"VALUE_1"}; var template RequestPrimitive v_updateRequest := m_updateGroupBase; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.group_.labels := v_labels_1; v_ae1.start(f_CSE_DMR_UPD_006(int9, m_createGroupBase, v_updateRequest));//Group v_ae1.done; if(getverdict == pass){ v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has NOT been udpated if(ischosen(v_primitiveContentRetrieveResource.group_)) { if(v_primitiveContentRetrieveResource.group_.labels == v_labels_1){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute updated") } } } } testcase TC_CSE_DMR_UPD_006_ACP_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Labels v_labels_1 := {"VALUE_1"}; var template RequestPrimitive v_updateRequest := m_updateAcpBase; var template RequestPrimitive v_requestPrimitive := m_createAcpBase; var PrimitiveContent v_primitiveContentRetrieveResource; v_requestPrimitive.primitiveContent.accessControlPolicy.selfPrivileges.accessControlRule_list[0].accessControlOperations := int59; v_updateRequest.primitiveContent.accessControlPolicy.labels := v_labels_1; v_ae1.start(f_CSE_DMR_UPD_006(int1, v_requestPrimitive, v_updateRequest));//AccessControlPolicy v_ae1.done; if(getverdict == pass){ v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has NOT been udpated if(ischosen(v_primitiveContentRetrieveResource.accessControlPolicy)) { if(v_primitiveContentRetrieveResource.accessControlPolicy.labels == v_labels_1){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute updated") } } } } testcase TC_CSE_DMR_UPD_006_SCH_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Labels v_labels_1 := {"VALUE_1"}; var template RequestPrimitive v_updateRequest := m_updateScheduleBase; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.schedule.labels := v_labels_1; v_ae1.start(f_CSE_DMR_UPD_006(int18, m_createScheduleBase, v_updateRequest));//Schedule v_ae1.done; if(getverdict == pass){ v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has NOT been udpated if(ischosen(v_primitiveContentRetrieveResource.schedule)) { if(v_primitiveContentRetrieveResource.schedule.labels == v_labels_1){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute updated") } } } } testcase TC_CSE_DMR_UPD_006_PCH_LBL() runs on Tester system CseSystem { // Local variable var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Labels v_labels_1 := {"VALUE_1"}; var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.pollingChannel.labels := v_labels_1; v_ae1.start(f_CSE_DMR_UPD_006(int15, m_createPollingChannelBase, v_updateRequest));//PollingChannel v_ae1.done; if(getverdict == pass){ v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has NOT been udpated if(ischosen(v_primitiveContentRetrieveResource.pollingChannel)) { if(v_primitiveContentRetrieveResource.pollingChannel.labels == v_labels_1){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute updated") } } } } testcase TC_CSE_DMR_UPD_006_SUB_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Labels v_labels_1 := {"VALUE_1"}; var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.subscription.labels := v_labels_1; v_ae1.start(f_CSE_DMR_UPD_006(int23, m_createSubscriptionBase, v_updateRequest));//Subscription v_ae1.done; if(getverdict == pass){ v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has NOT been udpated if(ischosen(v_primitiveContentRetrieveResource.subscription)) { if(v_primitiveContentRetrieveResource.subscription.labels == v_labels_1){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute updated") } } } } function f_CSE_DMR_UPD_006(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive) runs on AeSimu { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_acpAuxIndex := -1; var integer v_resourceIndex := -1; var integer v_ae2Index := -1; // Test control if(not(PICS_ACP_SUPPORT)) { setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); stop; } // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_acpAuxIndex := f_cse_preamble_createAcpAux(-, int59);//c_CRDNDi) v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}, -);//c_CRDNDi); f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); // Test Body v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Access denied to update attributes from resource type " & int2str(enum2int(p_resourceType))); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Updating attributes from resource without having privileges"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); } } vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_DMR_UPD_006 } // end g_CSE_DMR_UPD_006 group g_CSE_DMR_UPD_007{ /** * @desc Check that the IUT responds with an error when the AE tries to update a non-RW attribute ATTRIBUTE_NAME of a TARGET_RESOURCE_ADDRESS resource * */ testcase TC_CSE_DMR_UPD_007_CNT_CT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Timestamp v_creationTime := "20001231T012345"; var template RequestPrimitive v_updateRequest := m_updateContainerBase; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent := {container_update_invalid := m_contentUpdateContainer_invalid}; v_updateRequest.primitiveContent.container_update_invalid.creationTime := v_creationTime; v_ae1.start(f_CSE_DMR_UPD_007(int3, m_createContainerBase, v_updateRequest));//Container v_ae1.done; if(getverdict == pass){ v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has NOT been udpated if(ischosen(v_primitiveContentRetrieveResource.container_update_invalid)) { if(v_primitiveContentRetrieveResource.container_update_invalid.creationTime == v_creationTime){ setverdict(fail, __SCOPE__ & ": Error: Creation Time attribute updated") } } } } testcase TC_CSE_DMR_UPD_007_GRP_CT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Timestamp v_creationTime := "20001231T012345"; var template RequestPrimitive v_updateRequest := m_updateGroupBase; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent := {group_update_invalid := m_contentUpdateGroup_invalid}; v_updateRequest.primitiveContent.group_update_invalid.creationTime := v_creationTime; v_ae1.start(f_CSE_DMR_UPD_007(int9, m_createGroupBase, v_updateRequest));//Group v_ae1.done; if(getverdict == pass){ v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has NOT been udpated if(ischosen(v_primitiveContentRetrieveResource.group_update_invalid)) { if(v_primitiveContentRetrieveResource.group_update_invalid.creationTime == v_creationTime){ setverdict(fail, __SCOPE__ & ": Error: Creation Time attribute updated") } } } } testcase TC_CSE_DMR_UPD_007_ACP_CT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Timestamp v_creationTime := "20001231T012345"; var template RequestPrimitive v_updateRequest := m_updateAcpBase; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent := {aCP_update_invalid := m_contentUpdateAcp_invalid}; v_updateRequest.primitiveContent.aCP_update_invalid.creationTime := v_creationTime; v_ae1.start(f_CSE_DMR_UPD_007(int1, m_createAcpBase, v_updateRequest));//AccessControlPolicy v_ae1.done; if(getverdict == pass){ v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has NOT been udpated if(ischosen(v_primitiveContentRetrieveResource.aCP_update_invalid)) { if(v_primitiveContentRetrieveResource.aCP_update_invalid.creationTime == v_creationTime){ setverdict(fail, __SCOPE__ & ": Error: Creation Time attribute updated") } } } } testcase TC_CSE_DMR_UPD_007_SCH_CT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Timestamp v_creationTime := "20001231T012345"; var template RequestPrimitive v_updateRequest := m_updateScheduleBase; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent := {schedule_update_invalid := m_contentUpdateSchedule_invalid}; v_updateRequest.primitiveContent.schedule_update_invalid.creationTime := v_creationTime; v_ae1.start(f_CSE_DMR_UPD_007(int18, m_createScheduleBase, v_updateRequest));//Schedule v_ae1.done; if(getverdict == pass){ v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has NOT been udpated if(ischosen(v_primitiveContentRetrieveResource.schedule_update_invalid)) { if(v_primitiveContentRetrieveResource.schedule_update_invalid.creationTime == v_creationTime){ setverdict(fail, __SCOPE__ & ": Error: Creation Time attribute updated") } } } } testcase TC_CSE_DMR_UPD_007_PCH_CT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Timestamp v_creationTime := "20001231T012345"; var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent := {pollingChannel_update_invalid := m_contentUpdatePollingChannel_invalid}; v_updateRequest.primitiveContent.pollingChannel_update_invalid.creationTime := v_creationTime; v_ae1.start(f_CSE_DMR_UPD_007(int15, m_createPollingChannelBase, v_updateRequest));//PollingChannel v_ae1.done; if(getverdict == pass){ v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has NOT been udpated if(ischosen(v_primitiveContentRetrieveResource.pollingChannel_update_invalid)) { if(v_primitiveContentRetrieveResource.pollingChannel_update_invalid.creationTime == v_creationTime){ setverdict(fail, __SCOPE__ & ": Error: Creation Time attribute updated") } } } } testcase TC_CSE_DMR_UPD_007_SUB_CT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Timestamp v_creationTime := "20001231T012345"; var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent := {subscription_update_invalid := m_contentUpdateSubscription_invalid}; v_updateRequest.primitiveContent.subscription_update_invalid.creationTime := v_creationTime; v_ae1.start(f_CSE_DMR_UPD_007(int23, m_createSubscriptionBase, v_updateRequest));//Subscription v_ae1.done; if(getverdict == pass){ v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has NOT been udpated if(ischosen(v_primitiveContentRetrieveResource.subscription_update_invalid)) { if(v_primitiveContentRetrieveResource.subscription_update_invalid.creationTime == v_creationTime){ setverdict(fail, __SCOPE__ & ": Error: Creation Time attribute updated") } } } } function f_CSE_DMR_UPD_007(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive) runs on AeSimu { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var integer v_ae2Index := -1; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); // Test Body v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Operation not allowed. RO attribute from resource type " & int2str(enum2int(p_resourceType)) ); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Updating RO attribute from resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); } } vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_DMR_UPD_007 } // end g_CSE_DMR_UPD_007 group g_CSE_DMR_UPD_008{ /** * @desc Check that the IUT responds with an error when the AE tries to delete a mandatory RW attribute ATTRIBUTE_NAME of a TARGET_RESOURCE_ADDRESS resource * */ testcase TC_CSE_DMR_UPD_008_CNT_ET() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Timestamp v_expirationTime := "20001231T012345"; var template RequestPrimitive v_updateRequest := m_updateContainerBase; var AttributeAux_list v_nullFields; var PrimitiveContent v_primitiveContentRetrieveResource; v_nullFields := {{"expirationTime", omit}}; v_updateRequest.primitiveContent.container.expirationTime := v_expirationTime; v_ae1.start(f_CSE_DMR_UPD_008(int3, m_createContainerBase, v_updateRequest, v_nullFields));//Container v_ae1.done; if(getverdict == pass){ v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has NOT been udpated if(ischosen(v_primitiveContentRetrieveResource.container)) { if(v_primitiveContentRetrieveResource.container.expirationTime == v_expirationTime){ setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute updated") } } } } testcase TC_CSE_DMR_UPD_008_GRP_ET() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Timestamp v_expirationTime := "20001231T012345"; var template RequestPrimitive v_updateRequest := m_updateGroupBase; var AttributeAux_list v_nullFields; var PrimitiveContent v_primitiveContentRetrieveResource; v_nullFields := {{"expirationTime", omit}}; v_updateRequest.primitiveContent.group_.expirationTime := v_expirationTime; v_ae1.start(f_CSE_DMR_UPD_008(int9, m_createGroupBase, v_updateRequest, v_nullFields));//Group v_ae1.done; if(getverdict == pass){ v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has NOT been udpated if(ischosen(v_primitiveContentRetrieveResource.group_)) { if(v_primitiveContentRetrieveResource.group_.expirationTime == v_expirationTime){ setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute updated") } } } } testcase TC_CSE_DMR_UPD_008_ACP_ET() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Timestamp v_expirationTime := "20001231T012345"; var template RequestPrimitive v_updateRequest := m_updateAcpBase; var AttributeAux_list v_nullFields; var PrimitiveContent v_primitiveContentRetrieveResource; v_nullFields := {{"expirationTime", omit}}; v_updateRequest.primitiveContent.accessControlPolicy.expirationTime := v_expirationTime; v_ae1.start(f_CSE_DMR_UPD_008(int1, m_createAcpBase, v_updateRequest, v_nullFields));//AccessControlPolicy v_ae1.done; if(getverdict == pass){ v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has NOT been udpated if(ischosen(v_primitiveContentRetrieveResource.accessControlPolicy)) { if(v_primitiveContentRetrieveResource.accessControlPolicy.expirationTime == v_expirationTime){ setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute updated") } } } } testcase TC_CSE_DMR_UPD_008_SCH_ET() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Timestamp v_expirationTime := "20001231T012345"; var template RequestPrimitive v_updateRequest := m_updateScheduleBase; var AttributeAux_list v_nullFields; var PrimitiveContent v_primitiveContentRetrieveResource; v_nullFields := {{"expirationTime", omit}}; v_updateRequest.primitiveContent.schedule.expirationTime := v_expirationTime; v_ae1.start(f_CSE_DMR_UPD_008(int18, m_createScheduleBase, v_updateRequest, v_nullFields));//Schedule v_ae1.done; if(getverdict == pass){ v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has NOT been udpated if(ischosen(v_primitiveContentRetrieveResource.schedule)) { if(v_primitiveContentRetrieveResource.schedule.expirationTime == v_expirationTime){ setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute updated") } } } } testcase TC_CSE_DMR_UPD_008_PCH_ET() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Timestamp v_expirationTime := "20001231T012345"; var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase; var AttributeAux_list v_nullFields; var PrimitiveContent v_primitiveContentRetrieveResource; v_nullFields := {{"expirationTime", omit}}; v_updateRequest.primitiveContent.pollingChannel.expirationTime := v_expirationTime; v_ae1.start(f_CSE_DMR_UPD_008(int15, m_createPollingChannelBase, v_updateRequest, v_nullFields));//PollingChannel v_ae1.done; if(getverdict == pass){ v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has NOT been udpated if(ischosen(v_primitiveContentRetrieveResource.pollingChannel)) { if(v_primitiveContentRetrieveResource.pollingChannel.expirationTime == v_expirationTime){ setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute updated") } } } } testcase TC_CSE_DMR_UPD_008_SUB_ET() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Timestamp v_expirationTime := "20001231T012345"; var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; var AttributeAux_list v_nullFields; var PrimitiveContent v_primitiveContentRetrieveResource; v_nullFields := {{"expirationTime", omit}}; v_updateRequest.primitiveContent.subscription.expirationTime := v_expirationTime; v_ae1.start(f_CSE_DMR_UPD_008(int23, m_createSubscriptionBase, v_updateRequest, v_nullFields));//Subscription v_ae1.done; if(getverdict == pass){ v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has NOT been udpated if(ischosen(v_primitiveContentRetrieveResource.subscription)) { if(v_primitiveContentRetrieveResource.subscription.expirationTime == v_expirationTime){ setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute updated") } } } } function f_CSE_DMR_UPD_008(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, template (omit) AttributeAux_list p_nullFields := omit) runs on AeSimu { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var integer v_ae2Index := -1; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); // Test Body v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); mcaPort.send(m_request(v_request,p_nullFields)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Operation not allowed. Mandatory RW attribute from resource type " & int2str(enum2int(p_resourceType)) ); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Deleting a mandatory RW attribute from resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); } } vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_DMR_UPD_008 } // end g_CSE_DMR_UPD_008 group g_CSE_DMR_UPD_010{ /** * @desc Check that the stateTag attribute of a container resource is increased when an update operation has been performed on its child resource * */ testcase TC_CSE_DMR_UPD_010() runs on AeSimu system CseSystem { var MsgIn v_response; var integer v_aeIndex := -1; var integer v_containerIndex := -1; var RequestPrimitive v_updateRequest := valueof(m_updateContainerBase); var Labels v_labels_1:= {"VALUE_1"}; v_updateRequest.primitiveContent.container.labels := v_labels_1; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); // Test Body if(ispresent(vc_resourcesList[v_containerIndex].resource.container.stateTag)) { v_updateRequest := f_getUpdateRequestPrimitive(int3, v_containerIndex, v_updateRequest); f_cse_updateResource(v_updateRequest); mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_containerIndex), f_getOriginator(v_containerIndex)))); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; if(v_response.primitive.responsePrimitive.primitiveContent.container.stateTag == 1) { //(Create and Delete) setverdict(pass, __SCOPE__ & ": The stateTag attribute is incremented"); } else{ setverdict(fail, __SCOPE__ & ": Error the stateTag attribute is not incremented"); } } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource attributes"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes"); } } }//end if else{ setverdict(fail, __SCOPE__ & ": Error the stateTag attribute is empty"); } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end TC_CSE_DMR_UPD_010 } // end group g_CSE_DMR_UPD_010 group g_CSE_DMR_UPD_011{ /** * @desc Check that the IUT rejects the UPDATE Request of an existing contentInstance resource with error “OPERATION_NOT_ALLOWED” * */ testcase TC_CSE_DMR_UPD_011() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_containerIndex := -1; var integer v_contentInstanceIndex := -1; var template RequestPrimitive v_updateRequest := m_updateContentInstanceBase; var Labels v_labels:= {"LABEL"}; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.contentInstance.labels := v_labels; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); v_contentInstanceIndex := f_cse_createResource(int4, m_createContentInstanceBase, v_containerIndex); //Test Body v_request := f_getUpdateRequestPrimitive(int4, v_contentInstanceIndex, v_updateRequest); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Not allowed to update a contentInstance with error OPERATION_NOT_ALLOWED"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Accepted update of contentInstance"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while updating contentInstance"); } } v_primitiveContentRetrieveResource:=f_cse_retrieveResource(v_contentInstanceIndex); if(getverdict == pass){ //Check that the resource has NOT been udpated if(ischosen(v_primitiveContentRetrieveResource.contentInstance)) { if(v_primitiveContentRetrieveResource.contentInstance.labels == v_labels){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute updated") } } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end TC_CSE_DMR_UPD_011 } // end group g_CSE_DMR_UPD_011 group g_CSE_DMR_UPD_012{ /** * @desc Check that the IUT rejects the UPDATE Request of a latest resource as a direct child of a <container> resource with error “OPERATION_NOT_ALLOWED” * */ testcase TC_CSE_DMR_UPD_012() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_containerIndex := -1; var integer v_contentInstanceIndex := -1; var template RequestPrimitive v_updateRequest := m_updateContentInstanceBase; var Labels v_labels := {"LABEL"}; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.contentInstance.labels := v_labels; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); v_contentInstanceIndex := f_cse_createResource(int4, m_createContentInstanceBase, v_containerIndex); //Test Body v_request := f_getUpdateRequestPrimitive(int4, v_containerIndex, v_updateRequest); v_request.to_ := v_request.to_ & "/" & c_resourceShortNameLatest; //<latest> mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Not allowed to update a latest resource with error OPERATION_NOT_ALLOWED"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Accepted update of a latest resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while updating a latest resource"); } } v_primitiveContentRetrieveResource:=f_cse_retrieveResource(v_contentInstanceIndex); if(getverdict == pass){ //Check that the resource has NOT been udpated if(ischosen(v_primitiveContentRetrieveResource.contentInstance)) { if(v_primitiveContentRetrieveResource.contentInstance.labels == v_labels){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute updated") } } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end TC_CSE_DMR_UPD_012 } // end group g_CSE_DMR_UPD_012 group g_CSE_DMR_UPD_013{ /** * @desc Check that the IUT rejects the UPDATE Request of an oldest resource as a direct child of a <container> resource with error “OPERATION_NOT_ALLOWED” * */ testcase TC_CSE_DMR_UPD_013() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_containerIndex := -1; var integer v_contentInstanceIndex := -1; var template RequestPrimitive v_updateRequest := m_updateContentInstanceBase; var Labels v_labels:= {"LABEL"}; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.contentInstance.labels := v_labels; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); v_contentInstanceIndex := f_cse_createResource(int4, m_createContentInstanceBase, v_containerIndex); //Test Body v_request := f_getUpdateRequestPrimitive(int4, v_containerIndex, v_updateRequest); v_request.to_ := v_request.to_ & "/" & c_resourceShortNameOldest; //<oldest> mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Not allowed to update an oldest resource with error OPERATION_NOT_ALLOWED"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Accepted update of an oldest resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while updating an oldest resource"); } } v_primitiveContentRetrieveResource:=f_cse_retrieveResource(v_contentInstanceIndex); if(getverdict == pass){ //Check that the resource has NOT been udpated if(ischosen(v_primitiveContentRetrieveResource.contentInstance)) { if(v_primitiveContentRetrieveResource.contentInstance.labels == v_labels){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute updated") } } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end TC_CSE_DMR_UPD_013 } // end group g_CSE_DMR_UPD_013 group g_CSE_DMR_UPD_014 { /** * @desc Check that the IUT updates successfully the value of the optional attribute OPTIONAL_ATTRIBUTE of the RESOURCE_TYPE resource. * */ testcase TC_CSE_DMR_UPD_014_ACP_ET() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Timestamp v_expirationTime_1 := "20301231T012345"; var Timestamp v_expirationTime_2 := "20401020T012345"; var template RequestPrimitive v_createRequest := m_createAcpBase; var template RequestPrimitive v_updateRequest := m_updateAcpBase; var ResponsePrimitive v_responsePrimitive; v_createRequest.primitiveContent.accessControlPolicy.expirationTime := v_expirationTime_1; v_updateRequest.primitiveContent.accessControlPolicy.expirationTime := v_expirationTime_2; v_ae1.start(f_CSE_DMR_UPD_014(int1, v_createRequest, v_updateRequest));//ACP v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.accessControlPolicy)) { if(v_responsePrimitive.primitiveContent.accessControlPolicy.expirationTime != v_expirationTime_2){ setverdict(fail, __SCOPE__ & ": Error: ExpirationTime attribute not updated correctly") } } } } } testcase TC_CSE_DMR_UPD_014_ACP_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Labels v_labels_1 := {"VALUE_1"}; var Labels v_labels_2 := {"VALUE_2"}; var template RequestPrimitive v_createRequest := m_createAcpBase; var template RequestPrimitive v_updateRequest := m_updateAcpBase; var ResponsePrimitive v_responsePrimitive; v_createRequest.primitiveContent.accessControlPolicy.labels := v_labels_1; v_updateRequest.primitiveContent.accessControlPolicy.labels := v_labels_2; v_ae1.start(f_CSE_DMR_UPD_014(int1, v_createRequest, v_updateRequest));//ACP v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.accessControlPolicy)) { if(v_responsePrimitive.primitiveContent.accessControlPolicy.labels != v_labels_2){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") } } } } } testcase TC_CSE_DMR_UPD_014_ACP_PV() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var SetOfAcrs v_privileges_1; var SetOfAcrs v_privileges_2; var template RequestPrimitive v_createRequest := m_createAcpBase; var template RequestPrimitive v_updateRequest := m_updateAcpBase; var ResponsePrimitive v_responsePrimitive; v_privileges_1.accessControlRule_list[0].accessControlOperations := int31; v_privileges_2.accessControlRule_list[0].accessControlOperations := int63; v_createRequest.primitiveContent.accessControlPolicy.privileges := v_privileges_1; v_updateRequest.primitiveContent.accessControlPolicy.privileges := v_privileges_2; v_ae1.start(f_CSE_DMR_UPD_014(int1, v_createRequest, v_updateRequest));//ACP v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.accessControlPolicy)) { if(v_responsePrimitive.primitiveContent.accessControlPolicy.privileges != v_privileges_2){ setverdict(fail, __SCOPE__ & ": Error: Privileges attribute not updated correctly") } } } } } testcase TC_CSE_DMR_UPD_014_ACP_PVS() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var SetOfAcrs v_selfPrivileges_1; var SetOfAcrs v_selfPrivileges_2; var template RequestPrimitive v_createRequest := m_createAcpBase; var template RequestPrimitive v_updateRequest := m_updateAcpBase; var ResponsePrimitive v_responsePrimitive; v_selfPrivileges_1.accessControlRule_list[0].accessControlOperations := int31; v_selfPrivileges_2.accessControlRule_list[0].accessControlOperations := int63; v_createRequest.primitiveContent.accessControlPolicy.selfPrivileges := v_selfPrivileges_1; v_updateRequest.primitiveContent.accessControlPolicy.selfPrivileges := v_selfPrivileges_2; v_ae1.start(f_CSE_DMR_UPD_014(int1, v_createRequest, v_updateRequest));//ACP v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.accessControlPolicy)) { if(v_responsePrimitive.primitiveContent.accessControlPolicy.selfPrivileges != v_selfPrivileges_2){ setverdict(fail, __SCOPE__ & ": Error: SelfPrivileges attribute not updated correctly") } } } } } testcase TC_CSE_DMR_UPD_014_CNT_ACPI() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var AcpType v_accessControlPolicyIDs_1 := {"NotInitialized_1"}; var AcpType v_accessControlPolicyIDs_2 := {"NotInitialized_2"}; var ResponsePrimitive v_responsePrimitive; var template RequestPrimitive v_createRequest := m_createContainerBase; var template RequestPrimitive v_updateRequest := m_updateContainerBase; v_createRequest.primitiveContent.container.accessControlPolicyIDs := v_accessControlPolicyIDs_1; v_updateRequest.primitiveContent.container.accessControlPolicyIDs := v_accessControlPolicyIDs_2; v_ae1.start(f_CSE_DMR_UPD_014(int3, v_createRequest, v_updateRequest));//Container v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.container)) { if(v_responsePrimitive.primitiveContent.container.accessControlPolicyIDs != v_accessControlPolicyIDs_2){ setverdict(fail, __SCOPE__ & ": Error: AccessControlPolicyIDs attribute not updated correctly") } } } } } testcase TC_CSE_DMR_UPD_014_CNT_ET() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Timestamp v_expirationTime_1 := "20301231T012345"; var Timestamp v_expirationTime_2 := "20401020T012345"; var ResponsePrimitive v_responsePrimitive; var template RequestPrimitive v_createRequest := m_createContainerBase; var template RequestPrimitive v_updateRequest := m_updateContainerBase; v_createRequest.primitiveContent.container.expirationTime := v_expirationTime_1; v_updateRequest.primitiveContent.container.expirationTime := v_expirationTime_2; v_ae1.start(f_CSE_DMR_UPD_014(int3, v_createRequest, v_updateRequest));//Container v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.container)) { if(v_responsePrimitive.primitiveContent.container.expirationTime != v_expirationTime_2){ setverdict(fail, __SCOPE__ & ": Error: ExpirationTime attribute not updated correctly") } } } } } testcase TC_CSE_DMR_UPD_014_CNT_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Labels v_labels_1 := {"VALUE_1"}; var Labels v_labels_2 := {"VALUE_2"}; var ResponsePrimitive v_responsePrimitive; var template RequestPrimitive v_createRequest := m_createContainerBase; var template RequestPrimitive v_updateRequest := m_updateContainerBase; v_createRequest.primitiveContent.container.labels := v_labels_1; v_updateRequest.primitiveContent.container.labels := v_labels_2; v_ae1.start(f_CSE_DMR_UPD_014(int3, v_createRequest, v_updateRequest));//Container v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.container)) { if(v_responsePrimitive.primitiveContent.container.labels != v_labels_2){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") } } } } } testcase TC_CSE_DMR_UPD_014_CNT_MBS() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var XSD.NonNegativeInteger v_maxByteSize_1 := 256; var XSD.NonNegativeInteger v_maxByteSize_2 := 512; var ResponsePrimitive v_responsePrimitive; var template RequestPrimitive v_createRequest := m_createContainerBase; var template RequestPrimitive v_updateRequest := m_updateContainerBase; v_createRequest.primitiveContent.container.maxByteSize := v_maxByteSize_1; v_updateRequest.primitiveContent.container.maxByteSize := v_maxByteSize_2; v_ae1.start(f_CSE_DMR_UPD_014(int3, v_createRequest, v_updateRequest));//Container v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.container)) { if(v_responsePrimitive.primitiveContent.container.maxByteSize != v_maxByteSize_2){ setverdict(fail, __SCOPE__ & ": Error: MaxByteSize attribute not updated correctly") } } } } } testcase TC_CSE_DMR_UPD_014_CNT_MIA() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var XSD.NonNegativeInteger v_maxInstanceAge_1 := 60; var XSD.NonNegativeInteger v_maxInstanceAge_2 := 120; var ResponsePrimitive v_responsePrimitive; var template RequestPrimitive v_createRequest := m_createContainerBase; var template RequestPrimitive v_updateRequest := m_updateContainerBase; v_createRequest.primitiveContent.container.maxInstanceAge := v_maxInstanceAge_1; v_updateRequest.primitiveContent.container.maxInstanceAge := v_maxInstanceAge_2; v_ae1.start(f_CSE_DMR_UPD_014(int3, v_createRequest, v_updateRequest));//Container v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.container)) { if(v_responsePrimitive.primitiveContent.container.maxInstanceAge != v_maxInstanceAge_2){ setverdict(fail, __SCOPE__ & ": Error: MaxInstanceAge attribute not updated correctly") } } } } } testcase TC_CSE_DMR_UPD_014_CNT_MNI() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var XSD.NonNegativeInteger v_maxNrOfInstances_1 := 1; var XSD.NonNegativeInteger v_maxNrOfInstances_2 := 2; var ResponsePrimitive v_responsePrimitive; var template RequestPrimitive v_createRequest := m_createContainerBase; var template RequestPrimitive v_updateRequest := m_updateContainerBase; v_createRequest.primitiveContent.container.maxNrOfInstances := v_maxNrOfInstances_1; v_updateRequest.primitiveContent.container.maxNrOfInstances := v_maxNrOfInstances_2; v_ae1.start(f_CSE_DMR_UPD_014(int3, v_createRequest, v_updateRequest));//Container v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.container)) { if(v_responsePrimitive.primitiveContent.container.maxNrOfInstances != v_maxNrOfInstances_2){ setverdict(fail, __SCOPE__ & ": Error: MaxNrOfInstances attribute not updated correctly") } } } } } testcase TC_CSE_DMR_UPD_014_CNT_OR() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var XSD.AnyURI v_ontologyRef_1 := "MyOntologyRef_1"; var XSD.AnyURI v_ontologyRef_2 := "MyOntologyRef_2"; var ResponsePrimitive v_responsePrimitive; var template RequestPrimitive v_createRequest := m_createContainerBase; var template RequestPrimitive v_updateRequest := m_updateContainerBase; v_createRequest.primitiveContent.container.ontologyRef := v_ontologyRef_1; v_updateRequest.primitiveContent.container.ontologyRef := v_ontologyRef_2; v_ae1.start(f_CSE_DMR_UPD_014(int3, v_createRequest, v_updateRequest));//Container v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.container)) { if(v_responsePrimitive.primitiveContent.container.ontologyRef != v_ontologyRef_2){ setverdict(fail, __SCOPE__ & ": Error: OntologyRef attribute not updated correctly") } } } } } testcase TC_CSE_DMR_UPD_014_SUB_ACPI() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var AcpType v_accessControlPolicyIDs_1 := {"NotInitialized_1"}; var AcpType v_accessControlPolicyIDs_2 := {"NotInitialized_2"}; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; var ResponsePrimitive v_responsePrimitive; v_createRequest.primitiveContent.subscription.accessControlPolicyIDs := v_accessControlPolicyIDs_1; v_updateRequest.primitiveContent.subscription.accessControlPolicyIDs := v_accessControlPolicyIDs_2; v_ae1.start(f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { if(v_responsePrimitive.primitiveContent.subscription.accessControlPolicyIDs != v_accessControlPolicyIDs_2){ setverdict(fail, __SCOPE__ & ": Error: AccessControlPolicyIDs attribute not updated correctly") } } } } } testcase TC_CSE_DMR_UPD_014_SUB_BN() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var BatchNotify v_batchNotify_1 := {1, "PT1S"}; var BatchNotify v_batchNotify_2 := {2, "PT1S"}; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; var ResponsePrimitive v_responsePrimitive; v_createRequest.primitiveContent.subscription.batchNotify := v_batchNotify_1; v_updateRequest.primitiveContent.subscription.batchNotify := v_batchNotify_2; v_ae1.start(f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { if(v_responsePrimitive.primitiveContent.subscription.batchNotify != v_batchNotify_2){ setverdict(fail, __SCOPE__ & ": Error: EventNotificationCriteria attribute not updated correctly") } } } } } testcase TC_CSE_DMR_UPD_014_SUB_ENC() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var EventNotificationCriteria v_eventNotificationCriteria_1 := valueof(m_eventNotificationCriteria({int1}, -)); var EventNotificationCriteria v_eventNotificationCriteria_2 := valueof(m_eventNotificationCriteria({int2}, -)); var template RequestPrimitive v_createRequest := m_createSubscriptionBase; var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; var ResponsePrimitive v_responsePrimitive; v_createRequest.primitiveContent.subscription.eventNotificationCriteria := v_eventNotificationCriteria_1; v_updateRequest.primitiveContent.subscription.eventNotificationCriteria := v_eventNotificationCriteria_2; v_ae1.start(f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { if(v_responsePrimitive.primitiveContent.subscription.eventNotificationCriteria != v_eventNotificationCriteria_2){ setverdict(fail, __SCOPE__ & ": Error: EventNotificationCriteria attribute not updated correctly") } } } } } testcase TC_CSE_DMR_UPD_014_SUB_ET() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Timestamp v_expirationTime_1 := "20301231T012345"; var Timestamp v_expirationTime_2 := "20401020T012345"; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; var ResponsePrimitive v_responsePrimitive; v_createRequest.primitiveContent.subscription.expirationTime := v_expirationTime_1; v_updateRequest.primitiveContent.subscription.expirationTime := v_expirationTime_2; v_ae1.start(f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { if(v_responsePrimitive.primitiveContent.subscription.expirationTime != v_expirationTime_2){ setverdict(fail, __SCOPE__ & ": Error: ExpirationTime attribute not updated correctly") } } } } } testcase TC_CSE_DMR_UPD_014_SUB_EXC() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var XSD.PositiveInteger v_expirationCounter_1 := 10; var XSD.PositiveInteger v_expirationCounter_2 := 20; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; var ResponsePrimitive v_responsePrimitive; v_createRequest.primitiveContent.subscription.expirationCounter := v_expirationCounter_1; v_updateRequest.primitiveContent.subscription.expirationCounter := v_expirationCounter_2; v_ae1.start(f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { if(v_responsePrimitive.primitiveContent.subscription.expirationCounter != v_expirationCounter_2){ setverdict(fail, __SCOPE__ & ": Error: ExpirationCounter attribute not updated correctly") } } } } } testcase TC_CSE_DMR_UPD_014_SUB_GPI() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var XSD.AnyURI v_groupID_1 := "MyGroupID_1"; var XSD.AnyURI v_groupID_2 := "MyGroupID_2"; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; var ResponsePrimitive v_responsePrimitive; v_createRequest.primitiveContent.subscription.groupID := v_groupID_1; v_updateRequest.primitiveContent.subscription.groupID := v_groupID_2; v_ae1.start(f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { if(v_responsePrimitive.primitiveContent.subscription.groupID != v_groupID_2){ setverdict(fail, __SCOPE__ & ": Error: GroupID attribute not updated correctly") } } } } } testcase TC_CSE_DMR_UPD_014_SUB_LBL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Labels v_labels_1 := {"VALUE_1"}; var Labels v_labels_2 := {"VALUE_2"}; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; var ResponsePrimitive v_responsePrimitive; v_createRequest.primitiveContent.subscription.labels := v_labels_1; v_updateRequest.primitiveContent.subscription.labels := v_labels_2; v_ae1.start(f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { if(v_responsePrimitive.primitiveContent.subscription.labels != v_labels_2){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") } } } } } testcase TC_CSE_DMR_UPD_014_SUB_LN() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var XSD.Boolean v_latestNotify_1 := true; var XSD.Boolean v_latestNotify_2 := false; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; var ResponsePrimitive v_responsePrimitive; v_createRequest.primitiveContent.subscription.latestNotify := v_latestNotify_1; v_updateRequest.primitiveContent.subscription.latestNotify := v_latestNotify_2; v_ae1.start(f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { if(v_responsePrimitive.primitiveContent.subscription.latestNotify != v_latestNotify_2){ setverdict(fail, __SCOPE__ & ": Error: LatestNotify attribute not updated correctly") } } } } } testcase TC_CSE_DMR_UPD_014_SUB_NCT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var NotificationContentType v_notificationContentType_1 := int1; var NotificationContentType v_notificationContentType_2 := int2; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; var ResponsePrimitive v_responsePrimitive; v_createRequest.primitiveContent.subscription.notificationContentType := v_notificationContentType_1; v_updateRequest.primitiveContent.subscription.notificationContentType := v_notificationContentType_2; v_ae1.start(f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { if(v_responsePrimitive.primitiveContent.subscription.notificationContentType != v_notificationContentType_2){ setverdict(fail, __SCOPE__ & ": Error: NotificationContentType attribute not updated correctly") } } } } } testcase TC_CSE_DMR_UPD_014_SUB_NEC() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var EventCat v_notificationEventCat_1 := {alt_1 := 100}; var EventCat v_notificationEventCat_2 := {alt_1 := 101}; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; var ResponsePrimitive v_responsePrimitive; v_createRequest.primitiveContent.subscription.notificationEventCat := v_notificationEventCat_1; v_updateRequest.primitiveContent.subscription.notificationEventCat := v_notificationEventCat_2; v_ae1.start(f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { if(v_responsePrimitive.primitiveContent.subscription.notificationEventCat != v_notificationEventCat_2){ setverdict(fail, __SCOPE__ & ": Error: NotificationEventCat attribute not updated correctly") } } } } } testcase TC_CSE_DMR_UPD_014_SUB_NFU() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var XSD.AnyURI v_notificationForwardingURI_1 := "MyForwardingURI_1"; var XSD.AnyURI v_notificationForwardingURI_2 := "MyForwardingURI_2"; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; var ResponsePrimitive v_responsePrimitive; v_createRequest.primitiveContent.subscription.notificationForwardingURI := v_notificationForwardingURI_1; v_updateRequest.primitiveContent.subscription.notificationForwardingURI := v_notificationForwardingURI_2; v_ae1.start(f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { if(v_responsePrimitive.primitiveContent.subscription.notificationForwardingURI != v_notificationForwardingURI_2){ setverdict(fail, __SCOPE__ & ": Error: NotificationForwardingURI attribute not updated correctly") } } } } } testcase TC_CSE_DMR_UPD_014_SUB_NSP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var XSD.PositiveInteger v_notificationStoragePriority_1 := 1; var XSD.PositiveInteger v_notificationStoragePriority_2 := 2; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; var ResponsePrimitive v_responsePrimitive; v_createRequest.primitiveContent.subscription.notificationStoragePriority := v_notificationStoragePriority_1; v_updateRequest.primitiveContent.subscription.notificationStoragePriority := v_notificationStoragePriority_2; v_ae1.start(f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { if(v_responsePrimitive.primitiveContent.subscription.notificationStoragePriority != v_notificationStoragePriority_2){ setverdict(fail, __SCOPE__ & ": Error: NotificationStoragePriority attribute not updated correctly") } } } } } testcase TC_CSE_DMR_UPD_014_SUB_PN() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var PendingNotification v_pendingNotification_1 := int1; var PendingNotification v_pendingNotification_2 := int2; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; var ResponsePrimitive v_responsePrimitive; v_createRequest.primitiveContent.subscription.pendingNotification := v_pendingNotification_1; v_updateRequest.primitiveContent.subscription.pendingNotification := v_pendingNotification_2; v_ae1.start(f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { if(v_responsePrimitive.primitiveContent.subscription.pendingNotification != v_pendingNotification_2){ setverdict(fail, __SCOPE__ & ": Error: PendingNotification attribute not updated correctly") } } } } } testcase TC_CSE_DMR_UPD_014_SUB_RL() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; var RateLimit v_rateLimit_1 := {0, omit}; var RateLimit v_rateLimit_2 := {1, omit}; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; var ResponsePrimitive v_responsePrimitive; v_createRequest.primitiveContent.subscription.rateLimit := v_rateLimit_1; v_updateRequest.primitiveContent.subscription.rateLimit := v_rateLimit_2; v_ae1.start(f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { if(v_responsePrimitive.primitiveContent.subscription.rateLimit != v_rateLimit_2){ setverdict(fail, __SCOPE__ & ": Error: RateLimit attribute not updated correctly") } } } } } function f_CSE_DMR_UPD_014(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive) runs on AeSimu { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var integer v_ae2Index := -1; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); // Test Body v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value vc_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated successfully"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while updating resource type " & int2str(enum2int(p_resourceType))); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_DMR_UPD_014 } // end g_CSE_DMR_UPD_014 group g_CSE_DMR_UPD_015{ /** * @desc Check that the IUT updates successfully the value of the optional attribute OPTIONAL_ATTRIBUTE of the RESOURCE_TYPE resource under CSEBase */ testcase TC_CSE_DMR_UPD_015_CSR_LBL() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Labels v_labels := {"MyLabel"}; var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.remoteCSE.labels := v_labels; v_ae1.start(f_CSE_DMR_UPD_015(int16, m_createRemoteCSEBase, v_updateRequest));//Remote CSE v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.remoteCSE)) { if(v_responsePrimitive.primitiveContent.remoteCSE.labels != v_labels){ setverdict(fail, __SCOPE__, ": Error: Labels attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.remoteCSE)) { if(v_primitiveContentRetrieveResource.remoteCSE.labels != v_labels){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_015_CSR_POA() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var PoaList v_poaList := {"http://" & PX_AE2_ADDRESS & "/"}; var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.remoteCSE.pointOfAccess := v_poaList; v_ae1.start(f_CSE_DMR_UPD_015(int16, m_createRemoteCSEBase, v_updateRequest));//Remote CSE v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.remoteCSE)) { if(v_responsePrimitive.primitiveContent.remoteCSE.pointOfAccess != v_poaList){ setverdict(fail, __SCOPE__, ": Error: Point of access attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.remoteCSE)) { if(v_primitiveContentRetrieveResource.remoteCSE.pointOfAccess != v_poaList){ setverdict(fail, __SCOPE__ & ": Error: Point of access attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_015_CSR_NL() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var XSD.AnyURI v_nodeLink := "MyNodeId"; var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.remoteCSE.nodeLink := v_nodeLink; v_ae1.start(f_CSE_DMR_UPD_015(int16, m_createRemoteCSEBase, v_updateRequest));//Remote CSE v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.remoteCSE)) { if(v_responsePrimitive.primitiveContent.remoteCSE.nodeLink != v_nodeLink){ setverdict(fail, __SCOPE__, ": Error: Node link attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.remoteCSE)) { if(v_primitiveContentRetrieveResource.remoteCSE.nodeLink != v_nodeLink){ setverdict(fail, __SCOPE__ & ": Error: Node link attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_015_NOD_LBL() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Labels v_labels := {"MyLabel"}; var template RequestPrimitive v_updateRequest := m_updateNodeBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.node.labels := v_labels; v_ae1.start(f_CSE_DMR_UPD_015(int9, m_createNodeBase, v_updateRequest));//Node v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.node)) { if(v_responsePrimitive.primitiveContent.node.labels != v_labels){ setverdict(fail, __SCOPE__, ": Error: Labels attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.node)) { if(v_primitiveContentRetrieveResource.node.labels != v_labels){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_015_NOD_ACPI() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_updateRequest := m_updateNodeBase; var RequestPrimitive v_updateRequestPrimitive; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_ae1.start(f_CSE_DMR_UPD_015(int9, m_createNodeBase, v_updateRequest, true));//Node v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); v_updateRequestPrimitive := f_getRequestPrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.node)) { if(v_responsePrimitive.primitiveContent.node.accessControlPolicyIDs != valueof(v_updateRequestPrimitive.primitiveContent.node.accessControlPolicyIDs)){ setverdict(fail, __SCOPE__, ": Error: Access Control Policy attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.node)) { if(v_primitiveContentRetrieveResource.node.accessControlPolicyIDs != valueof(v_updateRequestPrimitive.primitiveContent.node.accessControlPolicyIDs)){ setverdict(fail, __SCOPE__ & ": Error: Access Control Policy attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_015_NOD_HCL() runs on Tester system CseSystem { /* TO BE DONE */ } testcase TC_CSE_DMR_UPD_015_AE_LBL() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Labels v_labels := {"MyLabel"}; var template RequestPrimitive v_updateRequest := m_updateAE; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.aE.labels := v_labels; v_ae1.start(f_CSE_DMR_UPD_015(int2, m_createAe(PX_APP_ID), v_updateRequest));//AE v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.aE)) { if(v_responsePrimitive.primitiveContent.aE.labels != v_labels){ setverdict(fail, __SCOPE__, ": Error: Labels attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.aE)) { if(v_primitiveContentRetrieveResource.aE.labels != v_labels){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_015_AE_ACPI() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_updateRequest := m_updateAE; var RequestPrimitive v_updateRequestPrimitive; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_ae1.start(f_CSE_DMR_UPD_015(int2, m_createAe(PX_APP_ID), v_updateRequest, true));//AE v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); v_updateRequestPrimitive := f_getRequestPrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.aE)) { if(v_responsePrimitive.primitiveContent.aE.accessControlPolicyIDs != valueof(v_updateRequestPrimitive.primitiveContent.node.accessControlPolicyIDs)){ setverdict(fail, __SCOPE__, ": Error: Access control policy IDs attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.aE)) { if(v_primitiveContentRetrieveResource.aE.accessControlPolicyIDs != valueof(v_updateRequestPrimitive.primitiveContent.node.accessControlPolicyIDs)){ setverdict(fail, __SCOPE__ & ": Error: Access control policy IDs attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_015_AE_APN() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var XSD.String v_appName := "MyAppName"; var template RequestPrimitive v_updateRequest := m_updateAE; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.aE.appName := v_appName; v_ae1.start(f_CSE_DMR_UPD_015(int2, m_createAe(PX_APP_ID), v_updateRequest));//AE v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.aE)) { if(v_responsePrimitive.primitiveContent.aE.appName != v_appName){ setverdict(fail, __SCOPE__, ": Error: AppName attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.aE)) { if(v_primitiveContentRetrieveResource.aE.appName != v_appName){ setverdict(fail, __SCOPE__ & ": Error: AppName attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_015_AE_POA() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var PoaList v_poaList := {"http://" & PX_AE2_ADDRESS & "/"}; var template RequestPrimitive v_updateRequest := m_updateAE; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.aE.pointOfAccess := v_poaList; v_ae1.start(f_CSE_DMR_UPD_015(int2, m_createAe(PX_APP_ID), v_updateRequest));//AE v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.aE)) { if(v_responsePrimitive.primitiveContent.aE.pointOfAccess != v_poaList){ setverdict(fail, __SCOPE__, ": Error: Point of Access attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.aE)) { if(v_primitiveContentRetrieveResource.aE.pointOfAccess != v_poaList){ setverdict(fail, __SCOPE__ & ": Error: Point of Access attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_015_AE_OR() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var XSD.AnyURI v_ontoLogyRef := "MyOntologyRef"; var template RequestPrimitive v_updateRequest := m_updateAE; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.aE.ontologyRef := v_ontoLogyRef; v_ae1.start(f_CSE_DMR_UPD_015(int2, m_createAe(PX_APP_ID), v_updateRequest));//AE v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.aE)) { if(v_responsePrimitive.primitiveContent.aE.ontologyRef != v_ontoLogyRef){ setverdict(fail, __SCOPE__, ": Error: Ontology Ref attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.aE)) { if(v_primitiveContentRetrieveResource.aE.ontologyRef != v_ontoLogyRef){ setverdict(fail, __SCOPE__ & ": Error: Ontology Ref attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_015_CNT_LBL() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Labels v_labels := {"MyLabel"}; var template RequestPrimitive v_updateRequest := m_updateContainerBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.container.labels := v_labels; v_ae1.start(f_CSE_DMR_UPD_015(int3, m_createContainerBase, v_updateRequest));//Container v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.container)) { if(v_responsePrimitive.primitiveContent.container.labels != v_labels){ setverdict(fail, __SCOPE__, ": Error: Labels attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.container)) { if(v_primitiveContentRetrieveResource.container.labels != v_labels){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_015_CNT_ACPI() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_updateRequest := m_updateContainerBase; var RequestPrimitive v_updateRequestPrimitive; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_ae1.start(f_CSE_DMR_UPD_015(int3, m_createContainerBase, v_updateRequest, true));//Container v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); v_updateRequestPrimitive := f_getRequestPrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.container)) { if(v_responsePrimitive.primitiveContent.container.accessControlPolicyIDs != valueof(v_updateRequestPrimitive.primitiveContent.node.accessControlPolicyIDs)){ setverdict(fail, __SCOPE__, ": Error: Access Control Policy IDs attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.container)) { if(v_primitiveContentRetrieveResource.container.accessControlPolicyIDs != valueof(v_updateRequestPrimitive.primitiveContent.node.accessControlPolicyIDs)){ setverdict(fail, __SCOPE__ & ": Error: Access Control Policy IDs attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_015_CNT_MNI() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var XSD.NonNegativeInteger v_maxNrOfInstances := 5; var template RequestPrimitive v_updateRequest := m_updateContainerBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.container.maxNrOfInstances := v_maxNrOfInstances; v_ae1.start(f_CSE_DMR_UPD_015(int3, m_createContainerBase, v_updateRequest));//Container v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.container)) { if(v_responsePrimitive.primitiveContent.container.maxNrOfInstances != v_maxNrOfInstances){ setverdict(fail, __SCOPE__, ": Error: Maximum number of instances attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.container)) { if(v_primitiveContentRetrieveResource.container.maxNrOfInstances != v_maxNrOfInstances){ setverdict(fail, __SCOPE__ & ": Error: Maximum number of instances attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_015_CNT_MBS() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var XSD.NonNegativeInteger v_maxByteSize := 512; var template RequestPrimitive v_updateRequest := m_updateContainerBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.container.maxByteSize := v_maxByteSize; v_ae1.start(f_CSE_DMR_UPD_015(int3, m_createContainerBase, v_updateRequest));//Container v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.container)) { if(v_responsePrimitive.primitiveContent.container.maxByteSize != v_maxByteSize){ setverdict(fail, __SCOPE__, ": Error: Maximum Byte size attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.container)) { if(v_primitiveContentRetrieveResource.container.maxByteSize != v_maxByteSize){ setverdict(fail, __SCOPE__ & ": Error: Maximum Byte Size attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_015_CNT_MIA() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var XSD.NonNegativeInteger v_maxInstanceAge := 1; var template RequestPrimitive v_updateRequest := m_updateContainerBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.container.maxInstanceAge := v_maxInstanceAge; v_ae1.start(f_CSE_DMR_UPD_015(int3, m_createContainerBase, v_updateRequest));//Container v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.container)) { if(v_responsePrimitive.primitiveContent.container.maxInstanceAge != v_maxInstanceAge){ setverdict(fail, __SCOPE__, ": Error: Maximum Instance age attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.container)) { if(v_primitiveContentRetrieveResource.container.maxInstanceAge != v_maxInstanceAge){ setverdict(fail, __SCOPE__ & ": Error: Maximum Instance age attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_015_CNT_OR() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var XSD.AnyURI v_ontoLogyRef := "MyOntologyRef"; var template RequestPrimitive v_updateRequest := m_updateContainerBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.container.ontologyRef := v_ontoLogyRef; v_ae1.start(f_CSE_DMR_UPD_015(int3, m_createContainerBase, v_updateRequest));//Container v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.container)) { if(v_responsePrimitive.primitiveContent.container.ontologyRef != v_ontoLogyRef){ setverdict(fail, __SCOPE__, ": Error: Ontology Ref attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.container)) { if(v_primitiveContentRetrieveResource.container.ontologyRef != v_ontoLogyRef){ setverdict(fail, __SCOPE__ & ": Error: Ontology Ref attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_015_CNT_LI() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var XSD.AnyURI v_locationID := "MyLocationID"; var template RequestPrimitive v_updateRequest := m_updateContainerBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.container.locationID := v_locationID; v_ae1.start(f_CSE_DMR_UPD_015(int3, m_createContainerBase, v_updateRequest));//Container v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.container)) { if(v_responsePrimitive.primitiveContent.container.locationID != v_locationID){ setverdict(fail, __SCOPE__, ": Error: Location ID attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.container)) { if(v_primitiveContentRetrieveResource.container.locationID != v_locationID){ setverdict(fail, __SCOPE__ & ": Error: Location ID attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_015_ACP_LBL() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Labels v_labels := {"MyLabel"}; var template RequestPrimitive v_updateRequest := m_updateAcpBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.accessControlPolicy.labels := v_labels; v_ae1.start(f_CSE_DMR_UPD_015(int1, m_createAcpBase, v_updateRequest));//AccessControlPolicy v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.accessControlPolicy)) { if(v_responsePrimitive.primitiveContent.accessControlPolicy.labels != v_labels){ setverdict(fail, __SCOPE__, ": Error: Labels attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.accessControlPolicy)) { if(v_primitiveContentRetrieveResource.accessControlPolicy.labels != v_labels){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_015_SUB_ACPI() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; var RequestPrimitive v_updateRequestPrimitive; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_ae1.start(f_CSE_DMR_UPD_015(int23, m_createSubscriptionBase, v_updateRequest, true));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); v_updateRequestPrimitive := f_getRequestPrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { if(v_responsePrimitive.primitiveContent.subscription.accessControlPolicyIDs != valueof(v_updateRequestPrimitive.primitiveContent.node.accessControlPolicyIDs)){ setverdict(fail, __SCOPE__, ": Error: Access Control Policy IDs attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.subscription)) { if(v_primitiveContentRetrieveResource.subscription.accessControlPolicyIDs != valueof(v_updateRequestPrimitive.primitiveContent.node.accessControlPolicyIDs)){ setverdict(fail, __SCOPE__ & ": Error: Access Control Policy IDs attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_015_SUB_LBL() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Labels v_labels := {"MyLabel"}; var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.subscription.labels := v_labels; v_ae1.start(f_CSE_DMR_UPD_015(int23, m_createSubscriptionBase, v_updateRequest));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { if(v_responsePrimitive.primitiveContent.subscription.labels != v_labels){ setverdict(fail, __SCOPE__, ": Error: Labels attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.subscription)) { if(v_primitiveContentRetrieveResource.subscription.labels != v_labels){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_015_SUB_ENC() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var EventNotificationCriteria v_eventNotificationCriteria:= valueof(m_eventNotificationCriteria({int3}, -)); var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.subscription.eventNotificationCriteria:=v_eventNotificationCriteria ; v_ae1.start(f_CSE_DMR_UPD_015(int23, m_createSubscriptionBase, v_updateRequest));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { if(v_responsePrimitive.primitiveContent.subscription.eventNotificationCriteria != v_eventNotificationCriteria){ setverdict(fail, __SCOPE__, ": Error: Event Notification Criteria attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.subscription)) { if(v_primitiveContentRetrieveResource.subscription.eventNotificationCriteria != v_eventNotificationCriteria){ setverdict(fail, __SCOPE__ & ": Error: Event Notofication Criteria attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_015_SUB_EXC() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var XSD.PositiveInteger v_expirationCounter:=10; var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.subscription.expirationCounter:=v_expirationCounter; v_ae1.start(f_CSE_DMR_UPD_015(int23, m_createSubscriptionBase, v_updateRequest));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { if(v_responsePrimitive.primitiveContent.subscription.expirationCounter != v_expirationCounter){ setverdict(fail, __SCOPE__, ": Error: Expiration Counter attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.subscription)) { if(v_primitiveContentRetrieveResource.subscription.expirationCounter != v_expirationCounter){ setverdict(fail, __SCOPE__ & ": Error: Expiration Counter attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_015_SUB_GPI() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var XSD.AnyURI v_groupID := "MyGroupID"; var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.subscription.groupID:=v_groupID; v_ae1.start(f_CSE_DMR_UPD_015(int23, m_createSubscriptionBase, v_updateRequest));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { if(v_responsePrimitive.primitiveContent.subscription.groupID != v_groupID){ setverdict(fail, __SCOPE__, ": Error: Group ID attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.subscription)) { if(v_primitiveContentRetrieveResource.subscription.groupID != v_groupID){ setverdict(fail, __SCOPE__ & ": Error: Group ID attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_015_SUB_NFU() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var XSD.AnyURI v_notificationForwardingURI:= "MyNotificationForwardingURI"; var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.subscription.notificationForwardingURI:=v_notificationForwardingURI; v_ae1.start(f_CSE_DMR_UPD_015(int23, m_createSubscriptionBase, v_updateRequest));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { if(v_responsePrimitive.primitiveContent.subscription.notificationForwardingURI != v_notificationForwardingURI){ setverdict(fail, __SCOPE__, ": Error: Notification Forwarding URI attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.subscription)) { if(v_primitiveContentRetrieveResource.subscription.notificationForwardingURI != v_notificationForwardingURI){ setverdict(fail, __SCOPE__ & ": Error: Notification Forwarding URI attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_015_SUB_BN() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var BatchNotify v_batchNotify:= {1, "PT1S"}; var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.subscription.batchNotify:=v_batchNotify; v_ae1.start(f_CSE_DMR_UPD_015(int23, m_createSubscriptionBase, v_updateRequest));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { if(v_responsePrimitive.primitiveContent.subscription.batchNotify != v_batchNotify){ setverdict(fail, __SCOPE__, ": Error: Batch Notify attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.subscription)) { if(v_primitiveContentRetrieveResource.subscription.batchNotify != v_batchNotify){ setverdict(fail, __SCOPE__ & ": Error: Batch Notify attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_015_SUB_RL() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var RateLimit v_rateLimit:= {2, "PT1S"}; var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.subscription.rateLimit:=v_rateLimit; v_ae1.start(f_CSE_DMR_UPD_015(int23, m_createSubscriptionBase, v_updateRequest));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { if(v_responsePrimitive.primitiveContent.subscription.rateLimit != v_rateLimit){ setverdict(fail, __SCOPE__, ": Error: Rate Limit attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.subscription)) { if(v_primitiveContentRetrieveResource.subscription.rateLimit != v_rateLimit){ setverdict(fail, __SCOPE__ & ": Error: Rate Limit attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_015_SUB_PN() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var PendingNotification v_pendingNotification:=int2; var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.subscription.pendingNotification:=v_pendingNotification; v_ae1.start(f_CSE_DMR_UPD_015(int23, m_createSubscriptionBase, v_updateRequest));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { if(v_responsePrimitive.primitiveContent.subscription.pendingNotification != v_pendingNotification){ setverdict(fail, __SCOPE__, ": Error: Pending Notification attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.subscription)) { if(v_primitiveContentRetrieveResource.subscription.pendingNotification != v_pendingNotification){ setverdict(fail, __SCOPE__ & ": Error: Pending Notification attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_015_SUB_NSP() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var XSD.PositiveInteger v_notificationStoragePriority:=10; var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.subscription.notificationStoragePriority:=v_notificationStoragePriority; v_ae1.start(f_CSE_DMR_UPD_015(int23, m_createSubscriptionBase, v_updateRequest));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { if(v_responsePrimitive.primitiveContent.subscription.notificationStoragePriority != v_notificationStoragePriority){ setverdict(fail, __SCOPE__, ": Error: Notification Storage priority attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.subscription)) { if(v_primitiveContentRetrieveResource.subscription.notificationStoragePriority != v_notificationStoragePriority){ setverdict(fail, __SCOPE__ & ": Error: Notification Storage priority attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_015_SUB_LN() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var XSD.Boolean v_latestNotify:=true; var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.subscription.latestNotify:=v_latestNotify; v_ae1.start(f_CSE_DMR_UPD_015(int23, m_createSubscriptionBase, v_updateRequest));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { if(v_responsePrimitive.primitiveContent.subscription.latestNotify != v_latestNotify){ setverdict(fail, __SCOPE__, ": Error: Latest Notify priority attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.subscription)) { if(v_primitiveContentRetrieveResource.subscription.latestNotify != v_latestNotify){ setverdict(fail, __SCOPE__ & ": Error: Latest Notify attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_015_SUB_NEC() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var EventCat v_eventCat:= {alt_1:= 300}; var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.subscription.notificationEventCat:=v_eventCat; v_ae1.start(f_CSE_DMR_UPD_015(int23, m_createSubscriptionBase, v_updateRequest));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { if(v_responsePrimitive.primitiveContent.subscription.notificationEventCat != v_eventCat){ setverdict(fail, __SCOPE__, ": Error: Notification Event Cat attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.subscription)) { if(v_primitiveContentRetrieveResource.subscription.notificationEventCat != v_eventCat){ setverdict(fail, __SCOPE__ & ": Error: Notification Event Cat attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_015_GRP_LBL() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Labels v_labels := {"MyLabel"}; var template RequestPrimitive v_updateRequest := m_updateGroupBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.group_.labels := v_labels; v_ae1.start(f_CSE_DMR_UPD_015(int9, m_createGroupBase, v_updateRequest));//Group v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.group_)) { if(v_responsePrimitive.primitiveContent.group_.labels != v_labels){ setverdict(fail, __SCOPE__, ": Error: Labels attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.group_)) { if(v_primitiveContentRetrieveResource.group_.labels != v_labels){ setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_015_GRP_ACPI() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_updateRequest := m_updateGroupBase; var RequestPrimitive v_updateRequestPrimitive; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_ae1.start(f_CSE_DMR_UPD_015(int9, m_createGroupBase, v_updateRequest, true));//Group v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); v_updateRequestPrimitive := f_getRequestPrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.group_)) { if(v_responsePrimitive.primitiveContent.group_.accessControlPolicyIDs != valueof(v_updateRequestPrimitive.primitiveContent.node.accessControlPolicyIDs)){ setverdict(fail, __SCOPE__, ": Error: Access Control Policy IDs attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.group_)) { if(v_primitiveContentRetrieveResource.group_.accessControlPolicyIDs != valueof(v_updateRequestPrimitive.primitiveContent.node.accessControlPolicyIDs)){ setverdict(fail, __SCOPE__ & ": Error: Access Control Policy IDs attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_015_GRP_MACP() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var ListOfURIs v_membersAccessControlPolicyIDs := {"NotInitialized"}; var template RequestPrimitive v_updateRequest := m_updateGroupBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.group_.membersAccessControlPolicyIDs := v_membersAccessControlPolicyIDs; v_ae1.start(f_CSE_DMR_UPD_015(int9, m_createGroupBase, v_updateRequest));//Group v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.group_)) { if(v_responsePrimitive.primitiveContent.group_.membersAccessControlPolicyIDs != v_membersAccessControlPolicyIDs){ setverdict(fail, __SCOPE__, ": Error: Members Access Control Policy IDs attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.group_)) { if(v_primitiveContentRetrieveResource.group_.membersAccessControlPolicyIDs != v_membersAccessControlPolicyIDs){ setverdict(fail, __SCOPE__ & ": Error: Members Access Control Policy IDs attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_015_GRP_GN() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var XSD.String v_groupName:="MyGroupName"; var template RequestPrimitive v_updateRequest := m_updateGroupBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.group_.groupName := v_groupName; v_ae1.start(f_CSE_DMR_UPD_015(int9, m_createGroupBase, v_updateRequest));//Group v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.group_)) { if(v_responsePrimitive.primitiveContent.group_.groupName != v_groupName){ setverdict(fail, __SCOPE__, ": Error: Group name attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.group_)) { if(v_primitiveContentRetrieveResource.group_.groupName != v_groupName){ setverdict(fail, __SCOPE__ & ": Error: Group name attribute not updated correctly") } } } } function f_CSE_DMR_UPD_015(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, boolean p_secondAcp := false) runs on AeSimu { //Local variables var MsgIn v_response; var AcpType v_acpi; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var integer v_ae2Index := -1; var integer v_acpAuxIndex := -1; var integer v_acpIndex := -1; // Test control // Test component configuration if (p_resourceType!=int16){ //ResourceType != RemoteCSE f_cf01Up(true); } else { f_cf02Up(); } // Test adapter configuration // Preamble if(p_resourceType != int2) { v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); } if(p_resourceType != int1) { v_acpAuxIndex := f_cse_createAccessControlPolicyAux(-, -, -); p_createRequestPrimitive := f_setAcpId(p_createRequestPrimitive, {vc_resourcesList[v_acpAuxIndex].resource.accessControlPolicy.resourceID}); } if(p_secondAcp) {//A second ACP is required v_acpIndex := f_cse_createResource(int1, m_createAcpBase); v_acpi := {vc_resourcesList[v_acpIndex].resource.accessControlPolicy.resourceID}; p_updateRequestPrimitive := f_setAcpId(p_updateRequestPrimitive, v_acpi); } if (p_resourceType!=int16){ //ResourceType != RemoteCSE f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive);//under the CSEBase resource } else { //ResourceType = RemoteCSE vc_cse1.start(f_cse_registerRemoteCse(p_createRequestPrimitive)); vc_cse1.done; v_resourceIndex := f_getRemoteCseResource(vc_cse1); } //Test Body vc_request.primitive.requestPrimitive := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); mcaPort.send(m_request(vc_request.primitive.requestPrimitive)); //CSEBase tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value vc_response { tc_ac.stop; setverdict(pass, __SCOPE__, ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated successfully"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response { tc_ac.stop; setverdict(fail, __SCOPE__, ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response { tc_ac.stop; setverdict(fail, __SCOPE__, ": Error while updating optional attribute"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__, ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); } } vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); //Postamble f_cse_postamble_deleteResources(); // Tear down f_cf02Down(); } // end function f_CSE_DMR_UPD_015 } // end group g_CSE_DMR_UPD_017 group g_CSE_DMR_UPD_016 { /** * @desc Check that the IUT updates successfully the value of the attribute MANDATORY_ATTRIBUTE of the RESOURCE_TYPE resource under CSEBase */ testcase TC_CSE_DMR_UPD_016_CSR_ET() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Timestamp v_expirationTime := "20001231T012345"; var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.remoteCSE.expirationTime := v_expirationTime; v_ae1.start(f_CSE_DMR_UPD_016(int16, m_createRemoteCSEBase, v_updateRequest));//Remote CSE v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.remoteCSE)) { if(v_responsePrimitive.primitiveContent.remoteCSE.expirationTime != v_expirationTime){ setverdict(fail, __SCOPE__, ": Error: Expiration time attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.remoteCSE)) { if(v_primitiveContentRetrieveResource.remoteCSE.expirationTime != v_expirationTime){ setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_016_CSR_RR() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var XSD.Boolean v_requestReachability := true; var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.remoteCSE.requestReachability := v_requestReachability; v_ae1.done; v_ae1.start(f_CSE_DMR_UPD_016(int16, m_createRemoteCSEBase, v_updateRequest));//Remote CSE if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.remoteCSE)) { if(v_responsePrimitive.primitiveContent.remoteCSE.requestReachability != v_requestReachability){ setverdict(fail, __SCOPE__, ": Error: Request Reachability attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.remoteCSE)) { if(v_primitiveContentRetrieveResource.remoteCSE.requestReachability != v_requestReachability){ setverdict(fail, __SCOPE__ & ": Error: Request Reachability attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_016_NOD_ET() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Timestamp v_expirationTime := "20001231T012345"; var template RequestPrimitive v_updateRequest := m_updateNodeBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.node.expirationTime := v_expirationTime; v_ae1.start(f_CSE_DMR_UPD_016(int9, m_createNodeBase, v_updateRequest));//Node v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.node)) { if(v_responsePrimitive.primitiveContent.node.expirationTime != v_expirationTime){ setverdict(fail, __SCOPE__, ": Error: Expiration time attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.node)) { if(v_primitiveContentRetrieveResource.node.expirationTime != v_expirationTime){ setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_016_NOD_NI() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_updateRequest := m_updateNodeBase; var XSD.Token v_targetId := "TARGET-ID"; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.node.nodeID := v_targetId; v_ae1.start(f_CSE_DMR_UPD_016(int9, m_createNodeBase, v_updateRequest));//Node v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.node)) { if(v_responsePrimitive.primitiveContent.node.nodeID != v_targetId){ setverdict(fail, __SCOPE__, ": Error: NodeID attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.node)) { if(v_primitiveContentRetrieveResource.node.nodeID != v_targetId){ setverdict(fail, __SCOPE__ & ": Error: NodeID attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_016_AE_ET() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Timestamp v_expirationTime := "20001231T012345"; var template RequestPrimitive v_updateRequest := m_updateAE; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.aE.expirationTime := v_expirationTime; v_ae1.start(f_CSE_DMR_UPD_016(int2, m_createAe(PX_APP_ID), v_updateRequest));//AE v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.aE)) { if(v_responsePrimitive.primitiveContent.aE.expirationTime != v_expirationTime){ setverdict(fail, __SCOPE__, ": Error: Expiration time attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.aE)) { if(v_primitiveContentRetrieveResource.aE.expirationTime != v_expirationTime){ setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_016_AE_RR() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var XSD.Boolean v_requestReachability := true; var template RequestPrimitive v_updateRequest := m_updateAE; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.aE.requestReachability := v_requestReachability; v_ae1.start(f_CSE_DMR_UPD_016(int2, m_createAe(PX_APP_ID), v_updateRequest));//AE v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.aE)) { if(v_responsePrimitive.primitiveContent.aE.requestReachability != v_requestReachability){ setverdict(fail, __SCOPE__, ": Error: Request Reachability attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.aE)) { if(v_primitiveContentRetrieveResource.aE.requestReachability != v_requestReachability){ setverdict(fail, __SCOPE__ & ": Error: Request Reachability attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_016_CNT_ET() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Timestamp v_expirationTime := "20001231T012345"; var template RequestPrimitive v_updateRequest := m_updateContainerBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.container.expirationTime := v_expirationTime; v_ae1.start(f_CSE_DMR_UPD_016(int3, m_createContainerBase, v_updateRequest));//Container v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.container)) { if(v_responsePrimitive.primitiveContent.container.expirationTime != v_expirationTime){ setverdict(fail, __SCOPE__, ": Error: Expiration time attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.container)) { if(v_primitiveContentRetrieveResource.container.expirationTime != v_expirationTime){ setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_016_ACP_ET() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Timestamp v_expirationTime := "20001231T012345"; var template RequestPrimitive v_updateRequest := m_updateAcpBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.accessControlPolicy.expirationTime := v_expirationTime; v_ae1.start(f_CSE_DMR_UPD_016(int1, m_createAcpBase, v_updateRequest));//AccessControlPolicy v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.accessControlPolicy)) { if(v_responsePrimitive.primitiveContent.accessControlPolicy.expirationTime != v_expirationTime){ setverdict(fail, __SCOPE__, ": Error: Expiration time attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.accessControlPolicy)) { if(v_primitiveContentRetrieveResource.accessControlPolicy.expirationTime != v_expirationTime){ setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_016_ACP_PV() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var SetOfAcrs v_privileges_1 := {{valueof(m_createAcr({PX_SUPER_AE_ID}, int61))}}; var template RequestPrimitive v_updateRequest := m_updateAcpBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.accessControlPolicy.privileges := v_privileges_1; v_ae1.start(f_CSE_DMR_UPD_016(int1, m_createAcpBase, v_updateRequest));//AccessControlPolicy v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.accessControlPolicy)) { if(v_responsePrimitive.primitiveContent.accessControlPolicy.privileges != v_privileges_1){ setverdict(fail, __SCOPE__, ": Error: Privileges attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.accessControlPolicy)) { if(v_primitiveContentRetrieveResource.accessControlPolicy.privileges != v_privileges_1){ setverdict(fail, __SCOPE__ & ": Error: Privileges attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_016_ACP_PVS() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var SetOfAcrs v_privileges_1 := {{valueof(m_createAcr({PX_SUPER_AE_ID}, int61))}}; var template RequestPrimitive v_updateRequest := m_updateAcpBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.accessControlPolicy.selfPrivileges := v_privileges_1; v_ae1.start(f_CSE_DMR_UPD_016(int1, m_createAcpBase, v_updateRequest));//AccessControlPolicy v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.accessControlPolicy)) { if(v_responsePrimitive.primitiveContent.accessControlPolicy.selfPrivileges != v_privileges_1){ setverdict(fail, __SCOPE__, ": Error: Self Privileges attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.accessControlPolicy)) { if(v_primitiveContentRetrieveResource.accessControlPolicy.selfPrivileges != v_privileges_1){ setverdict(fail, __SCOPE__ & ": Error: Self Privileges attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_016_SUB_ET() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Timestamp v_expirationTime := "20001231T012345"; var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.subscription.expirationTime := v_expirationTime; v_ae1.start(f_CSE_DMR_UPD_016(int23, m_createSubscriptionBase, v_updateRequest));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { if(v_responsePrimitive.primitiveContent.subscription.expirationTime != v_expirationTime){ setverdict(fail, __SCOPE__, ": Error: Expiration time attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.subscription)) { if(v_primitiveContentRetrieveResource.subscription.expirationTime != v_expirationTime){ setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_016_SUB_NU() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var ListOfURIs v_notificationURI := {"NotReachableNotificationURI"}; var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.subscription.notificationURI := v_notificationURI; v_ae1.start(f_CSE_DMR_UPD_016(int23, m_createSubscriptionBase, v_updateRequest));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { if(v_responsePrimitive.primitiveContent.subscription.notificationURI != v_notificationURI){ setverdict(fail, __SCOPE__, ": Error: Notification URI attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.subscription)) { if(v_primitiveContentRetrieveResource.subscription.notificationURI != v_notificationURI){ setverdict(fail, __SCOPE__ & ": Error: Notification URI attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_016_SUB_NCT() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var NotificationContentType v_notificationContentType := int2; var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.subscription.notificationContentType := v_notificationContentType; v_ae1.start(f_CSE_DMR_UPD_016(int23, m_createSubscriptionBase, v_updateRequest));//Subscription v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { if(v_responsePrimitive.primitiveContent.subscription.notificationContentType != v_notificationContentType){ setverdict(fail, __SCOPE__, ": Error: Notification Content Type attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.subscription)) { if(v_primitiveContentRetrieveResource.subscription.notificationContentType != v_notificationContentType){ setverdict(fail, __SCOPE__ & ": Error: Notification Content Type attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_016_GRP_ET() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var Timestamp v_expirationTime := "20001231T012345"; var template RequestPrimitive v_updateRequest := m_updateGroupBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.group_.expirationTime := v_expirationTime; v_ae1.start(f_CSE_DMR_UPD_016(int9, m_createGroupBase, v_updateRequest));//Group v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.group_)) { if(v_responsePrimitive.primitiveContent.group_.expirationTime != v_expirationTime){ setverdict(fail, __SCOPE__, ": Error: Expiration Time attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.group_)) { if(v_primitiveContentRetrieveResource.group_.expirationTime != v_expirationTime){ setverdict(fail, __SCOPE__ & ": Error: Expiration Time attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_016_GRP_MNM() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var XSD.PositiveInteger v_maxNrOfMembers := 10; var template RequestPrimitive v_updateRequest := m_updateGroupBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.group_.maxNrOfMembers := v_maxNrOfMembers; v_ae1.start(f_CSE_DMR_UPD_016(int9, m_createGroupBase, v_updateRequest));//Group v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.group_)) { if(v_responsePrimitive.primitiveContent.group_.maxNrOfMembers != v_maxNrOfMembers){ setverdict(fail, __SCOPE__, ": Error: Maximum Number of Members attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.group_)) { if(v_primitiveContentRetrieveResource.group_.maxNrOfMembers != v_maxNrOfMembers){ setverdict(fail, __SCOPE__ & ": Error: Maximum Number of Members attribute not updated correctly") } } } } testcase TC_CSE_DMR_UPD_016_GRP_MID() runs on Tester system CseSystem { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var ListOfURIs v_memberIDs := {"NotInitialized"}; var template RequestPrimitive v_updateRequest := m_updateGroupBase; var ResponsePrimitive v_responsePrimitive; var PrimitiveContent v_primitiveContentRetrieveResource; v_updateRequest.primitiveContent.group_.memberIDs := v_memberIDs; v_ae1.start(f_CSE_DMR_UPD_016(int9, m_createGroupBase, v_updateRequest));//Group v_ae1.done; if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1); //Check attribute 1 if(ispresent(v_responsePrimitive.primitiveContent)) { if(ischosen(v_responsePrimitive.primitiveContent.group_)) { if(v_responsePrimitive.primitiveContent.group_.memberIDs != v_memberIDs){ setverdict(fail, __SCOPE__, ": Error: Member IDs attribute not updated correctly") } } } v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); //Check that the resource has been udpated correctly if(ischosen(v_primitiveContentRetrieveResource.group_)) { if(v_primitiveContentRetrieveResource.group_.memberIDs != v_memberIDs){ setverdict(fail, __SCOPE__ & ": Error: Member IDs attribute not updated correctly") } } } } function f_CSE_DMR_UPD_016(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive) runs on AeSimu { //Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var integer v_ae2Index := -1; var integer v_acpAuxIndex := -1; // Test control // Test component configuration if (p_resourceType!=int16){ //ResourceType != RemoteCSE f_cf01Up(true); } else { f_cf02Up(); } // Test adapter configuration // Preamble if(p_resourceType != int2) { v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); } if(p_resourceType != int1) { v_acpAuxIndex := f_cse_createAccessControlPolicyAux(-, -, -); p_createRequestPrimitive := f_setAcpId(p_createRequestPrimitive, {vc_resourcesList[v_acpAuxIndex].resource.accessControlPolicy.resourceID}); } if (p_resourceType!=int16){ //ResourceType != RemoteCSE f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive);//under the CSEBase resource } else { //ResourceType = RemoteCSE vc_cse1.start(f_cse_registerRemoteCse(p_createRequestPrimitive)); vc_cse1.done; v_resourceIndex := f_getRemoteCseResource(vc_cse1); } //Test Body v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); mcaPort.send(m_request(v_request)); //CSEBase tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value vc_response { tc_ac.stop; setverdict(pass, __SCOPE__, ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated successfully"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response { tc_ac.stop; setverdict(fail, __SCOPE__, ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response { tc_ac.stop; setverdict(fail, __SCOPE__, ": Error while updating mandatory attribute"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__, ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); } } vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); //Postamble f_cse_postamble_deleteResources(); // Tear down f_cf02Down(); } //end function f_CSE_DMR_UPD_016 } // end group g_CSE_DMR_UPD_016 }//end group Update group Delete { group g_CSE_DMR_DEL_001{ /** * @desc Check that the IUT accepts the deletion of a RESOURCE_TYPE resource * */ testcase TC_CSE_DMR_DEL_001_CNT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_DEL_001(int3, m_createContainerBase));//Container v_ae1.done; if(getverdict == pass){ //check if "MyRessource" container resource isn't present in the IUT (for exemple attempt to update the resource) }; }; testcase TC_CSE_DMR_DEL_001_GRP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_DEL_001(int9, m_createGroupBase));//Group v_ae1.done; }; testcase TC_CSE_DMR_DEL_001_ACP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_DEL_001(int1, m_createAcpBase));//AccessControlPolicy v_ae1.done; }; testcase TC_CSE_DMR_DEL_001_SCH() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_DEL_001(int18, m_createScheduleBase));//Schedule v_ae1.done; }; testcase TC_CSE_DMR_DEL_001_PCH() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_DEL_001(int15, m_createPollingChannelBase));//PollingChannel v_ae1.done; }; testcase TC_CSE_DMR_DEL_001_SUB() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_DEL_001(int23, m_createSubscriptionBase));//Subscription v_ae1.done; }; testcase TC_CSE_DMR_DEL_001_CIN() runs on AeSimu system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_DEL_001(int4, m_createContentInstanceBase));//ContentInstance v_ae1.done; }; function f_CSE_DMR_DEL_001(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive) runs on AeSimu { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_parentIndex := -1; var integer v_containerIndex := -1; var integer v_resourceIndex := -1; var integer v_ae2Index := -1; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi) f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); if(p_resourceType == int4) { v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); v_parentIndex := v_containerIndex; }else{ v_parentIndex := v_aeIndex; } v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_parentIndex); // Test Body v_request := valueof(m_delete(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Resource" & int2str(enum2int(p_resourceType)) & " deleted successfully"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while deleting resource type " & int2str(enum2int(p_resourceType))); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while deleting resource type " & int2str(enum2int(p_resourceType))); } } f_checkAeSimuStatus(); //Check to see if the resource is present or not if (f_isResourceNotPresent(v_aeIndex, f_getResourceName(vc_resourcesList[v_resourceIndex].resource))){ setverdict(pass, __SCOPE__ & ":INFO: Resource deleted"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource not deleted"); } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); };//end f_CSE_DMR_DEL_001 };//end of group g_CSE_DMR_DEL_001 group g_CSE_DMR_DEL_002{ /** * @desc Check that the IUT responds with an error when the AE tries to delete the resource TARGET_RESOURCE_ADDRESS without having privileges for the DELETE operation * */ testcase TC_CSE_DMR_DEL_002_CNT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_DEL_002(int3, m_createContainerBase));//Container v_ae1.done; }; testcase TC_CSE_DMR_DEL_002_GRP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_DEL_002(int9, m_createGroupBase));//Group v_ae1.done; }; testcase TC_CSE_DMR_DEL_002_ACP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_DEL_002(int1, m_createAcpBase));//AccessControlPolicy v_ae1.done; }; testcase TC_CSE_DMR_DEL_002_SCH() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_DEL_002(int18, m_createScheduleBase));//Schedule v_ae1.done; }; testcase TC_CSE_DMR_DEL_002_PCH() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_DEL_002(int15, m_createPollingChannelBase));//PollingChannel v_ae1.done; }; testcase TC_CSE_DMR_DEL_002_SUB() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_DEL_002(int23, m_createSubscriptionBase));//Subscription v_ae1.done; }; function f_CSE_DMR_DEL_002(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive) runs on AeSimu { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var RequestPrimitive v_updateRequest; var integer v_acpAuxIndex := -1; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var integer v_ae2Index := -1; var AccessControlRule v_accessControlRule_1 := valueof(m_createAcr({PX_SUPER_AE_ID}, int63)); var AccessControlRule v_accessControlRule_2; var SetOfAcrs v_setOfArcs; // Test control if(not(PICS_ACP_SUPPORT)) { setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); stop; } // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_acpAuxIndex := f_cse_preamble_createAcpAux(-,-);//c_CRDNDi); v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}, -);//c_CRUNDi); f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); //Update ACP Aux to remove DELETE operation rights to AE, keeping rights of SUPER USER to run postamble v_accessControlRule_2 := valueof(m_createAcr({f_getResourceId(vc_resourcesList[v_aeIndex].resource)}, int55)); v_setOfArcs.accessControlRule_list := {v_accessControlRule_1, v_accessControlRule_2}; v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs, -)); v_updateRequest := f_getUpdateRequestPrimitive(int1, vc_acpAuxIndex, v_updateRequest); f_cse_updateResource(v_updateRequest); //Adjustments for ACP resource type if(p_resourceType == int1) { p_createRequestPrimitive.primitiveContent.accessControlPolicy.selfPrivileges.accessControlRule_list := {v_accessControlRule_2};//{v_accessControlRule_1,v_accessControlRule_2}; } else { p_createRequestPrimitive := f_setAcpId(p_createRequestPrimitive, {f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}); } //Creation of resource v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); // Test Body v_request := valueof(m_delete(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); v_request.from_ := f_getOriginator(v_aeIndex); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Access denied to delete the resource " & int2str(enum2int(p_resourceType))); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error resource deleted without having privileges"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while deleting resource type " & int2str(enum2int(p_resourceType))); } } f_checkAeSimuStatus(); //Check if the resource has been deleted or not if(f_isResourcePresent(v_resourceIndex)) { setverdict(pass, __SCOPE__ & ":INFO: Resource not deleted"); } else { setverdict(fail, __SCOPE__ & ":INFO: Resource deleted"); } // Postamble // We are forced to delete the Ae because the delete request in the postamble_deleteResources is sent by Ae itself, witch doesn't have privileges f_cse_deleteResource(v_aeIndex, m_delete(f_getResourceAddress(v_aeIndex), f_getOriginator()));//Use of PX_SUPER_AE_ID to remove AE f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); };//end f_CSE_DMR_DEL_002 };//end of group g_CSE_DMR_DEL_002 group g_CSE_DMR_DEL_003{ /** * @desc Check that the IUT responds with an error when the AE tries to delete the resource TARGET_RESOURCE_ADDRESS which does not exist * */ testcase TC_CSE_DMR_DEL_003() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var charstring v_resourceIdOrName := "NotExistingResource"; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); // Test Body if(PX_ADDRESSING_METHOD == e_nonHierarchical and (PX_PRIMITIVE_SCOPE == e_cseRelative)) { v_request := valueof(m_delete(v_resourceIdOrName, f_getOriginator(v_aeIndex))); } else { v_request := valueof(m_delete(f_getResourceAddress(v_aeIndex) & "/" & v_resourceIdOrName, f_getOriginator(v_aeIndex))); } mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Unexisting resource cannot be deleted"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while deleting non existing resource"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while deleting non existing resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while deleting resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); };//end f_CSE_DMR_DEL003 };//end of group g_CSE_DMR_DEL_003 group g_CSE_DMR_DEL_004{ /** * @desc Check that the IUT responds with an error when AE tries to delete a child resource of a RESOURCE_TYPE resource when this resource has been already deleted * */ testcase TC_CSE_DMR_DEL_004_CNT() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_DEL_004(int3, m_createContainerBase, int3, m_createContainerBase));//Container v_ae1.done; }; testcase TC_CSE_DMR_DEL_004_GRP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_DEL_004(int9, m_createGroupBase, int23, m_createSubscriptionBase));//Group v_ae1.done; }; testcase TC_CSE_DMR_DEL_004_ACP() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_DEL_004(int1, m_createAcpBase, int23, m_createSubscriptionBase));//AccessControlPolicy v_ae1.done; }; testcase TC_CSE_DMR_DEL_004_SCH() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_DEL_004(int18, m_createScheduleBase, int23, m_createSubscriptionBase));//Schedule v_ae1.done; }; testcase TC_CSE_DMR_DEL_004_PCH() runs on Tester system CseSystem { // Local variables // don't exist pollingChannel's child resource //v_ae1.start(f_CSE_DMR_DEL_004(int15, m_createPollingChannelBase, int23, m_createSubscriptionBase);//PollingChannel TODO ResourceType needed is PollingChannelURI // v_ae1.done; }; testcase TC_CSE_DMR_DEL_004_SUB() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_DMR_DEL_004(int23, m_createSubscriptionBase, int18, m_createScheduleBase));//Subscription v_ae1.done; }; function f_CSE_DMR_DEL_004(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, ResourceType p_childResourceType, template RequestPrimitive p_createRequestPrimitiveChildResource) runs on AeSimu { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var integer v_childResourceIndex := -1; var integer v_ae2Index := -1; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); v_childResourceIndex := f_cse_createResource(p_childResourceType, p_createRequestPrimitiveChildResource, v_resourceIndex); f_cse_deleteResource(v_resourceIndex); // Test Body mcaPort.send(m_request(m_delete(f_getResourceAddress(v_childResourceIndex), f_getOriginator(v_childResourceIndex)))); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Error while deleting non existing resource"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while deleting non existing resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while deleting resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); };//end f_CSE_DMR_DEL_004 };//end of group g_CSE_DMR_DEL_004 group g_CSE_DMR_DEL_005{ /** * @desc Check that the stateTag attribute of a container resource is increased when a child resource is deleted * */ testcase TC_CSE_DMR_DEL_005() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var integer v_childResourceIndex := -1; const ResourceType c_containerResourceType := int3; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); v_resourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_aeIndex); if(ispresent(vc_resourcesList[v_resourceIndex].resource.container.stateTag)) { v_childResourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_resourceIndex); // Test Body mcaPort.send(m_request(m_delete(f_getResourceAddress(v_childResourceIndex), f_getOriginator(v_childResourceIndex)))); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(c_containerResourceType)) & " delete successfully"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while deleting resource type " & int2str(enum2int(c_containerResourceType))); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while deleting resource type " & int2str(enum2int(c_containerResourceType))); } } mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)))); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; if(v_response.primitive.responsePrimitive.primitiveContent.container.stateTag == 2) { //(Create and Delete) setverdict(pass, __SCOPE__ & ": The stateTag attribute is incremented"); } else{ setverdict(fail, __SCOPE__ & ": Error the stateTag attribute is not incremented"); } } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource attributes"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes"); } } }//end if else{ setverdict(fail, __SCOPE__ & ": Error the stateTag attribute is empty"); } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_DMR_DEL_005 } // end group g_CSE_DMR_DEL_005 group g_CSE_DMR_DEL_006{ /** * @desc Check that the IUT decreases the field value of attribute currentNrOfInstances and currentByteSize of parent container when a latest contentInstance resource is deleted successfully * */ testcase TC_CSE_DMR_DEL_006() runs on AeSimu system CseSystem { // Local variables var integer v_aeIndex := -1; var integer v_containerIndex := -1; var integer v_contentInstanceIndex := -1; var PrimitiveContent v_attributesContainer, v_attributesContainer_afterDeletion; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); v_contentInstanceIndex := f_cse_createResource(int4, m_createContentInstanceBase, v_containerIndex); v_attributesContainer := f_cse_retrieveResource(v_containerIndex); if(not(ispresent(v_attributesContainer.container.currentNrOfInstances))) { setverdict(fail, __SCOPE__ & ": Error the currentNrOfInstances attribute is empty"); f_checkAeSimuStatus(); } // Test Body f_cse_deleteResource(v_contentInstanceIndex); v_attributesContainer_afterDeletion := f_cse_retrieveResource(v_containerIndex); if(not(ispresent(v_attributesContainer.container.currentNrOfInstances))) { setverdict(fail, __SCOPE__ & ": Error the currentNrOfInstances attribute is empty"); f_checkAeSimuStatus(); } if((v_attributesContainer.container.currentNrOfInstances > v_attributesContainer_afterDeletion.container.currentNrOfInstances) and (v_attributesContainer.container.currentByteSize > v_attributesContainer_afterDeletion.container.currentByteSize)) { setverdict(pass, __SCOPE__ & ": The currentNrOfInstances and currentByteSize attributes are decreased"); } else { setverdict(fail, __SCOPE__ & ": currentNrOfInstances and/or currentByteSize attributes are not decreased"); } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_DMR_DEL_006 } // end group g_CSE_DMR_DEL_006 group g_CSE_DMR_DEL_007{ /** * @desc Check that the IUT accepts the DELETE Request of the latest contentInstance resource target to a container resource * */ testcase TC_CSE_DMR_DEL_007() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_containerIndex := -1; var integer v_contentInstanceIndex_1 := -1; var integer v_contentInstanceIndex_2 := -1; const ResourceType c_containerResourceType := int3; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); v_contentInstanceIndex_1 := f_cse_createResource(int4, m_createContentInstance_noResourceName, v_containerIndex); v_contentInstanceIndex_2 := f_cse_createResource(int4, m_createContentInstance_noResourceName, v_containerIndex); // Test Body v_request := valueof(m_delete(f_getResourceAddress(v_containerIndex) & "/" & c_resourceShortNameLatest, f_getOriginator(v_containerIndex))); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(c_containerResourceType)) & " deleted successfuly"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while deleting resource type " & int2str(enum2int(c_containerResourceType))); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while deleting resource type " & int2str(enum2int(c_containerResourceType))); } } f_checkAeSimuStatus(); mcaPort.send(m_request(m_retrieveResource((f_getResourceAddress(v_contentInstanceIndex_2)), f_getOriginator(v_contentInstanceIndex_2)))); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Resource type" & int2str(enum2int(c_containerResourceType)) & " has already been deleted"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Error while retrieving resource attributes as" & int2str(enum2int(c_containerResourceType)) & " has been deleted"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_DMR_DEL_007 } // end group g_CSE_DMR_DEL_007 group g_CSE_DMR_DEL_008{ /** * @desc Check that the IUT rejects the DELETE request of a latest resource in a container resource that has no direct child contentInstance resources. * */ testcase TC_CSE_DMR_DEL_008() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_containerIndex := -1; const ResourceType c_containerResourceType := int4; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); // Test Body v_request := valueof(m_delete(f_getResourceAddress(v_containerIndex) & "/" & c_resourceShortNameLatest, f_getOriginator(v_containerIndex))); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(c_containerResourceType)) & " NOT FOUND"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Resource type " & int2str(enum2int(c_containerResourceType)) & " has not been created"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while deleting resource type " & int2str(enum2int(c_containerResourceType))); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_DMR_DEL_008 } // end group g_CSE_DMR_DEL_008 group g_CSE_DMR_DEL_009{ /** * @desc Check that the IUT accepts the DELETE Request of the oldest contentInstance resource target to a container resource * */ testcase TC_CSE_DMR_DEL_009() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_containerIndex := -1; var integer v_contentInstanceIndex_1 := -1; var integer v_contentInstanceIndex_2 := -1; const ResourceType c_containerResourceType := int3; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); v_contentInstanceIndex_1 := f_cse_createResource(int4, m_createContentInstance_noResourceName, v_containerIndex); v_contentInstanceIndex_2 := f_cse_createResource(int4, m_createContentInstance_noResourceName, v_containerIndex); // Test Body v_request := valueof(m_delete(f_getResourceAddress(v_containerIndex) & "/" & c_resourceShortNameOldest, f_getOriginator(v_containerIndex))); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(c_containerResourceType)) & " deleted successfuly"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while deleting resource type " & int2str(enum2int(c_containerResourceType))); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while deleting resource type " & int2str(enum2int(c_containerResourceType))); } } f_checkAeSimuStatus(); mcaPort.send(m_request(m_retrieveResource((f_getResourceAddress(v_contentInstanceIndex_1)), f_getOriginator(v_contentInstanceIndex_1)))); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Resource type" & int2str(enum2int(c_containerResourceType)) & " has already been deleted"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Error while retrieving resource attributes as " & int2str(enum2int(c_containerResourceType)) & " has been deleted"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_DMR_DEL_009 } // end group g_CSE_DMR_DEL_009 group g_CSE_DMR_DEL_010{ /** * @desc Check that the IUT rejects the DELETE request of a oldest resource in a container resource that has no direct child contentInstance resources. * */ testcase TC_CSE_DMR_DEL_010() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_containerIndex := -1; const ResourceType c_containerResourceType := int4; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); // Test Body v_request := valueof(m_delete(f_getResourceAddress(v_containerIndex) & "/" & c_resourceShortNameOldest, f_getOriginator(v_containerIndex))); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Resource type" & int2str(enum2int(c_containerResourceType)) & " NOT FOUND"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Resource type" & int2str(enum2int(c_containerResourceType)) & " has not been created"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while deleting resource type " & int2str(enum2int(c_containerResourceType))); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end f_CSE_DMR_DEL_010 } // end group g_CSE_DMR_DEL_010 }//end group Delete }//end group Data_Management_and_Repository group Location { group g_CSE_LOC_BV_001{ testcase TC_CSE_LOC_BV_001() runs on AeSimu system CseSystem { var integer v_aeIndex := -1; var RequestPrimitive v_request; var MsgIn v_response; var LocationSource v_locationSource := int1;//Network-based //Test component configuration f_cf01Up(); //Preamble v_aeIndex := f_cse_preamble_registerAe(); //Set requestPrimitive v_request := f_getCreateRequestPrimitive(int10, m_createLocationPolicy(v_locationSource, omit, omit, omit, omit), v_aeIndex); //Test Body mcaPort.send(m_request(v_request)); tc_ac.start; alt{ [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) -> value v_response { //BAD REQUEST tc_ac.stop; setverdict(pass, __SCOPE__ & "Resource <locationPolicy> create request is rejected due to invalid request body message!!"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Created a locationPolicy resource for an invalid create request with response status code:" & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": Timeout due to no response received from requested server!"); } } f_checkAeSimuStatus(); //Check to see if the resource is NOT present if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }// end testcase TC_CSE_LOC_BV_001 }//end group g_CSE_LOC_BV_001 group g_CSE_LOC_BV_002{ testcase TC_CSE_LOC_BV_002() runs on AeSimu system CseSystem { var integer v_aeAuxIndex := -1; var LocationSource v_locationSource := int1;//Network-based var XSD.Duration locationUpdatePeriod := PX_LOCATION_UPDATE_PERIOD; var XSD.Token locationTargetID := PX_LOCATION_TARGET_ID; var XSD.AnyURI locationServerAddress := PX_LOCATION_SERVER_ADDRESS; var RequestPrimitive v_request; var MsgIn v_response; var integer v_resourceIndex := -1; //Test component configuration f_cf01Up(); //Preamble v_aeAuxIndex := f_cse_preamble_registerAe(); //Set requestPrimitive v_request := f_getCreateRequestPrimitive(int10, m_createLocationPolicy(v_locationSource, omit, locationUpdatePeriod, locationTargetID, locationServerAddress), v_aeAuxIndex); // Test Body mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Resource locationPolicy is created successfully with response status code: " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))&"!"); f_checkAttributesToBeSaved(int10, v_request, v_response.primitive.responsePrimitive); v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int10, v_aeAuxIndex); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error occurrs with response status code: " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)) & "while handling a valid locationPolicy resource create request!"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": Timeout due to no response from requested server!"); } } f_checkAeSimuStatus(); //Check to see if the resource is present or not if(f_isResourcePresent(v_resourceIndex)) { setverdict(pass, __SCOPE__ & ":INFO: Resource created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }// end testcase TC_CSE_LOC_BV_002 }//end group g_CSE_LOC_BV_002 group g_CSE_LOC_BO_003{ testcase TC_CSE_LOC_BO_003() runs on AeSimu system CseSystem {//the originator has no privileges to create a locationPolicy resource!! var integer v_aeIndex := -1; var integer v_acpAuxIndex := -1; var LocationSource v_locationSource := int1;//Network-based var XSD.Duration locationUpdatePeriod := PX_LOCATION_UPDATE_PERIOD; var XSD.Token locationTargetID := PX_LOCATION_TARGET_ID; var XSD.AnyURI locationServerAddress := PX_LOCATION_SERVER_ADDRESS; var RequestPrimitive v_request; var MsgIn v_response; // Test control if(not(PICS_ACP_SUPPORT)) { setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); stop; } //Test component configuration f_cf01Up(); //Preamble v_acpAuxIndex := f_cse_preamble_createAcpAux(-, int62);//c_RUDNDi) //No resource creation privilege v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}, -); //Set requestPrimitive v_request := f_getCreateRequestPrimitive(int10, m_createLocationPolicy(v_locationSource,omit, locationUpdatePeriod, locationTargetID, locationServerAddress), v_aeIndex); // Test Body mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Access denied to create a resource including locationPolicy!"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error occurrs with response status code: " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)) & "due to IUT failed to check the access privilege of originator!"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": Timeout due to no response from requested server!"); } } f_checkAeSimuStatus(); //Check to see if the resource is NOT present if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } // end testcase TC_CSE_LOC_BO_003 }//end group g_CSE_LOC_BO_003 group g_CSE_LOC_BO_004{ testcase TC_CSE_LOC_BO_004() runs on AeSimu system CseSystem { var integer v_aeIndex := -1; var LocationSource v_locationSource := int1;//Netwok-based var XSD.Duration locationUpdatePeriod := PX_LOCATION_UPDATE_PERIOD; var XSD.Token locationTargetID := PX_LOCATION_TARGET_ID; var XSD.AnyURI locationServerAddress := PX_LOCATION_SERVER_ADDRESS; var RequestPrimitive v_request; var MsgIn v_response; //Test component configuration f_cf01Up(); //Preamble v_aeIndex := f_cse_preamble_registerAe(); //Set requestPrimitive v_request := f_getCreateRequestPrimitive(int10, m_createLocationPolicy(v_locationSource, omit, locationUpdatePeriod, locationTargetID, locationServerAddress), v_aeIndex); // Test Body mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": The targeted resource is not found!!"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error occurrs with response status code: "& int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)) & "due to IUT created a locationPolicy resource under a non-existed parent resource!"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": Timeout due to no response from requested server!"); } } f_checkAeSimuStatus(); //Check to see if the resource is NOT present if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }// end testcase TC_CSE_LOC_BO_004 }//end group g_CSE_LOC_BO_004 group g_CSE_LOC_BI_005{ testcase TC_CSE_LOC_BI_005() runs on AeSimu system CseSystem {//reject an invalid update request with invalid attribtue locationUpdatePeriod var integer v_aeAuxIndex := -1; var integer v_locPolicyResourceIndex := -1; var LocationSource v_locationSource := int1;//Netwok-based var XSD.Duration locationUpdatePeriod := PX_LOCATION_UPDATE_PERIOD; var XSD.Duration locationUpdatePeriod_invalid := c_invalid_location_update_period; var XSD.Token locationTargetID := PX_LOCATION_TARGET_ID; var XSD.AnyURI locationServerAddress := PX_LOCATION_SERVER_ADDRESS; var RequestPrimitive v_request; var RequestPrimitive v_locpolicy_request_preamble; var MsgIn v_response; //Test component configuration f_cf01Up(); //Preamble - register AE v_aeAuxIndex := f_cse_preamble_registerAe(); //Preamble - create a valid locationPolicy resource for later update use v_locpolicy_request_preamble:= valueof(m_createLocationPolicy(v_locationSource, omit, locationUpdatePeriod, locationTargetID, locationServerAddress)); v_locPolicyResourceIndex := f_cse_createResource(int10, v_locpolicy_request_preamble, v_aeAuxIndex); //Set requestPrimitive v_request := f_getUpdateRequestPrimitive(int10, v_locPolicyResourceIndex, m_updateLocationPolicy(f_getResourceAddress(v_locPolicyResourceIndex), omit, locationUpdatePeriod_invalid)); // Test Body mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Update locationPolicy resource is rejected!!"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error occurrs with response status code: "& int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)) & "due to IUT failed to handle an invalid locationPolicy update request"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": Timeout due to no response from requested server!"); } } f_checkAeSimuStatus(); //TODO: Check to see if the resource has been updated or not // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end testcase TC_CSE_LOC_BI_005 }//end group g_CSE_LOC_BI_005 group g_CSE_LOC_BV_006 { testcase TC_CSE_LOC_BV_006() runs on AeSimu system CseSystem{ //TO RETRIEVE a <container> resource that has created in cse and linked with a <locationPolicy> resource (network-based case) var integer v_aeAuxIndex := -1; var integer v_locPolicyResourceIndex := -1; var integer v_locContainerResourceIndex := -1; var XSD.Duration locationUpdatePeriod := PX_LOCATION_UPDATE_PERIOD; var XSD.Token locationTargetID := PX_LOCATION_TARGET_ID; var XSD.AnyURI locationServerAddress := PX_LOCATION_SERVER_ADDRESS; var RequestPrimitive v_loc_request_preamble; var RequestPrimitive v_container_request_preamble; var MsgIn v_response; var LocationSource v_locationSource := int1;//Network-based //Test component configuration f_cf01Up(); //Preamble - register AE v_aeAuxIndex := f_cse_preamble_registerAe(); //Preamble - create a valid locationPolicy resource for later container resource creation v_loc_request_preamble := valueof(m_createLocationPolicy(v_locationSource, omit, locationUpdatePeriod, locationTargetID, locationServerAddress)); v_container_request_preamble := valueof(m_createContainer(f_getResourceAddress(v_aeAuxIndex), omit));//no location-container name provided? v_locPolicyResourceIndex := f_cse_createResource(int10, v_loc_request_preamble, v_aeAuxIndex);//created locationpolicy index v_locContainerResourceIndex := f_cse_createResource(int3, v_container_request_preamble, v_locPolicyResourceIndex);//created container index //Test Body - retrieve the created container resource mcaPort.send(m_request(valueof(m_retrieveResource(f_getResourceAddress(v_locContainerResourceIndex), f_getOriginator(v_locContainerResourceIndex))))); tc_ac.start; alt{ [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response{ tc_ac.stop; if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.container.locationID)){ setverdict(fail, __SCOPE__ & "No locationID is included in the response!"); }else{ setverdict(pass, __SCOPE__ & "Container resource associated with locationPolicy resource is successfully retrieved with locationID included in the response!"); } } [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response{ tc_ac.stop; setverdict(fail, __SCOPE__ & "Requested container resource is not found!"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource!"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource!"); } } f_checkAeSimuStatus(); // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end testcase TC_CSE_LOC_BV_006 }//end group g_CSE_LOC_BV_006 group g_CSE_LOC_BV_007 { testcase TC_CSE_LOC_BV_007() runs on AeSimu system CseSystem{ //TO create a <locationPolicy> resource with locationSource set to Device-based var integer v_aeAuxIndex := -1; var XSD.Duration locationUpdatePeriod := PX_LOCATION_UPDATE_PERIOD; var RequestPrimitive v_request; var MsgIn v_response; var LocationSource v_locationSource := int2;//Device-based var integer v_resourceIndex := -1; //Test component configuration f_cf01Up(); if(PX_IUT_IS_ASN_CSE){ //Preamble v_aeAuxIndex := f_cse_preamble_registerAe(); //Set requestPrimitive v_request := f_getCreateRequestPrimitive(int10, m_createLocationPolicy(v_locationSource, omit, locationUpdatePeriod, omit, omit), v_aeAuxIndex); // Test Body mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Resource locationPolicy is created successfully with response status code: " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))&"!"); f_checkAttributesToBeSaved(int10, v_request, v_response.primitive.responsePrimitive); v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int10, v_aeAuxIndex); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error occurrs with response status code: " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)) & "while handling a valid locationPolicy resource create request!"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": Timeout due to no response from requested server!"); } } f_checkAeSimuStatus(); //Check to see if the resource is present or not if(f_isResourcePresent(v_resourceIndex)) { setverdict(pass, __SCOPE__ & ":INFO: Resource created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); } // Postamble f_cse_postamble_deleteResources(); } // Tear down f_cf01Down(); }//end testcase TC_CSE_LOC_BV_007 }//end group g_CSE_LOC_BV_007 group g_CSE_LOC_BV_008 { testcase TC_CSE_LOC_BV_008() runs on AeSimu system CseSystem{ //TO create a <locationPolicy> resource with locationSource set to Share-based var integer v_aeAuxIndex := -1; var LocationSource v_locationSource := int3;//Share-based var RequestPrimitive v_request; var MsgIn v_response; var integer v_resourceIndex := -1; //Test component configuration f_cf01Up(); if(PX_IUT_IS_MN_CSE){ //Preamble v_aeAuxIndex := f_cse_preamble_registerAe(); //Set requestPrimitive v_request := f_getCreateRequestPrimitive(int10, m_createLocationPolicy(v_locationSource, omit, omit, omit, omit), v_aeAuxIndex); // Test Body mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Resource locationPolicy is created successfully with response status code: " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))&"!"); f_checkAttributesToBeSaved(int10, v_request, v_response.primitive.responsePrimitive); v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int10, v_aeAuxIndex); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error occurrs with response status code: " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)) & "while handling a valid locationPolicy resource create request!"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": Timeout due to no response from requested server!"); } } f_checkAeSimuStatus(); //Check to see if the resource is present or not if(f_isResourcePresent(v_resourceIndex)) { setverdict(pass, __SCOPE__ & ":INFO: Resource created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); } // Postamble f_cse_postamble_deleteResources(); } // Tear down f_cf01Down(); }//end testcase TC_CSE_LOC_BV_008 }//end group g_CSE_LOC_BV_008 group g_CSE_LOC_BV_009 { testcase TC_CSE_LOC_BV_009_01() runs on AeSimu system CseSystem{ //TO NOTIFY a location information var integer v_aeAuxIndex := -1; var integer v_locPolicyResourceIndex := -1; var integer v_locContainerResourceIndex := -1; var integer v_subscriptionResourceIndex := -1; var LocationSource v_locationSource := int1;//Netwok-based var XSD.Duration locationUpdatePeriod := PX_LOCATION_UPDATE_PERIOD; var XSD.Token locationTargetID := PX_LOCATION_TARGET_ID; var XSD.AnyURI locationServerAddress := PX_LOCATION_SERVER_ADDRESS; var RequestPrimitive v_locpolicy_request_preamble; var RequestPrimitive v_container_request_preamble; var RequestPrimitive v_subscription_request_preamble; var MsgIn v_response; //Test component configuration f_cf01Up(); //Preamble - register AE v_aeAuxIndex := f_cse_preamble_registerAe(); //Preamble - create a valid locationPolicy resource v_locpolicy_request_preamble := valueof(m_createLocationPolicy(v_locationSource, omit, locationUpdatePeriod, locationTargetID, locationServerAddress)); v_container_request_preamble := valueof(m_createContainer(f_getResourceAddress(v_aeAuxIndex), omit));//no location-container name provided? v_locPolicyResourceIndex := f_cse_createResource(int10, v_locpolicy_request_preamble, v_aeAuxIndex);//created locationpolicy index v_locContainerResourceIndex := f_cse_createResource(int3, v_container_request_preamble, v_locPolicyResourceIndex);//created container index v_subscription_request_preamble := valueof(m_createSubscription(f_getResourceAddress(v_locContainerResourceIndex), c_defaultResourceName, -)); v_subscriptionResourceIndex := f_cse_createResource(int23, v_subscription_request_preamble, v_locContainerResourceIndex); //Test Body - retrieve the <latest> resource of the created container resource linked with the locationPolicy resource mcaPort.send(m_request(valueof(m_retrieveResource(f_getResourceAddress(v_locContainerResourceIndex) & "/" & "latest", f_getOriginator(v_locContainerResourceIndex))))); tc_ac.start; alt{ [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response{ tc_ac.stop; if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.notification.notificationEvent)){ setverdict(fail, __SCOPE__ & "No NotificationEvent is included in the response!"); }else{ setverdict(pass, __SCOPE__ & "Location information is successfully sent!"); } } [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response{ tc_ac.stop; setverdict(fail, __SCOPE__ & "Requested container resource is not found!"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource!"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource!"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end testcase TC_CSE_LOC_BV_009_01 testcase TC_CSE_LOC_BV_009_02() runs on AeSimu system CseSystem{ //TO NOTIFY a location information var integer v_aeAuxIndex := -1; var integer v_locPolicyResourceIndex := -1; var integer v_locContainerResourceIndex := -1; var integer v_subscriptionResourceIndex := -1; var LocationSource v_locationSource := int2;//Device-based var XSD.Duration locationUpdatePeriod := PX_LOCATION_UPDATE_PERIOD; var RequestPrimitive v_locpolicy_request_preamble; var RequestPrimitive v_container_request_preamble; var RequestPrimitive v_subscription_request_preamble; var MsgIn v_response; //Test component configuration f_cf01Up(); //Preamble - register AE v_aeAuxIndex := f_cse_preamble_registerAe(); //Preamble - create a valid locationPolicy resource v_locpolicy_request_preamble := valueof(m_createLocationPolicy(v_locationSource, omit, locationUpdatePeriod, omit, omit)); v_container_request_preamble := valueof(m_createContainer(f_getResourceAddress(v_aeAuxIndex), omit));//no location-container name provided? v_locPolicyResourceIndex := f_cse_createResource(int10, v_locpolicy_request_preamble, v_aeAuxIndex);//created locationpolicy index v_locContainerResourceIndex := f_cse_createResource(int3, v_container_request_preamble, v_locPolicyResourceIndex);//created container index v_subscription_request_preamble := valueof(m_createSubscription(f_getResourceAddress(v_locContainerResourceIndex), c_defaultResourceName, -)); v_subscriptionResourceIndex := f_cse_createResource(int23, v_subscription_request_preamble, v_locContainerResourceIndex); //Test Body - retrieve the <latest> resource of the created container resource linked with the locationPolicy resource mcaPort.send(m_request(valueof(m_retrieveResource(f_getResourceAddress(v_locContainerResourceIndex) & "/" & "latest", f_getOriginator(v_locContainerResourceIndex))))); tc_ac.start; alt{ [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response{ tc_ac.stop; if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.notification.notificationEvent)){ setverdict(fail, __SCOPE__ & "No NotificationEvent is included in the response!"); }else{ setverdict(pass, __SCOPE__ & "Location information is successfully sent!"); } } [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response{ tc_ac.stop; setverdict(fail, __SCOPE__ & "Requested container resource is not found!"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource!"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource!"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end testcase TC_CSE_LOC_BV_009_02 testcase TC_CSE_LOC_BV_009_03() runs on AeSimu system CseSystem{ //TO NOTIFY a location information var integer v_aeAuxIndex := -1; var integer v_locPolicyResourceIndex := -1; var integer v_locContainerResourceIndex := -1; var integer v_subscriptionResourceIndex := -1; var LocationSource v_locationSource := int3;//Sharing-based var RequestPrimitive v_locpolicy_request_preamble; var RequestPrimitive v_container_request_preamble; var RequestPrimitive v_subscription_request_preamble; var MsgIn v_response; //Test component configuration f_cf01Up(); //Preamble - register AE v_aeAuxIndex := f_cse_preamble_registerAe(); //Preamble - create a valid locationPolicy resource v_locpolicy_request_preamble := valueof(m_createLocationPolicy(v_locationSource, omit, omit, omit, omit)); v_container_request_preamble := valueof(m_createContainer(f_getResourceAddress(v_aeAuxIndex), omit));//no location-container name provided? v_locPolicyResourceIndex := f_cse_createResource(int10, v_locpolicy_request_preamble, v_aeAuxIndex);//created locationpolicy index v_locContainerResourceIndex := f_cse_createResource(int3, v_container_request_preamble, v_locPolicyResourceIndex);//created container index v_subscription_request_preamble := valueof(m_createSubscription(f_getResourceAddress(v_locContainerResourceIndex), c_defaultResourceName, -)); v_subscriptionResourceIndex := f_cse_createResource(int23, v_subscription_request_preamble, v_locContainerResourceIndex); //Test Body - retrieve the <latest> resource of the created container resource linked with the locationPolicy resource mcaPort.send(m_request(valueof(m_retrieveResource(f_getResourceAddress(v_locContainerResourceIndex) & "/" & "latest", f_getOriginator(v_locContainerResourceIndex))))); tc_ac.start; alt{ [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response{ tc_ac.stop; if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.notification.notificationEvent)){ setverdict(fail, __SCOPE__ & "No NotificationEvent is included in the response!"); }else{ setverdict(pass, __SCOPE__ & "Location information is successfully sent!"); } } [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response{ tc_ac.stop; setverdict(fail, __SCOPE__ & "Requested container resource is not found!"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource!"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource!"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end testcase TC_CSE_LOC_BV_009_03 }//end group g_CSE_LOC_BV_009 /*group g_CSE_LOC_BV_007 { testcase TC_CSE_LOC_BV_007() runs on AeSimu system CseSystem{ //TODO }//end testcase TC_CSE_LOC_BV_007 }//end group g_CSE_LOC_BV_007 group g_CSE_LOC_BV_008 { testcase TC_CSE_LOC_BV_008() runs on AeSimu system CseSystem{ //TODO }//end testcase TC_CSE_LOC_BV_008 }//end group g_CSE_LOC_BV_008 */ group g_CSE_LOC_BV_012 { testcase TC_CSE_LOC_BV_012() runs on AeSimu system CseSystem{ //To CREATE a <subscription> resource as a child resource of the created <container> var integer v_aeAuxIndex := -1; var integer v_locPolicyResourceIndex := -1; var integer v_locContainerResourceIndex := -1; var LocationSource v_locationSource := int1;//Netwok-based var XSD.Duration locationUpdatePeriod := PX_LOCATION_UPDATE_PERIOD; var XSD.Token locationTargetID := PX_LOCATION_TARGET_ID; var XSD.AnyURI locationServerAddress := PX_LOCATION_SERVER_ADDRESS; var RequestPrimitive v_locpolicy_request_preamble; var RequestPrimitive v_container_request_preamble; var RequestPrimitive v_subscription_request_preamble; var MsgIn v_response; //Test component configuration f_cf01Up(); //Preamble - register AE v_aeAuxIndex := f_cse_preamble_registerAe(); //Preamble - create a valid locationPolicy resource v_locpolicy_request_preamble := valueof(m_createLocationPolicy(v_locationSource, omit, locationUpdatePeriod, locationTargetID, locationServerAddress)); v_container_request_preamble := valueof(m_createContainer(f_getResourceAddress(v_aeAuxIndex), omit));//no location-container name provided? v_locPolicyResourceIndex := f_cse_createResource(int10, v_locpolicy_request_preamble, v_aeAuxIndex);//created locationpolicy index v_locContainerResourceIndex := f_cse_createResource(int3, v_container_request_preamble, v_locPolicyResourceIndex);//created container index v_subscription_request_preamble := valueof(m_createSubscription(f_getResourceAddress(v_locContainerResourceIndex), c_defaultResourceName, -)); //Test Body mcaPort.send(m_request(valueof(f_getCreateRequestPrimitive(int23, v_subscription_request_preamble, v_locContainerResourceIndex)))); tc_ac.start; alt{ [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response{ tc_ac.stop; setverdict(pass, __SCOPE__ & "Subscription resource is successfully!"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response{ tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response{ tc_ac.stop; setverdict(fail, __SCOPE__ & "Requested container resource is not found!"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating subscription resource!"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end testcase TC_CSE_LOC_BV_012 }//end group g_CSE_LOC_BV_012 group g_CSE_LOC_BV_013 { testcase TC_CSE_LOC_BV_013() runs on AeSimu system CseSystem{ //TO RETRIEVE a <locationPolicy> resource that has created in cse var integer v_aeAuxIndex := -1; var integer v_locPolicyResourceIndex := -1; var RequestPrimitive v_locpolicy_request_preamble; var MsgIn v_response; var LocationSource v_locationSource := int1;//Netwok-based var XSD.Duration locationUpdatePeriod := PX_LOCATION_UPDATE_PERIOD; var XSD.Token locationTargetID := PX_LOCATION_TARGET_ID; var XSD.AnyURI locationServerAddress := PX_LOCATION_SERVER_ADDRESS; //Test component configuration f_cf01Up(); //Preamble - register AE v_aeAuxIndex := f_cse_preamble_registerAe(); //Preamble - create a valid locationPolicy resource for later container resource creation v_locpolicy_request_preamble := valueof(m_createLocationPolicy(v_locationSource, omit, locationUpdatePeriod, locationTargetID, locationServerAddress)); v_locPolicyResourceIndex := f_cse_createResource(int10, v_locpolicy_request_preamble, v_aeAuxIndex);//created locationpolicy index //Test Body - retrieve the created locationpolicy resource mcaPort.send(m_request(valueof(m_retrieveResource(f_getResourceAddress(v_locPolicyResourceIndex), f_getOriginator(v_locPolicyResourceIndex))))); tc_ac.start; alt{ [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response{ tc_ac.stop; if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.locationPolicy.locationContainerID)){ setverdict(fail, __SCOPE__ & "No locationContainerID is included in the response!"); }else{ setverdict(pass, __SCOPE__ & "LocationPolicy resource is successfully retrieved with locationContainerID included in the response!"); } } [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response{ tc_ac.stop; setverdict(fail, __SCOPE__ & "Requested locationPolicy is not found!"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource!"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource!"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); }//end testcase TC_CSE_LOC_BV_013 }//end group g_CSE_LOC_BV_013 }//end group Location group Group_Managment { group Create { /** * @desc Check that the IUT rejects the creation of the group resource when member ID exceed max number of members. * */ testcase TC_CSE_GMG_CRE_001() runs on AeSimu system CseSystem { // Local constants const XSD.NonNegativeInteger c_maxNrOfMembers := 1; // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_containerIndex_1, v_containerIndex_2 := -1; var RequestPrimitive v_request; var ListOfURIs v_memberIDs; var template RequestPrimitive v_createRequest; var template RequestPrimitive v_createContainerRequest_1 := m_createContainer_noResourceName; var template RequestPrimitive v_createContainerRequest_2 := m_createContainer_noResourceName; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); v_containerIndex_1 := f_cse_createResource(int3, v_createContainerRequest_1, v_aeIndex); // AE child resource v_containerIndex_2 := f_cse_createResource(int3, v_createContainerRequest_2, v_aeIndex); // AE child resource v_memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource), f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)}; v_createRequest := valueof(m_createGroup(c_maxNrOfMembers, v_memberIDs, omit, int3)); // Test Body v_request := f_getCreateRequestPrimitive(int9, v_createRequest, v_aeIndex); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int6010))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Creation failed because member ID exceed max number of member"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error resource created while member ID exceed max number of member"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } } f_checkAeSimuStatus(); //Check to see if the resource is NOT present if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } /** * @desc Check that the IUT rejects the creation of the group resource when the memberType cannot be retrieved due to lack of privilege. * */ testcase TC_CSE_GMG_CRE_002() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_containerIndex := -1; var integer v_acpIndex := -1; var RequestPrimitive v_request; var template RequestPrimitive v_containerCreateRequest := m_createContainerBase; var template RequestPrimitive v_createRequest; var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, int61); //c_CUDNDi // Test control if(not(PICS_ACP_SUPPORT)) { setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); stop; } // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi v_acpIndex := f_cse_createResource(int1, v_createAcp, v_aeIndex); // AE child resource v_containerCreateRequest.primitiveContent.container.accessControlPolicyIDs := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; v_containerIndex := f_cse_createResource(int3, v_containerCreateRequest, v_aeIndex); // AE child resource v_createRequest := m_createGroup(1, {f_getResourceId(vc_resourcesList[v_containerIndex].resource)}, omit, int3); v_request := f_getCreateRequestPrimitive(int9, v_createRequest, v_aeIndex); // creating group // Test Body mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int5105))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": creation failed due to lack of privilege"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error creation successful while doesn't have privileges for retrieving resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } f_checkAeSimuStatus(); //Check to see if the resource is NOT present if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } /** * @desc Check that the IUT detects the presence of duplicate member IDs during the creation of the <group> resource and removes the duplicate member IDs prior to creation of the <group> resource. * */ testcase TC_CSE_GMG_CRE_003() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_containerIndex := -1; var RequestPrimitive v_createRequest; var XSD.AnyURI v_memberID; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi. v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); // AE child resource v_memberID := f_getResourceId(vc_resourcesList[v_containerIndex].resource); v_createRequest := valueof(m_createGroup(2, {v_memberID, v_memberID}, omit, int3)); v_createRequest := f_getCreateRequestPrimitive(int9, v_createRequest, v_aeIndex); // Test Body mcaPort.send(m_request(v_createRequest)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Resource created successfully"); if(not match({v_memberID}, v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs)){ setverdict(fail, __SCOPE__, ": Error, presence of duplicate member IDs "); } if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs) != 1) { setverdict(fail, __SCOPE__ & ": Error, wrong number of memberIDs attribute"); } } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while creating resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } /** * @desc Check that the IUT validates the resource type during the creation of the <group> resource when memberType attribute is not ‘mixed’. */ testcase TC_CSE_GMG_CRE_004() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var RequestPrimitive v_createRequest; var integer v_aeIndex := -1; var integer v_containerIndex := -1; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); // AE child resource v_createRequest := valueof(m_createGroup(2, {f_getResourceId(vc_resourcesList[v_containerIndex].resource)}, omit, int3)); //Member type is set to Container v_createRequest := f_getCreateRequestPrimitive(int9, v_createRequest, v_aeIndex); // Test Body mcaPort.send(m_request(v_createRequest)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Resource created successfully"); if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated)){ setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not provided"); } else { if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated == false){ setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not correct"); } } } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while creating resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource" ); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } /** * @desc Check that the IUT handles unsuccessful validation of the resource type during the creation of the <group> resource when memberType attribute is not ‘mixed’ and the consistencyStrategy attribute is SET_MIXED. * */ testcase TC_CSE_GMG_CRE_005() runs on AeSimu system CseSystem { //Local variables var MsgIn v_response; var RequestPrimitive v_createRequest; var integer v_aeIndex := -1; var integer v_containerIndex := -1; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); // AE child resource v_createRequest := valueof(m_createGroup(2, {f_getResourceId(vc_resourcesList[v_containerIndex].resource)}, omit, int2, int3)); //Member type is set to AE and consistencyStrategy is set to MIXED v_createRequest := f_getCreateRequestPrimitive(int9, v_createRequest, v_aeIndex); // Test Body mcaPort.send(m_request(v_createRequest)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Resource created successfully"); // check for memberTypeValidated if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated)){ setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not provided"); } else { if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated == false){ setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not correct"); } } // check for memberType (MIXED) if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.group_.memberType)){ setverdict(fail, __SCOPE__, ": Error, memberType attribute not provided"); } else { if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberType != int0){ setverdict(fail, __SCOPE__, ": Error, memberType attribute not correct"); } } } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while creating resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } /** * @desc Check that the IUT handles unsuccessful validation of the resource type during the creation of the <group> resource when memberType attribute is not ‘mixed’ and the consistencyStrategy attribute is ABANDON_MEMBER,. * */ testcase TC_CSE_GMG_CRE_006() runs on AeSimu system CseSystem { //Local variables var MsgIn v_response; var RequestPrimitive v_createRequest; var integer v_aeIndex := -1; var integer v_containerIndex := -1; var integer v_groupIndex := -1; var ListOfURIs v_memberIDs; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi v_containerIndex := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer"), v_aeIndex); v_groupIndex := f_cse_createResource(int9, m_createGroupBase, v_aeIndex); v_memberIDs := {f_getResourceId(vc_resourcesList[v_groupIndex].resource), f_getResourceId(vc_resourcesList[v_containerIndex].resource)}; v_createRequest := valueof(m_createGroup(2, v_memberIDs, omit, int3, -, -, -)); //Member type is set to container and consistencyStrategy is set to ABANDON MEMBER (default value) v_createRequest := f_getCreateRequestPrimitive(int9, v_createRequest, v_aeIndex); // Test Body mcaPort.send(m_request(v_createRequest)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Resource created successfully"); // check for memberTypeValidated if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated)){ setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not provided"); } else { if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated == false){ setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not correct"); } } // check for membersId if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs)){ setverdict(fail, __SCOPE__, ": Error, memberIDs attribute not provided"); } else { if(not match({f_getResourceId(vc_resourcesList[v_containerIndex].resource)}, v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs)){ setverdict(fail, __SCOPE__, ": Error, memberIDs attribute not correct"); } } } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while creating resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } /** * @desc Check that the IUT handles unsuccessful validation of the resource type during the creation of the group resource when memberType attribute is not ‘mixed’ and the consistencyStrategy attribute is ABANDON_GROUP. * */ testcase TC_CSE_GMG_CRE_007() runs on AeSimu system CseSystem { //Local variables var MsgIn v_response; var RequestPrimitive v_createRequest; var integer v_aeIndex := -1; var integer v_containerIndex := -1; var integer v_groupIndex := -1; var ListOfURIs v_memberIDs; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi v_containerIndex := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer"), v_aeIndex); v_groupIndex := f_cse_createResource(int9, m_createGroupBase, v_aeIndex); v_memberIDs := {f_getResourceId(vc_resourcesList[v_groupIndex].resource), f_getResourceId(vc_resourcesList[v_containerIndex].resource)}; v_createRequest := valueof(m_createGroup(2, v_memberIDs, omit, int3, int2, -, -)); //Member type is set to container and consistencyStrategy is set to ABANDON GROUP v_createRequest := f_getCreateRequestPrimitive(int9, v_createRequest, v_aeIndex); // Test Body mcaPort.send(m_request(v_createRequest)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4110))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": unsuccessful validation of the resource type during the creation of the group"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error create succesfull while the operation should be aborted"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } } // end group Create group Retrieve { /** * @desc Check that the IUT generates a request primitive for each resource in memberIDs with a relative address appended to fanOutPoint that includes a virtual resource. * */ testcase TC_CSE_GMG_RET_001() runs on AeSimu system CseSystem { //Local constants const integer c_numberOfResponsePrimitive := 2; // Local variables var MsgIn v_response; var integer v_aeIndex_1, v_acpIndex, v_containerIndex_1, v_containerIndex_2, v_groupIndex, v_contentInstanceIndex_1, v_contentInstanceIndex_2 := -1; var integer i; var ListOfURIs v_memberIDs; var ListOfURIs v_membersAcpIds; var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, -); var template PrimitiveContent v_contentResponse; var XSD.AnyURI v_fanoutPointAddress; var RequestPrimitive v_containerRequestPrimitive := valueof(m_createContainer_noResourceName); v_contentResponse.contentInstance := mw_contentContentInstanceBase; // Test control if(not(PICS_ACP_SUPPORT)) { setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); stop; } // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex_1 := f_cse_preamble_registerAe(-, -); //c_CRUDNDi v_acpIndex := f_cse_createResource(int1, v_createAcp, -1); // AE child resource v_containerRequestPrimitive := f_setAcpId(v_containerRequestPrimitive, {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}); v_containerIndex_1 := f_cse_createResource(int3, v_containerRequestPrimitive, v_aeIndex_1); // AE1 child resource v_containerIndex_2 := f_cse_createResource(int3, v_containerRequestPrimitive, v_aeIndex_1); // AE2 child resource v_contentInstanceIndex_1 := f_cse_createResource(int4, m_createContentInstanceBase, v_containerIndex_1); // Container_1 child resource v_contentInstanceIndex_2 := f_cse_createResource(int4, m_createContentInstanceBase, v_containerIndex_2); // Container_2 child resource v_memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource), f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)}; v_membersAcpIds := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int3, -, v_membersAcpIds), -1); v_fanoutPointAddress := f_getResourceAddress(v_groupIndex) & "/" & c_resourceShortNameFanOutPoint & "/" & c_resourceShortNameLatest; // Test Body mcaPort.send(m_request(m_retrieveResource(v_fanoutPointAddress, f_getOriginator(v_aeIndex_1)))); //TODO see if it is correct or if we have to use PX_SUPER_ADMIN tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": creation successfull by using fanOutPoint in group resource"); if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list)){ setverdict(fail, __SCOPE__, ": Error, aggregatedResponse attribute not provided"); } else{ if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list) != c_numberOfResponsePrimitive){ setverdict(fail, __SCOPE__, ": Error, length of aggregatedResponse is not valid"); } else{ for(i:=0; i<c_numberOfResponsePrimitive; i:=i+1){ if(not match(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list[i].primitiveContent, v_contentResponse)){ setverdict(fail, __SCOPE__, ": Error, aggregatedResponse doesn't match with template expected"); } } } } } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while creating resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } // end TC_CSE_GMG_RET_001 } // end group Retrieve group Update { /** * @desc Check that the IUT rejects the update of the group resource when the memberType cannot be retrieved due to lack of privilege. * */ testcase TC_CSE_GMG_UPD_001() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_containerIndex_1 := -1; var integer v_containerIndex_2 := -1; var integer v_acpIndex := -1; var integer v_groupIndex := -1; var RequestPrimitive v_request; var template RequestPrimitive v_containerCreateRequest := m_createContainer_noResourceName; var template RequestPrimitive v_updateRequest := m_updateGroupBase; var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyAcp", -, int61); //c_CUDNDi // Test control if(not(PICS_ACP_SUPPORT)) { setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); stop; } // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi v_acpIndex := f_cse_createResource(int1, v_createAcp, v_aeIndex); // AE child resource v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource v_groupIndex := f_cse_createResource(int9, m_createGroup(2, {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource)}, omit, int3, -, - , -), v_aeIndex); v_containerCreateRequest := f_setAcpId(v_containerCreateRequest, {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}); v_containerIndex_2 := f_cse_createResource(int3, v_containerCreateRequest, v_aeIndex); // AE child resource v_updateRequest.primitiveContent.group_.memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)}; v_request := f_getUpdateRequestPrimitive(int9, v_groupIndex, v_updateRequest); // creating group // Test Body mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int5105))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Update failed due to lack of privilege"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error update successful while doesn't have privileges for retrieving resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while updating resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } /** * @desc Check that the IUT detects the presence of duplicate member IDs during an update of the <group> resource and removes the duplicate member IDs prior to updating the <group> resource. * */ testcase TC_CSE_GMG_UPD_002() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_containerIndex_1 := -1; var integer v_containerIndex_2 := -1; var integer v_groupIndex := -1; var RequestPrimitive v_updateRequest := valueof(m_updateGroupBase); var XSD.AnyURI v_memberId_1; var XSD.AnyURI v_memberId_2; var PrimitiveContent v_primitiveContentRetrievedResource; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource v_memberId_1 := f_getResourceId(vc_resourcesList[v_containerIndex_1].resource); v_memberId_2 := f_getResourceId(vc_resourcesList[v_containerIndex_2].resource); v_groupIndex := f_cse_createResource(int9, m_createGroup(2, {v_memberId_1, v_memberId_2}, omit, int3, -, -, -), v_aeIndex); // AE child resource v_updateRequest.primitiveContent.group_.memberIDs := {v_memberId_2, v_memberId_2}; v_updateRequest := f_getUpdateRequestPrimitive(int9, v_groupIndex, v_updateRequest); //Test Body mcaPort.send(m_request(v_updateRequest)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": update successful"); // check for membersId if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs)){ setverdict(fail, __SCOPE__, ": Error, memberIDs attribute not provided"); } else { if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs) != 1) { setverdict(fail, __SCOPE__ & ": Error, wrong number of memberIDs attribute"); } if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs[0] != v_memberId_2){ setverdict(fail, __SCOPE__, ": Error, memberIDs attribute not correct"); } } } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while updating resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while updating resource"); } } v_primitiveContentRetrievedResource := f_cse_retrieveResource(v_groupIndex); if(getverdict == pass){ if(ischosen(v_primitiveContentRetrievedResource.group_)){ if(v_primitiveContentRetrievedResource.group_.memberIDs[0] != v_memberId_2){ setverdict(fail, __SCOPE__, ": Error, memberIDs attribute not updated"); } } } //Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } /** * @desc Check that the IUT validates the resource type during an UPDATE of the <group> resource when memberType attribute is not ‘mixed’. * */ testcase TC_CSE_GMG_UPD_003() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_containerIndex_1 := -1; var integer v_containerIndex_2 := -1; var integer v_groupIndex := -1; var RequestPrimitive v_updateRequest := valueof(m_updateGroupBase); var PrimitiveContent v_primitiveContentRetrievedResource; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource v_groupIndex := f_cse_createResource(int9, m_createGroup(2, {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource)}, omit, int3, -, -, -), v_aeIndex); v_updateRequest.primitiveContent.group_.memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)}; v_updateRequest := f_getUpdateRequestPrimitive(int9, v_groupIndex, v_updateRequest); // Test Body mcaPort.send(m_request(v_updateRequest));// TODO see if the memberTypeValidated is present in the update response tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": update successful"); if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated)) { setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not provided"); } else { if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated == false) { setverdict(fail, __SCOPE__, ": Error, memberTypeValidated wrong value"); } } } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while updating resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while updating resource"); } } v_primitiveContentRetrievedResource := f_cse_retrieveResource(v_groupIndex); if(getverdict == pass){ if(ischosen(v_primitiveContentRetrievedResource.group_)){ if(v_primitiveContentRetrievedResource.group_.memberTypeValidated == false){ setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not updated"); } } } //Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } /** * @desc Check that the IUT handles unsuccessful validation of the resource type during an UPDATE of the <group> resource when memberType attribute is not ‘mixed’ and the consistencyStrategy attribute is SET_MIXED. * */ testcase TC_CSE_GMG_UPD_004() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var RequestPrimitive v_updateRequest := valueof(m_updateGroupBase); var integer v_aeIndex := -1; var integer v_containerIndex := -1; var integer v_groupIndex := -1; var integer v_subGroupIndex := -1; var XSD.AnyURI v_memberId_1; var XSD.AnyURI v_memberId_2; var PrimitiveContent v_primitiveContentRetrievedResource; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); v_subGroupIndex := f_cse_createResource(int9, m_createGroupBase, v_aeIndex); v_memberId_1 := f_getResourceId(vc_resourcesList[v_containerIndex].resource); v_memberId_2 := f_getResourceId(vc_resourcesList[v_subGroupIndex].resource); v_groupIndex := f_cse_createResource(int9, m_createGroup(2, {v_memberId_1}, omit, int3, int3, -, -), v_aeIndex); //Member type is set to Container (int3) and consistencyStrategy is set to MIXED (int3) v_updateRequest.primitiveContent.group_.memberIDs := {v_memberId_1, v_memberId_2}; v_updateRequest := f_getUpdateRequestPrimitive(int9, v_groupIndex, v_updateRequest); // Test Body mcaPort.send(m_request(v_updateRequest));// TODO see if the memberTypeValidated is present in the update response tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": update successful"); //memberTypeValidated attribute set to FALSE if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated)) { setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not provided"); } else { if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated != true) { setverdict(fail, __SCOPE__, ": Error, memberTypeValidated must be TRUE"); } } //memberType attribute set to MIXED if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.group_.memberType)) { setverdict(fail, __SCOPE__, ": Error, memberType attribute not provided"); } else { if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberType != int0) { //Mixed is int0 in release 2 and int24 in release 1 setverdict(fail, __SCOPE__, ": Error, memberType was not set to MIXED"); } } } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } v_primitiveContentRetrievedResource := f_cse_retrieveResource(v_groupIndex); if(getverdict == pass){ if(ischosen(v_primitiveContentRetrievedResource.group_)){ if(v_primitiveContentRetrievedResource.group_.memberTypeValidated == false){ setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not updated"); } if(v_primitiveContentRetrievedResource.group_.memberType != int0){ setverdict(fail, __SCOPE__, ": Error, memberType attribute not set to MIXED"); } } } //Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } /** * @desc Check that the IUT handles unsuccessful validation of the resource type during an UPDATE of the group resource when memberType attribute is not ‘mixed’ and the consistencyStrategy attribute is ABANDON_MEMBER. * */ testcase TC_CSE_GMG_UPD_005() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var RequestPrimitive v_updateRequest := valueof(m_updateGroupBase); var integer v_aeIndex := -1; var integer v_containerIndex := -1; var integer v_groupIndex := -1; var integer v_subGroupIndex := -1; var XSD.AnyURI v_memberId_1; var XSD.AnyURI v_memberId_2; var PrimitiveContent v_primitiveContentRetrievedResource; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); v_subGroupIndex := f_cse_createResource(int9, m_createGroupBase, v_aeIndex); v_memberId_1 := f_getResourceId(vc_resourcesList[v_containerIndex].resource); v_memberId_2 := f_getResourceId(vc_resourcesList[v_subGroupIndex].resource); v_groupIndex := f_cse_createResource(int9, m_createGroup(2, {v_memberId_1}, omit, int3, omit), v_aeIndex); //Member type is set to Container (int3) and consistencyStrategy is set to ABANDON MEMBER (default value) v_updateRequest.primitiveContent.group_.memberIDs := {v_memberId_2, v_memberId_1}; v_updateRequest := f_getUpdateRequestPrimitive(int9, v_groupIndex, v_updateRequest); //Test Body mcaPort.send(m_request(v_updateRequest)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": update successful"); //memberTypeValidated attribute set to TRUE if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated)) { setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not provided"); } else { if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated != true) { setverdict(fail, __SCOPE__, ": Error, memberTypeValidated must be TRUE"); } } //memberIDs attribute set to v_memberID1 if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs)){ setverdict(fail, __SCOPE__, ": Error, memberIDs attribute not provided"); } else { if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs) != 1) { setverdict(fail, __SCOPE__ & ": Error, wrong number of memberIDs attribute"); } if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs[0] != v_memberId_1){ setverdict(fail, __SCOPE__, ": Error, memberIDs attribute not correct"); } } } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while updating resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while updating resource"); } } v_primitiveContentRetrievedResource := f_cse_retrieveResource(v_groupIndex); if(getverdict == pass){ if(ischosen(v_primitiveContentRetrievedResource.group_)){ if(v_primitiveContentRetrievedResource.group_.memberTypeValidated == false){ setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not updated"); } if(v_primitiveContentRetrievedResource.group_.memberIDs[0] != v_memberId_1){ setverdict(fail, __SCOPE__, ": Error, memberIDs attribute not correct"); } } } //Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } /** * @desc Check that the IUT handles unsuccessful validation of the resource type during the creation of the group resource when memberType attribute is not ‘mixed’ and the consistencyStrategy attribute is ABANDON_GROUP. * */ testcase TC_CSE_GMG_UPD_006() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var RequestPrimitive v_updateRequest := valueof(m_updateGroupBase); var integer v_aeIndex := -1; var integer v_containerIndex := -1; var integer v_groupIndex := -1; var integer v_subGroupIndex := -1; var XSD.AnyURI v_memberId_1; var XSD.AnyURI v_memberId_2; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); v_subGroupIndex := f_cse_createResource(int9, m_createGroupBase, v_aeIndex); v_memberId_1 := f_getResourceId(vc_resourcesList[v_containerIndex].resource); v_memberId_2 := f_getResourceId(vc_resourcesList[v_subGroupIndex].resource); v_groupIndex := f_cse_createResource(int9, m_createGroup(2, {v_memberId_1}, omit, int3, int2), v_aeIndex); //Member type is set to Container(int3) and consistencyStrategy is set to ABANDON GROUP (default value) v_updateRequest.primitiveContent.group_.memberIDs := {v_memberId_2, v_memberId_1}; v_updateRequest := f_getUpdateRequestPrimitive(int9, v_groupIndex, v_updateRequest); //Test Body mcaPort.send(m_request(v_updateRequest)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4110))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": unsuccessful validation of the resource type during the creation of the group"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error create succesfull while the operation should be aborted"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } } //Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } /** * @desc Check that the IUT detects when the number of memberIDs exceeds the limitation of maxNrOfMembers. * */ testcase TC_CSE_GMG_UPD_007() runs on AeSimu system CseSystem { //Local constants const integer c_maxNrOfMembers := 2; // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_groupIndex, v_containerIndex_1, v_containerIndex_2, v_containerIndex_3 := -1; var ListOfURIs v_memberIDs; var template RequestPrimitive v_createRequest; var PrimitiveContent v_primitiveContentRetrievedResource; var template RequestPrimitive v_updateRequest := m_updateGroupBase; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource v_containerIndex_3 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource v_memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource), f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)}; v_createRequest := valueof(m_createGroup(c_maxNrOfMembers, v_memberIDs, omit, int3)); v_groupIndex := f_cse_createResource(int9, v_createRequest, v_aeIndex); //Test Body v_request := f_getUpdateRequestPrimitive(int9, v_groupIndex, v_updateRequest); v_memberIDs := v_memberIDs & {f_getResourceId(vc_resourcesList[v_containerIndex_3].resource)}; v_request.primitiveContent.group_.memberIDs := v_memberIDs; mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int6010))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": operation is not allowed"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error update successful while maxNrOfMembers has exceeded"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } v_primitiveContentRetrievedResource := f_cse_retrieveResource(v_groupIndex); if(getverdict == pass){ //Check that the resource has NOT been udpated if(ischosen(v_primitiveContentRetrievedResource.group_)) { if(v_primitiveContentRetrievedResource.group_.memberIDs == v_memberIDs){ setverdict(fail, __SCOPE__ & ": Error: MemberIDs attribute updated") } } } //Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } /** * @desc Check that the IUT detects when the value provided for maxNrOfMembers attribute is less than the value of the currentNrOfMembers attribute. * */ testcase TC_CSE_GMG_UPD_008() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var RequestPrimitive v_updateRequest := valueof(m_updateGroupBase); var integer v_aeIndex := -1; var integer v_containerIndex_1 := -1; var integer v_containerIndex_2 := -1; var integer v_groupIndex := -1; var ListOfURIs v_memberIDs; var XSD.PositiveInteger v_maxNrOfMembers:= 1; var PrimitiveContent v_primitiveContentRetrievedResource; v_updateRequest.primitiveContent.group_.maxNrOfMembers := v_maxNrOfMembers; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource v_memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource), f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)}; v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int3), v_aeIndex); v_updateRequest := f_getUpdateRequestPrimitive(int9, v_groupIndex, v_updateRequest); //Test Body mcaPort.send(m_request(v_updateRequest)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int6010))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": max number of member exceeded"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error update successful while operation is not allowed"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while updating resource"); } } v_primitiveContentRetrievedResource := f_cse_retrieveResource(v_groupIndex); if(getverdict == pass){ //Check that the resource has NOT been udpated if(ischosen(v_primitiveContentRetrievedResource.group_)) { if(v_primitiveContentRetrievedResource.group_.maxNrOfMembers == v_maxNrOfMembers){ setverdict(fail, __SCOPE__ & ": Error: maxNrOfMembers attribute updated") } } } //Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } /** * @desc Check that the IUT handles validation of the resource type during an UPDATE of the <group> resource when memberIDs contains a sub-group on a temporarily unreachable Hosting CSE. * */ testcase TC_CSE_GMG_UPD_009() runs on AeSimu system CseSystem { //Local constants const integer c_maxNrOfMembers := 2; const ResourceType c_ResourceTypeGroup := int9; // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_groupIndex := -1; var integer v_containerIndex_1 := -1; var integer v_containerIndex_2 := -1; var XSD.AnyURI v_memberId_1; var XSD.AnyURI v_memberId_2; var template RequestPrimitive v_createRequest := m_createGroupBase; var template RequestPrimitive v_updateRequest := m_updateGroupBase; var PrimitiveContent v_primitiveContentRetrievedResource; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi //TODO: -> register IUT to the remoteCSE //TODO: Create one of the container in a remoteCSE v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource v_memberId_1 := f_getResourceId(vc_resourcesList[v_containerIndex_1].resource); v_memberId_2 := f_getResourceId(vc_resourcesList[v_containerIndex_2].resource); v_createRequest := valueof(m_createGroup(c_maxNrOfMembers, {v_memberId_1}, omit, int3)); v_groupIndex := f_cse_createResource(c_ResourceTypeGroup, v_createRequest, v_aeIndex); //Test Body v_updateRequest.primitiveContent.group_.memberIDs := {v_memberId_1, v_memberId_2}; v_request := f_getUpdateRequestPrimitive(c_ResourceTypeGroup, v_groupIndex, v_updateRequest); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { tc_ac.stop; if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated)) { setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not provided"); } else { if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated == false) { if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs) != 2) { setverdict(fail, __SCOPE__ & ": Error, wrong number of memberIDs attribute"); } else { if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs[0] == v_memberId_1 and v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs[1] == v_memberId_2) { setverdict(pass, __SCOPE__ & ": update successful"); } else { setverdict(fail, __SCOPE__, ": Error, wrong memberIDs"); } } } else { setverdict(fail, __SCOPE__, ": Error, memberTypeValidated must be set to FALSE"); } } } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } v_primitiveContentRetrievedResource := f_cse_retrieveResource(v_groupIndex); if(getverdict == pass){ if(ischosen(v_primitiveContentRetrievedResource.group_)){ if(v_primitiveContentRetrievedResource.group_.memberTypeValidated != false){ setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not updated"); } if((v_primitiveContentRetrievedResource.group_.memberIDs[0] != v_memberId_1) and (v_primitiveContentRetrievedResource.group_.memberIDs[1] != v_memberId_2)){ setverdict(fail, __SCOPE__, ": Error, memberIDs attribute not correct"); } } } //Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } /** * @desc Check that the IUT handles validation of the resource type during an UPDATE of the group resource when memberIDs contains a sub-group on a a previously unreachable Hosting CSE that has become reachable * @verdict */ testcase TC_CSE_GMG_UPD_010() runs on AeSimu system CseSystem { //Local constants const ResourceType c_ResourceTypeGroup := int9; const integer c_maxNrOfMembers := 2; // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_remoteCSEIndex := -1; var integer v_groupIndex := -1; var integer v_containerIndex_1 := -1; var integer v_containerIndex_2 := -1; var integer v_subscriptionIndex := -1; var template RequestPrimitive v_createRequest := m_createGroupBase; var template RequestPrimitive v_updateRequest := m_updateGroupBase; var XSD.AnyURI v_memberId_1; var XSD.AnyURI v_memberId_2; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi //TODO: -> register IUT to the remoteCSE v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource v_memberId_1 := f_getResourceId(vc_resourcesList[v_containerIndex_1].resource); v_memberId_2 := f_getResourceId(vc_resourcesList[v_containerIndex_2].resource); v_createRequest := valueof(m_createGroup(c_maxNrOfMembers, {v_memberId_1, v_memberId_2}, omit, int3)); v_groupIndex := f_cse_createResource(c_ResourceTypeGroup, v_createRequest, v_aeIndex); v_subscriptionIndex := f_cse_createResource(int23,m_createSubscriptionBase, v_groupIndex); vc_ae2.start(f_cse_notifyProcedure_subscriptionVerificationHandler()); //Test Body v_request := f_getUpdateRequestPrimitive(c_ResourceTypeGroup, v_groupIndex, v_updateRequest); //v_request.from_ := CSE-ID v_request.to_ := f_getResourceAddress(v_remoteCSEIndex); //Content set to <remoteCSE> resource containing onlineStatus := false; mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": update successful"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } //Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } } // end group Update group Basic_Operations { group g_CSE_GMG_001 { /** * @desc Check that the IUT allows a <group>/fanoutPoint OPERATION when the Originator has OPERATION_PERMISSION specified in membersAccessControlPolicyIDs attribute in the group resource. * */ testcase TC_CSE_GMG_001_CRE() runs on Tester system CseSystem { //Create var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_GMG_001(m_createContainerBase, int2001)); v_ae1.done; }//end TC_CSE_GMG_001_CRE testcase TC_CSE_GMG_001_UPD() runs on Tester system CseSystem { //Update var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_updateRequest := m_updateContainerBase; var Labels v_labels_1:= {"VALUE_1"}; v_updateRequest.primitiveContent.container.labels := v_labels_1; v_ae1.start(f_CSE_GMG_001(v_updateRequest, int2004)); v_ae1.done; }//end TC_CSE_GMG_001_UPD testcase TC_CSE_GMG_001_RET() runs on Tester system CseSystem { //Retrieve var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_GMG_001(m_retrieveResource("Temporary", "Temporary"), int2000)); v_ae1.done; }//end TC_CSE_GMG_001_RET testcase TC_CSE_GMG_001_DEL() runs on Tester system CseSystem { //Delete var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_GMG_001(m_delete("Temporary", "Temporary"), int2002)); v_ae1.done; }//end TC_CSE_GMG_001_DEL function f_CSE_GMG_001(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_acpIndex := -1; var integer v_containerIndex_1 := -1; var integer v_containerIndex_2 := -1; var integer v_groupIndex := -1; var integer i; var ListOfURIs v_memberIDs; var AcpType v_acpIDs; var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, -); // Test control if(not(PICS_ACP_SUPPORT)) { setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); stop; } // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi v_acpIndex := f_cse_createResource(int1, v_createAcp, v_aeIndex); // AE child resource v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource v_memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource), f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)}; v_acpIDs := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, v_acpIDs, int3), v_aeIndex); // AE child resource p_requestPrimitive.to_ := f_getResourceAddress(v_groupIndex) & "/fopt"; p_requestPrimitive.from_ := f_getOriginator(v_groupIndex); p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); // Test Body mcaPort.send(m_request(valueof(p_requestPrimitive))); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": creation successfull by using fanOutPoint in group resource"); if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list)){ setverdict(fail, __SCOPE__, ": Error, aggregatedResponse attribute not provided"); } else { for(i:=0; i<lengthof(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list); i := i+1){ if(not match(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list[i], mw_responsePrimitiveOK)){ setverdict(fail, __SCOPE__, ": Error, one responsePrimitve of aggregatedResponse_list is not successful"); } } } } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while creating resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } // end f_CSE_GMG_001 } // end group g_CSE_GMG_001 group g_CSE_GMG_002 { /** * @desc Check that IUT denies a <group>/fanOutPoint OPERATION when the Originator does not have OPERATION_PERMISSION specified in membersAccessControlPolicyIDs in the group resource. * */ testcase TC_CSE_GMG_002_CRE() runs on Tester system CseSystem { //Create var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_GMG_002(m_createContainerBase, int62)); //c_RUDNDi v_ae1.done; }//end TC_CSE_GMG_002_CRE testcase TC_CSE_GMG_002_UPD() runs on Tester system CseSystem { //Update var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_updateRequest := m_updateContainerBase; var Labels v_labels_1:= {"VALUE_1"}; v_updateRequest.primitiveContent.container.labels := v_labels_1; v_ae1.start(f_CSE_GMG_002(v_updateRequest, int59));//c_CRDNDi v_ae1.done; }//end TC_CSE_GMG_002_UPD testcase TC_CSE_GMG_002_RET() runs on Tester system CseSystem { //Retrieve var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_GMG_002(m_retrieveResource("Temporary", "Temporary"), int61));//c_CUDNDi v_ae1.done; }//end TC_CSE_GMG_002_RET testcase TC_CSE_GMG_002_DEL() runs on Tester system CseSystem { //Delete var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_GMG_002(m_delete("Temporary", "Temporary"), int55)); //c_CRUNDi v_ae1.done; }//end TC_CSE_GMG_002_DEL function f_CSE_GMG_002(template RequestPrimitive p_requestPrimitive, in AccessControlOperations p_accessControlOperations) runs on AeSimu { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_acpIndex := -1; var integer v_containerIndex_1 := -1; var integer v_containerIndex_2 := -1; var integer v_groupIndex := -1; var ListOfURIs v_memberIDs; var ListOfURIs v_membersAcpIds; var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, p_accessControlOperations); // Test control if(not(PICS_ACP_SUPPORT)) { setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); stop; } // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi v_acpIndex := f_cse_createResource(int1, v_createAcp, v_aeIndex); // AE child resource v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource v_memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource), f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)}; v_membersAcpIds := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int3, -, v_membersAcpIds), v_aeIndex); // AE child resource p_requestPrimitive.to_ := f_getResourceAddress(v_groupIndex) & "/fopt"; p_requestPrimitive.from_ := f_getOriginator(v_groupIndex); p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); // Test Body mcaPort.send(m_request(valueof(p_requestPrimitive))); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Update failed due to lack of privilege"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error operation successful while doesn't have privileges"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while executing operation"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } // end f_CSE_GMG_002 } // end group g_CSE_GMG_002 group g_CSE_GMG_003 { /** * @desc Check that the IUT allows a <group>/fanoutPoint OPERATION when the Originator has OPERATION_PERMISSION specified in accessControlPolicyIDs and the membersAccessControlPolicyIDs is empty in the <group> resource. * @verdict */ testcase TC_CSE_GMG_003_CRE() runs on Tester system CseSystem { //Create var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_GMG_003(m_createContainerBase, int2001)); v_ae1.done; }//end TC_CSE_GMG_003_CRE testcase TC_CSE_GMG_003_UPD() runs on Tester system CseSystem { //Update var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_updateRequest := m_updateContainerBase; var Labels v_labels_1:= {"VALUE_1"}; v_updateRequest.primitiveContent.container.labels := v_labels_1; v_ae1.start(f_CSE_GMG_003(v_updateRequest, int2004)); v_ae1.done; }//end TC_CSE_GMG_003_UPD testcase TC_CSE_GMG_003_RET() runs on Tester system CseSystem { //Retrieve var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_GMG_003(m_retrieveResource("Temporary", "Temporary"), int2000)); v_ae1.done; }//end TC_CSE_GMG_003_RET testcase TC_CSE_GMG_003_DEL() runs on Tester system CseSystem { //Delete var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_GMG_003(m_delete("Temporary", "Temporary"), int2002)); v_ae1.done; }//end TC_CSE_GMG_003_DEL function f_CSE_GMG_003(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_acpIndex := -1; var integer v_containerIndex_1 := -1; var integer v_containerIndex_2 := -1; var integer v_groupIndex := -1; var integer i; var ListOfURIs v_memberIDs; var ListOfURIs v_membersAcpIds; var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, -); // Test control if(not(PICS_ACP_SUPPORT)) { setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); stop; } // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi v_acpIndex := f_cse_createResource(int1, v_createAcp, v_aeIndex); // AE child resource v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource v_memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource), f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)}; v_membersAcpIds := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int3, -, v_membersAcpIds), v_aeIndex); // AE child resource p_requestPrimitive.to_ := f_getResourceAddress(v_groupIndex) & "/fopt"; p_requestPrimitive.from_ := f_getOriginator(v_groupIndex); p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); // Test Body mcaPort.send(m_request(valueof(p_requestPrimitive))); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": creation successfull by using fanOutPoint in group resource"); if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list)){ setverdict(fail, __SCOPE__, ": Error, aggregatedResponse attribute not provided"); } else { for(i:=0; i<lengthof(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list); i := i+1){ if(not match(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list[i], mw_responsePrimitiveOK)){ setverdict(fail, __SCOPE__, ": Error, one responsePrimitve of aggregatedResponse_list is not successful"); } } } } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while creating resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } // end f_CSE_GMG_003 } // end group g_CSE_GMG_003 group g_CSE_GMG_004 { /** * @desc Check that IUT rejects a <group>/fanOutPoint OPERATION when the Originator does not have OPERATION_PERMISSION specified in accessControlPolicyIDs and the membersAccessControlPolicyIDs is empty in the group resource. * */ testcase TC_CSE_GMG_004_CRE() runs on Tester system CseSystem { //Create var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_GMG_004(m_createContainerBase, int62)); //c_RUDNDi v_ae1.done; }//end TC_CSE_GMG_004_CRE testcase TC_CSE_GMG_004_UPD() runs on Tester system CseSystem { //Update var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_updateRequest := m_updateContainerBase; var Labels v_labels_1:= {"VALUE_1"}; v_updateRequest.primitiveContent.container.labels := v_labels_1; v_ae1.start(f_CSE_GMG_004(v_updateRequest, int59));//c_CRDNDi v_ae1.done; }//end TC_CSE_GMG_004_UPD testcase TC_CSE_GMG_004_RET() runs on Tester system CseSystem { //Retrieve var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_GMG_004(m_retrieveResource("Temporary", "Temporary"), int61));//c_CUDNDi v_ae1.done; }//end TC_CSE_GMG_004_RET testcase TC_CSE_GMG_004_DEL() runs on Tester system CseSystem { //Delete var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_GMG_004(m_delete("Temporary", "Temporary"), int55)); //c_CRUNDi v_ae1.done; }//end TC_CSE_GMG_004_DEL function f_CSE_GMG_004(template RequestPrimitive p_requestPrimitive, in AccessControlOperations p_accessControlOperations) runs on AeSimu { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_acpIndex := -1; var integer v_containerIndex_1 := -1; var integer v_containerIndex_2 := -1; var integer v_groupIndex := -1; var ListOfURIs v_memberIDs; var AcpType v_acpIDs; var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, p_accessControlOperations); // Test control if(not(PICS_ACP_SUPPORT)) { setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); stop; } // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi v_acpIndex := f_cse_createResource(int1, v_createAcp, v_aeIndex); // AE child resource v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource v_memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource), f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)}; v_acpIDs := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, v_acpIDs, int3), v_aeIndex); // AE child resource p_requestPrimitive.to_ := f_getResourceAddress(v_groupIndex) & "/fopt"; p_requestPrimitive.from_ := f_getOriginator(v_groupIndex); p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); // Test Body mcaPort.send(m_request(valueof(p_requestPrimitive))); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Update failed due to lack of privilege"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error operation successful while doesn't have privileges"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while executing operation"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } // end f_CSE_GMG_004 } // end group g_CSE_GMG_004 group g_CSE_GMG_005 { /** * @desc Check that IUT generates a request primitive for each resource in memberIDs with no relative address appended to it. * */ testcase TC_CSE_GMG_005_CRE() runs on Tester system CseSystem { //Create var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.container := mw_contentContainer_rc1; v_ae1.start(f_CSE_GMG_005(m_createContainerBase, v_contentResponse, int2001)); v_ae1.done; }//end TC_CSE_GMG_005_CRE testcase TC_CSE_GMG_005_UPD() runs on Tester system CseSystem { //Update var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_updateRequest := m_updateContainerBase; var template PrimitiveContent v_contentResponse; var Labels v_labels_1:= {"VALUE_1"}; v_contentResponse.container := mw_contentContainerBase; v_contentResponse.container.labels := ?; v_updateRequest.primitiveContent.container.labels := v_labels_1; v_ae1.start(f_CSE_GMG_005(v_updateRequest, v_contentResponse, int2004)); v_ae1.done; }//end TC_CSE_GMG_005_UPD testcase TC_CSE_GMG_005_RET() runs on Tester system CseSystem { //Retrieve var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.container := mw_contentContainerBase; v_ae1.start(f_CSE_GMG_005(m_retrieveResource("Temporary", "Temporary"), v_contentResponse, int2000)); v_ae1.done; }//end TC_CSE_GMG_005_RET testcase TC_CSE_GMG_005_DEL() runs on Tester system CseSystem { //Delete var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.container := mw_contentContainerBase;// TODO see with wath should it be matched v_ae1.start(f_CSE_GMG_005(m_delete("Temporary", "Temporary"), v_contentResponse, int2002)); v_ae1.done; }//end TC_CSE_GMG_005_DEL function f_CSE_GMG_005(template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse, in ResponseStatusCode p_responseStatusCode) runs on AeSimu { //Local constants const integer c_numberOfResponsePrimitive := 2; // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_containerIndex_1 := -1; var integer v_containerIndex_2 := -1; var integer v_groupIndex := -1; var ListOfURIs v_memberIDs; var integer i; var template RequestPrimitive v_createContainerRequest_1 := m_createContainer_noResourceName; var template RequestPrimitive v_createContainerRequest_2 := m_createContainer_noResourceName; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi v_containerIndex_1 := f_cse_createResource(int3, v_createContainerRequest_1, v_aeIndex); // AE child resource v_containerIndex_2 := f_cse_createResource(int3, v_createContainerRequest_2, v_aeIndex); // AE child resource v_memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource), f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)}; v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int3, -, -), v_aeIndex); // AE child resource p_requestPrimitive.to_ := f_getResourceAddress(v_groupIndex) & "/fopt"; p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); // Test Body mcaPort.send(m_request(valueof(p_requestPrimitive))); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": creation successfull by using fanOutPoint in group resource"); if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list)){ setverdict(fail, __SCOPE__, ": Error, aggregatedResponse attribute not provided"); } else{ if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list) != c_numberOfResponsePrimitive){ setverdict(fail, __SCOPE__, ": Error, length of aggregatedResponse is not valid"); } else{ for(i:=0; i<c_numberOfResponsePrimitive; i:=i+1){ if(not match(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list[i].primitiveContent, p_contentResponse)){ setverdict(fail, __SCOPE__, ": Error, aggregatedResponse doesn't match with template expected"); } } } } } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while creating resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } // end f_CSE_GMG_005 } // end group g_CSE_GMG_005 group g_CSE_GMG_006 { /** * @desc Check that IUT generates a request primitive for each resource in memberIDs with no relative address appended to it. * */ testcase TC_CSE_GMG_006_CRE() runs on Tester system CseSystem { //Create var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.container := mw_contentContainer_rc1; v_ae1.start(f_CSE_GMG_006(m_createContainerBase, v_contentResponse, int2001)); v_ae1.done; }//end TC_CSE_GMG_006_CRE testcase TC_CSE_GMG_006_UPD() runs on Tester system CseSystem { //Update var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_updateRequest := m_updateContainerBase; var template PrimitiveContent v_contentResponse; var Labels v_labels_1:= {"VALUE_1"}; v_contentResponse.container := mw_contentContainerBase; v_contentResponse.container.labels := ?; v_updateRequest.primitiveContent.container.labels := v_labels_1; v_ae1.start(f_CSE_GMG_006(v_updateRequest, v_contentResponse, int2004)); v_ae1.done; }//end TC_CSE_GMG_006_UPD testcase TC_CSE_GMG_006_RET() runs on Tester system CseSystem { //Retrieve var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.container := mw_contentContainerBase; v_ae1.start(f_CSE_GMG_006(m_retrieveResource("Temporary", "Temporary"), v_contentResponse, int2000)); v_ae1.done; }//end TC_CSE_GMG_006_RET testcase TC_CSE_GMG_006_DEL() runs on Tester system CseSystem { //Delete var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; v_contentResponse.container := mw_contentContainerBase;// TODO see with wath should it be matched v_ae1.start(f_CSE_GMG_006(m_delete("Temporary", "Temporary"), v_contentResponse, int2002)); v_ae1.done; }//end TC_CSE_GMG_006_DEL /** * @desc Check that IUT generates a request primitive for each resource in memberIDs with a relative address appended to it. * */ function f_CSE_GMG_006(template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse, in ResponseStatusCode p_responseStatusCode) runs on AeSimu { //Local constants const integer c_numberOfResponsePrimitive := 2; // Local variables var MsgIn v_response; var integer v_aeIndex_1, v_aeIndex_2, v_acpIndex, v_containerIndex_1, v_containerIndex_2, v_groupIndex := -1; var integer i; var ListOfURIs v_memberIDs; var ListOfURIs v_membersAcpIds; var RequestPrimitive v_createRequest := valueof(m_createContentInstance("NotInitialized", "Value1")); var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, -); var template PrimitiveContent v_contentResponse; v_contentResponse.contentInstance := mw_contentContentInstanceBase; // Test control if(not(PICS_ACP_SUPPORT)) { setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); stop; } // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex_1 := f_cse_preamble_registerAe(-, -); //c_CRUDNDi v_aeIndex_2 := f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, "MyAe2", omit), -1); // AE2 is registred v_acpIndex := f_cse_createResource(int1, v_createAcp, -1); // AE child resource v_containerIndex_1 := f_cse_createResource(int3, m_createContainerBase, v_aeIndex_1); // AE1 child resource v_containerIndex_2 := f_cse_createResource(int3, m_createContainerBase, v_aeIndex_2); // AE2 child resource v_memberIDs := {f_getResourceId(vc_resourcesList[v_aeIndex_1].resource), f_getResourceId(vc_resourcesList[v_aeIndex_2].resource)}; v_membersAcpIds := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int2, -, v_membersAcpIds, -), -); v_createRequest.to_ := f_getResourceAddress(v_groupIndex) & "/" & c_resourceShortNameFanOutPoint & "/" & c_defaultContainerResourceName; v_createRequest.from_ := f_getOriginator(v_groupIndex); //TODO see if it is correct or if we have to use PX_SUPER_ADMIN v_createRequest.requestIdentifier := v_createRequest.requestIdentifier & f_rnd(1, 1000000); // Test Body mcaPort.send(m_request(v_createRequest)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": creation successfull by using fanOutPoint in group resource"); if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list)){ setverdict(fail, __SCOPE__, ": Error, aggregatedResponse attribute not provided"); } else{ if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list) != c_numberOfResponsePrimitive){ setverdict(fail, __SCOPE__, ": Error, length of aggregatedResponse is not valid"); } else{ for(i:=0; i<c_numberOfResponsePrimitive; i:=i+1){ if(not match(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list[i].primitiveContent, v_contentResponse)){ setverdict(fail, __SCOPE__, ": Error, aggregatedResponse doesn't match with template expected"); } } } } } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while creating resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } // end f_CSE_GMG_006 }//end group g_CSE_GMG_006 }// End of Basic_Operations } // end group Group_Managment group Discovery { /** * @desc Check that the IUT returns successfully a list all discovered resource addresses * */ testcase TC_CSE_DIS_001() runs on AeSimu system CseSystem { // Local variables var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var RequestPrimitive v_request; var integer v_childResourceIndex := -1; const ResourceType c_containerResourceType := int3; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//AE1 is registred; v_resourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_aeIndex); v_childResourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_resourceIndex); v_request := valueof(m_retrieveResourceFilterUsageOption(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex), int1)); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responseDiscovery)){ tc_ac.stop; setverdict(pass, __SCOPE__ & ": URI List Representation available"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } // end TC_CSE_DIS_001 /** * @desc Check that the IUT returns the empty address list when no result matching with filter criteria is discovered * */ testcase TC_CSE_DIS_003() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var RequestPrimitive v_request; var integer v_childResourceIndex := -1; const ResourceType c_containerResourceType := int3; var Labels v_labels := {"NotFoundLabel"}; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//AE1 is registred; v_resourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_aeIndex); v_childResourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_resourceIndex); //v_request := valueof(m_retrieveResourceFilterUsageOption(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex), int1)); v_request := valueof(m_retrieveResourceFilterUsageOptionLabel(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex), int1, v_labels)); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responseDiscovery)) -> value v_response { tc_ac.stop; if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.uRIList) == 0){ setverdict(pass, __SCOPE__ & ": No Content is present"); } else { setverdict(fail, __SCOPE__ & ": Wrong content available in URIList element"); } } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } // end TC_CSE_DIS_003 /** * @desc Check that the IUT returns successfully a list of discovered resource addresses with Non-hierarchical addressing form when the Discovery Result Type is provided in the request * */ testcase TC_CSE_DIS_004() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var RequestPrimitive v_request; var integer v_childResourceIndex := -1; const ResourceType c_containerResourceType := int3; var integer v_i_cont := 0; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//AE1 is registred; v_resourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_aeIndex); v_childResourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_resourceIndex); v_request := valueof(m_retrieveResourceDiscResTypeFilterUsageOption(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex), int2, int1)); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responseDiscovery)) -> value v_response { tc_ac.stop; while (v_i_cont<lengthof(v_response.primitive.responsePrimitive.primitiveContent.uRIList)){ if (f_isNonHierarchical(v_response.primitive.responsePrimitive.primitiveContent.uRIList[v_i_cont])) { setverdict(pass, __SCOPE__ & ": Non-hierarchical address form present in URIList[" & int2str(v_i_cont) & "] element"); } else { setverdict(fail, __SCOPE__ & ": Non-hierarchical address form absent in URIList[" & int2str(v_i_cont) & "] element"); } v_i_cont := v_i_cont + 1; } } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } // end TC_CSE_DIS_004 /** * @desc Check that the IUT rejects the discovery requests to the resource TARGET_RESOURCE_ADDRESS when AE has no privilege to perform the discovery request for the resource TARGET_RESOURCE_ADDRESS * */ testcase TC_CSE_DIS_005() runs on AeSimu system CseSystem { // Local variables var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var RequestPrimitive v_request; var integer v_childResourceIndex := -1; var integer v_acpAuxIndex := -1; const ResourceType c_containerResourceType := int3; // Test control if(not(PICS_ACP_SUPPORT)) { log(__SCOPE__ & ":INFO: AccessControlPolicy support is required for executing this test case"); stop; } // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_acpAuxIndex := f_cse_preamble_createAcpAux(-, int31);//c_CRUDN) v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)});//AE1 is registred; v_resourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_aeIndex); v_childResourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_resourceIndex); v_request := valueof(m_retrieveResourceFilterUsageOption(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex), int1)); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Access denied to discovery operation for resource " & f_getResourceAddress(v_resourceIndex)); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Discovering " & f_getResourceAddress(v_resourceIndex) & " without having privileges"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while discovering resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } // end TC_CSE_DIS_005 /** * @desc Check that the IUT responds with an error when the AE sends requests to discover the resource TARGET_RESOURCE_ADDRESS which does not exist in the Hosting CSE * */ testcase TC_CSE_DIS_006() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var RequestPrimitive v_request; var XSD.ID v_resourceId := "nonexisting"; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//AE1 is registred; if(PX_ADDRESSING_METHOD == e_nonHierarchical and (PX_PRIMITIVE_SCOPE == e_cseRelative)) { v_request := valueof(m_retrieveResourceFilterUsageOption(v_resourceId, f_getOriginator(v_aeIndex), int1)); } else { v_request := valueof(m_retrieveResourceFilterUsageOption(f_getResourceAddress(v_aeIndex) & "/" & v_resourceId, f_getOriginator(v_resourceIndex), int1)); } mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Resource not found"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response while retrieving resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } // end TC_CSE_DIS_006 /** * @desc Check that the IUT responds the originator with an error when the originator sends a request including an invalid format of filter criteria to discover the resource TARGET_RESOURCE_ADDRESS * */ testcase TC_CSE_DIS_007() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var RequestPrimitive v_request; var integer v_childResourceIndex := -1; const ResourceType c_containerResourceType := int3; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//AE1 is registred; v_resourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_aeIndex); v_childResourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_resourceIndex); v_request := valueof(m_retrieveResourceFilterUsageOption(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex), int1)); v_request.filterCriteria.expireBefore := "20171231T012345"; v_request.filterCriteria.expireAfter := "20181231T012345"; mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4102))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Contents Unacceptable"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code while retrieving resource"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response while retrieving resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } // end TC_CSE_DIS_007 } //end group Group Discovery group Subscription_And_Notification { group Create { /** * @desc Check that the IUT rejects the creation of the <subscription> resource when the target subscribed-to RESOURCE_TYPE resource is not subscribable. * */ testcase TC_CSE_SUB_CRE_001_SUB() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; var RequestPrimitive v_request; var integer v_ae2Index := -1; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//AE1 is registred; f_cse_preamble_subscriptionVerification(v_ae2Index, v_createRequest, int23); v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription resource is created v_request := f_getCreateRequestPrimitive(int23, v_createRequest, v_resourceIndex); // Test Body mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int5203))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": <Subscription> Resource not subscribable"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Subscription successful whereas <Subscription> resource is not subscribable"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } } f_checkAeSimuStatus(); //Check to see if the resource is NOT present if(f_isResourceNotPresent(v_resourceIndex, f_getResourceName(v_request.primitiveContent))){ setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); } //Postamble f_cse_postamble_deleteResources(); //Tear down f_cf01Down(); } // end TC_CSE_SUB_CRE_001_SUB testcase TC_CSE_SUB_CRE_001_CIN() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_containerResourceIndex := -1; var integer v_contentInstanceResourceIndex := -1; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; var RequestPrimitive v_request; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); v_containerResourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex);//Container v_contentInstanceResourceIndex := f_cse_createResource(int4, m_createContentInstance(f_getResourceAddress(v_aeIndex), "Random Value"), v_containerResourceIndex);//ContentInstance v_request := f_getCreateRequestPrimitive(int23, v_createRequest, v_contentInstanceResourceIndex); // Test Body mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int5203))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": <Subscription> Resource not subscribable"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Subscription successful whereas <Subscription> resource is not subscribable"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } } f_checkAeSimuStatus(); //Check to see if the resource is NOT present if(f_isResourceNotPresent(v_contentInstanceResourceIndex, f_getResourceName(v_request.primitiveContent))){ setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); } //Postamble f_cse_postamble_deleteResources(); //Tear down f_cf01Down(); } // end TC_CSE_SUB_CRE_001_CIN /** * @desc Check that the IUT rejects the creation of the <subscription> resource when the originator does not have privileges for retrieving the subscribed-to resource. * */ testcase TC_CSE_SUB_CRE_002() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_acpAuxIndex := -1; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; var RequestPrimitive v_request; // Test control if(not(PICS_ACP_SUPPORT)) { setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); stop; } // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_acpAuxIndex := f_cse_preamble_createAcpAux(-, int61);//c_CUDNDi) v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}, -);//c_CRDNDi); v_request := f_getCreateRequestPrimitive(int23, v_createRequest, v_aeIndex);//Subscription // Test Body mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": No privilege for subscribing to the resource"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Subscription successful whereas it doesn't have privilege"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } } f_checkAeSimuStatus(); //Check to see if the resource is NOT present if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); } //Postamble f_cse_postamble_deleteResources(); //Tear down f_cf01Down(); } // end TC_CSE_SUB_CRE_002 /** * @desc Check that the IUT rejects the creation of the <subscription> resource when the notificationURI is not the originator and the IUT cannot send the Notify request to the notificationURI * */ testcase TC_CSE_SUB_CRE_003() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; var RequestPrimitive v_request; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); v_request := f_getCreateRequestPrimitive(int23, v_createRequest, v_aeIndex);//Subscription v_request.primitiveContent.subscription.notificationURI := {"NotReachableNotificationURI"}; // Test Body mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int5204))) -> value v_response { //SUBSCRIPTION_VERIFICATION_INITIATION_FAILED tc_ac.stop; setverdict(pass, __SCOPE__ & ": OK : Subscription verification initiation failed"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Subscription successful whereas Subscription verification failed"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } } f_checkAeSimuStatus(); //Check to see if the resource is NOT present if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); } //Postamble f_cse_postamble_deleteResources(); //Tear down f_cf01Down(); } // end TC_CSE_SUB_CRE_003 /** * @desc Check that the IUT stores Originator ID in the notification creator attribute when a <SUBSCRIPTION> creation request which needs verification is received and the notificationURI is not the Originator. * */ testcase TC_CSE_SUB_CRE_004() runs on AeSimu system CseSystem { //Local variables var template RequestPrimitive v_request := m_createSubscriptionBase; var RequestPrimitive v_notificationRequest; var integer v_aeIndex := -1; var integer v_ae2Index := -1; var integer v_resourceIndex := -1; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); f_cse_preamble_subscriptionVerification(v_ae2Index, v_request, int23); v_request := f_getCreateRequestPrimitive(int23, m_createSubscriptionBase, v_aeIndex); v_request.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_ae2Index)}; v_resourceIndex := f_cse_createResource(int23, v_request, v_aeIndex);//Subscription if(vc_ae2.running) { vc_ae2.stop; }; f_checkComponentDoneAndGetVerdict(vc_ae2); // Test Body v_notificationRequest := f_getRequestPrimitive(vc_ae2); if(f_compareURIs(v_aeIndex, v_notificationRequest.primitiveContent.notification.creator)) { setverdict(pass, __SCOPE__ & ": Creator set to originator of the subscription creation primitive"); } else { setverdict(fail, __SCOPE__ & ": Creator not set to originator of the subscription creation primitive"); } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } // end TC_CSE_SUB_CRE_004 /** * @desc Check that the IUT sends a Notify request to the subscriber resource when eventType attribute is set to "Create_of_Direct_Child_Resource" and an create operation has been performed on the subscribed-to resource * */ testcase TC_CSE_SUB_CRE_005() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var template RequestPrimitive v_createRequest := omit; var template PrimitiveContent v_contentNotification := {container := mw_contentContainer_rc1};// all attributes expected var RequestPrimitive v_request; var integer v_ae2Index := -1; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, m_eventNotificationCriteria({int3}), -, omit, omit, omit, -, omit); f_cse_preamble_subscriptionVerification(v_ae2Index, v_createRequest, int23); v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription if(vc_ae2.running) { vc_ae2.stop; }; // Test Body v_request:= f_getCreateRequestPrimitive(int3, m_createContainerBase, v_aeIndex); vc_ae2.start(f_cse_notifyProcedure_representationHandler(v_contentNotification)); // check if the notification is well received and if its content matchs mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Resource type int3 (Container) created successfully"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while creating resource type int3 (Container)"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource type int3 (Container)"); } } f_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble f_cse_postamble_deleteResources(); //Tear down f_cf01Down(); } // end TC_CSE_SUB_CRE_005 }//end group Create group Notify{ /** * @desc Check that the IUT rejects the creation of the <subscription> resource when the notificationURI is not the originator and the IUT have received the Notify response containing Response Status Code indicating SUBSCRIPTION_CREATOR_HAS_NO_PRIVILEGE * */ testcase TC_CSE_SUB_NTF_001() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; var RequestPrimitive v_request; var integer v_ae2Index := -1; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe(omit,omit);//c_CUDNDi); f_cse_preamble_subscriptionVerification(v_ae2Index, v_createRequest, int23, int4101); // Test Body v_request := f_getCreateRequestPrimitive(int23, v_createRequest, v_aeIndex);//Subscription mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4101))) -> value v_response { //SUBSCRIPTION_CREATOR_HAS_NO_PRIVILEGE tc_ac.stop; setverdict(pass, __SCOPE__ & ": OK : Subscription creator has no privilege"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Subscription successful whereas Subscription creator has no privilege"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } } f_checkComponentDoneAndGetVerdict(vc_ae2); //Check to see if the resource is NOT present if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); } //Postamble f_cse_postamble_deleteResources(); //Tear down f_cf01Down(); } // end TC_CSE_SUB_NTF_001 /** * @desc Check that the IUT rejects the creation of the <subscription> resource when the notificationURI is not the originator and the IUT have received the Notify response containing Response Status Code indicating SUBSCRIPTION_HOST_HAS_NO_PRIVILEGE * */ testcase TC_CSE_SUB_NTF_002() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; var RequestPrimitive v_request; var integer v_ae2Index := -1; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe(omit,omit);//c_CUDNDi); f_cse_preamble_subscriptionVerification(v_ae2Index, v_createRequest, int23, int5205); // Test Body v_request := f_getCreateRequestPrimitive(int23, v_createRequest, v_aeIndex);//Subscription mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int5205))) -> value v_response { //SUBSCRIPTION_CREATOR_HAS_NO_PRIVILEGE tc_ac.stop; setverdict(pass, __SCOPE__ & ": OK : Subscription creator has no privilege"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Subscription successful whereas Subscription creator has no privilege"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } } f_checkComponentDoneAndGetVerdict(vc_ae2); //Check to see if the resource is NOT present if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); } //Postamble f_cse_postamble_deleteResources(); //Tear down f_cf01Down(); } // end TC_CSE_SUB_NTF_002 /** * @desc Check that the IUT sends aggregated notification to the subscriber resource when the duration value of the batchNotify attribute is set to TIME_LIMIT and when this timer expires * */ testcase TC_CSE_SUB_NTF_003() runs on AeSimu system CseSystem { // Local variables timer t_batchNotificationTimer := PX_TAC * 2.0; var float v_elapsedTime; const integer c_numberOfAggregatedNotification := 2; var Labels v_labels_1:= {"VALUE_1"}; var Labels v_labels_2:= {"VALUE_2"}; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var template RequestPrimitive v_createRequest := omit; var template PrimitiveContent v_contentResponse; var template RequestPrimitive v_updateRequest := m_updateAeBase; var RequestPrimitive v_request; var integer v_ae2Index := -1; v_contentResponse.aE := mw_contentAeBase; // all attributes expected // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); f_cse_preamble_subscriptionVerification(v_ae2Index, v_createRequest, int23); v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)},omit,omit,m_batchNotify(c_numberOfAggregatedNotification + 1, "PT10S" ), omit, omit, -, int2);//batchNotify/number greater than number of notifications to be sent so that batchNotify/duration expires before v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription if(vc_ae2.running) { vc_ae2.stop; }; // Test Body vc_ae2.start(f_cse_notifyProcedure_aggregatedNoficationHandler(v_contentResponse, c_numberOfAggregatedNotification)); v_updateRequest.primitiveContent.aE.labels := v_labels_1; v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 1 f_cse_updateResource(v_request); t_batchNotificationTimer.start; v_updateRequest := m_updateAeBase; v_updateRequest.primitiveContent.aE.appName := "MyAppName2"; v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 2 f_cse_updateResource(v_request); vc_ae2.done; v_elapsedTime := t_batchNotificationTimer.read; t_batchNotificationTimer.stop; if(v_elapsedTime < 10.0) { setverdict(fail, __SCOPE__ & ": Notifications sent before bathNotify/duration expired"); } f_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble f_cse_postamble_deleteResources(); //Tear down f_cf01Down(); } // end TC_CSE_SUB_NTF_003 }//end group Notify group Update { /** * @desc Check that the IUT sends Notify request to the subscriber resource when an update operation has been performed on the subscribed-to resource * */ testcase TC_CSE_SUB_UPD_001() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var Labels v_labels_1:= {"VALUE_1"}; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; var template PrimitiveContent v_contentResponse; var template RequestPrimitive v_updateRequest := m_updateAeBase; var RequestPrimitive v_request; var integer v_ae2Index := -1; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); f_cse_preamble_subscriptionVerification(v_ae2Index, v_createRequest, int23); v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription if(vc_ae2.running) { vc_ae2.stop; }; // Test Body v_contentResponse.aE := mw_contentAeBase; // all attributes expected vc_ae2.start(f_cse_notifyProcedure_representationHandler(v_contentResponse)); // check if the notification is well received and if its content matchs v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request v_request.primitiveContent.aE.labels := v_labels_1; mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Attribute of resource type int2 (Ae) updated successfully"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while updating resource type int2 (Ae)"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while updating resource type int2 (Ae)"); } }; f_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble f_cse_postamble_deleteResources(); //Tear down f_cf01Down(); } // end TC_CSE_SUB_UPD_001 /** * @desc Check that the IUT sends a Notify request to the subscriber resource when the notificationContentType attribute is set to “modified attributes” and an update operation has been performed on the subscribed-to resource * */ testcase TC_CSE_SUB_UPD_002() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var Labels v_labels_1:= {"VALUE_1"}; var template PrimitiveContent v_contentResponse := {aE := m_contentAe_allOmit}; var template RequestPrimitive v_createRequest := omit; var template RequestPrimitive v_updateRequest := m_updateAeBase; var RequestPrimitive v_request; var integer v_ae2Index := -1; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, omit, omit, omit, omit, omit, int2, omit); //notificationContentType ="modified attributes" f_cse_preamble_subscriptionVerification(v_ae2Index, v_createRequest, int23); v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex); //Subscription if(vc_ae2.running) { vc_ae2.stop; }; // Test Body //TODO Use f_getTemplateFromPrimitiveContent() which needs to be modified to receive the template in which the output template will be built upon v_contentResponse.aE.labels := ?;// only modified attribute expected v_contentResponse.aE.lastModifiedTime := ?;// only modified attribute expected //TODO Get it automatically into the expected content template vc_ae2.start(f_cse_notifyProcedure_representationHandler(v_contentResponse)); // check if the notification is well received and if its content matchs v_updateRequest.primitiveContent.aE.labels := v_labels_1; v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Attribute of resource type int2 (Ae) updated successfully"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while updating resource type int2 (Ae)"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while updating resource type int2 (Ae)"); } } f_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble f_cse_postamble_deleteResources(); //Tear down f_cf01Down(); } // end TC_CSE_SUB_UPD_002 /** * @desc Check that the IUT sends a Notify request to the subscriber resource when the notificationContentType attribute is set to “ResourceID” and an update operation has been performed on the subscribed-to resource * */ testcase TC_CSE_SUB_UPD_003() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var Labels v_labels_1:= {"VALUE_1"}; var template RequestPrimitive v_createRequest := omit; var template PrimitiveContent v_contentResponse; var template RequestPrimitive v_updateRequest := m_updateAeBase; var RequestPrimitive v_request; var integer v_ae2Index := -1; v_updateRequest.primitiveContent.aE.labels := v_labels_1; v_contentResponse.uRI := ?; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); f_cse_preamble_subscriptionVerification(v_ae2Index, v_createRequest, int23); v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, omit, omit, omit, omit, omit, int3, omit); // notificationContentType ="ResourceID" v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription f_checkComponentDoneAndGetVerdict(vc_ae2); // Test Body vc_ae2.start(f_cse_notifyProcedure_representationHandler(v_contentResponse)); // check if the notification is well received and if its content matchs v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Attribute of resource type int2 (Ae) updated successfully"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while updating resource type int2 (Ae)"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while updating resource type int2 (Ae) or None notification received"); } } f_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble f_cse_postamble_deleteResources(); //Tear down f_cf01Down(); } // end TC_CSE_SUB_UPD_003 /** * @desc Check that the IUT decreases the expirationCounter attribute of a subscription resource when the Hosting CSE of the subscribed-to resource successfully sends the notification request to subscriber resource(s) * */ testcase TC_CSE_SUB_UPD_004() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var Labels v_labels_1:= {"VALUE_1"}; var template PrimitiveContent v_contentResponse; var template RequestPrimitive v_createRequest := omit; var template RequestPrimitive v_updateRequest := m_updateAeBase; var RequestPrimitive v_request; var template PrimitiveContent v_retrieveContentResponse; var integer v_ae2Index := -1; v_updateRequest.primitiveContent.aE.labels := v_labels_1; v_contentResponse.aE := mw_contentAeBase; // all attributes expected v_retrieveContentResponse.subscription := mw_contentSubscription_rc1; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); f_cse_preamble_subscriptionVerification(v_ae2Index, v_createRequest, int23); v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, omit, 3, omit, omit, omit, -, omit); //expirationCounter set to 3 v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex); // Subscription if(vc_ae2.running) { vc_ae2.stop; }; // Test Body vc_ae2.start(f_cse_notifyProcedure_representationHandler(v_contentResponse)); // check if the notification is well received and if its content matchs v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // AE update request f_cse_updateResource(v_request); // AE update f_checkComponentDoneAndGetVerdict(vc_ae2); mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)))); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_retrieveContentResponse))) -> value v_response { tc_ac.stop; if(v_response.primitive.responsePrimitive.primitiveContent.subscription.expirationCounter == 2 ){ setverdict(pass, __SCOPE__ & ": expirationCounter has been successfully decreased by one"); } else{ setverdict(fail, __SCOPE__ & ": Error expirationCounter hasn't been decreased by one"); } } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } f_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble f_cse_postamble_deleteResources(); //Tear down f_cf01Down(); } // end TC_CSE_SUB_UPD_004 /** * @desc Check that the IUT deletes the subscription resource when the the expirationCounter meets zero * */ testcase TC_CSE_SUB_UPD_005() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var Labels v_labels_1:= {"VALUE_1"}; var template PrimitiveContent v_contentResponse; var template RequestPrimitive v_createRequest := omit; var template RequestPrimitive v_updateRequest := m_updateAeBase; var RequestPrimitive v_request; var integer v_ae2Index := -1; v_updateRequest.primitiveContent.aE.labels := v_labels_1; v_contentResponse.aE := mw_contentAeBase; // all attributes expected // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); f_cse_preamble_subscriptionVerification(v_ae2Index, v_createRequest, int23); v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, omit, 1, omit, omit, omit, -, omit); //expirationCounter set to 1 v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);// Subscription if(vc_ae2.running) { vc_ae2.stop; }; // Test Body vc_ae2.start(f_cse_notifyProcedure_representationHandler(v_contentResponse)); // check if the notification is well received and if its content matchs v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // AE update request f_cse_updateResource(v_request); // AE update f_checkComponentDoneAndGetVerdict(vc_ae2); mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)))); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Subscription Resource have been successfully deleted"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error Subscription Resource has not been deleted"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while retrieving Subscription Resource"); } } f_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble f_cse_postamble_deleteResources(); //Tear down f_cf01Down(); } // end TC_CSE_SUB_UPD_005 /** * @desc Check that the IUT doesn’t send a Notify request to the subscriber resource when the “attribute” condition tag of eventNotificationCriteria attribute is set to LIST_OF_ATTRIBUTE and doesn’t contain the ATTRIBUTE_NAME attribute updated. * */ testcase TC_CSE_SUB_UPD_006() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var Labels v_labels_1:= {"VALUE_1"}; var AttributeList_1 v_attributeList := {"apn"}; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var template RequestPrimitive v_createRequest := omit; var template RequestPrimitive v_updateRequest := m_updateAeBase; var RequestPrimitive v_request; var integer v_ae2Index := -1; v_updateRequest.primitiveContent.aE.labels := v_labels_1; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); f_cse_preamble_subscriptionVerification(v_ae2Index, v_createRequest, int23); v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, m_eventNotificationCriteria({int1}, v_attributeList), omit, omit, omit, omit, -, omit); v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request if(vc_ae2.running) { vc_ae2.stop; }; // Test Body vc_ae2.start(f_cse_notifyProcedure_noNotificationHandler()); // check that no notification is received mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Attribute of resource type int2 (Ae) updated successfully"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while updating resource type int2 (Ae)"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while updating resource type int2 (Ae) or None notification received"); } } f_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble f_cse_postamble_deleteResources(); //Tear down f_cf01Down(); } // end TC_CSE_SUB_UPD_006 /** * @desc Check that the IUT sends aggregated notification to the subscriber resource when the number value of the batchNotify attribute is set to GROUP_LIMIT and when this number have been reached * */ testcase TC_CSE_SUB_UPD_007() runs on AeSimu system CseSystem { // Local variables const integer numberOfAggregatedNotification := 3; var Labels v_labels_1:= {"VALUE_1"}; var Labels v_labels_2:= {"VALUE_2"}; var Labels v_labels_3:= {"VALUE_3"}; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var template RequestPrimitive v_createRequest := omit; var template PrimitiveContent v_contentResponse; var template RequestPrimitive v_updateRequest := m_updateAeBase; var RequestPrimitive v_request; var integer v_ae2Index := -1; v_contentResponse.aE := mw_contentAeBase; // all attributes expected // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); f_cse_preamble_subscriptionVerification(v_ae2Index, v_createRequest, int23); v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)},omit,omit,m_batchNotify(numberOfAggregatedNotification), omit, omit, -, omit ); v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription if(vc_ae2.running) { vc_ae2.stop; }; // Test Body vc_ae2.start(f_cse_notifyProcedure_aggregatedNoficationHandler(v_contentResponse, numberOfAggregatedNotification)); // check that no notification is received v_updateRequest.primitiveContent.aE.labels := v_labels_1; v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 1 f_cse_updateResource(v_request); v_updateRequest.primitiveContent.aE.labels := v_labels_2; v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 2 f_cse_updateResource(v_request); v_updateRequest.primitiveContent.aE.labels := v_labels_3; v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 3 f_cse_updateResource(v_request); f_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble f_cse_postamble_deleteResources(); //Tear down f_cf01Down(); } // end TC_CSE_SUB_UPD_007 /** * @desc Check that the IUT sends the latest notification to the subscriber resource when latestNotify is set to TRUE, the number value of the batchNotify attribute is set to GROUP_LIMIT and when this number have been reached * */ testcase TC_CSE_SUB_UPD_008() runs on AeSimu system CseSystem { // Local variables const integer numberOfAggregatedNotification := 3; var Labels v_labels_1:= {"VALUE_1"}; var Labels v_labels_2:= {"VALUE_2"}; var Labels v_labels_3:= {"VALUE_3"}; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var template RequestPrimitive v_createRequest := omit; var template PrimitiveContent v_contentResponse; var template RequestPrimitive v_updateRequest := m_updateAeBase; var RequestPrimitive v_request; var integer v_ae2Index := -1; v_contentResponse.aE := mw_contentAeBase; // all attributes expected // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); f_cse_preamble_subscriptionVerification(v_ae2Index, v_createRequest, int23); v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)},omit,omit,m_batchNotify(numberOfAggregatedNotification), true, omit, -, omit); //TODO We Need to check if the IUT send a notification only for the latest update operation // like we match a Notification we have to verify if it is the first (unvalid behavior) or the last (valid behavior) // maybe we need to synchronise our components v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription if(vc_ae2.running) { vc_ae2.stop; }; // Test Body vc_ae2.start(f_cse_notifyProcedure_representationHandler(v_contentResponse)); // check if the notification is well received and if its content matchs v_updateRequest.primitiveContent.aE.labels := v_labels_1; v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 1 f_cse_updateResource(v_request); v_updateRequest.primitiveContent.aE.labels := v_labels_2; v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 2 f_cse_updateResource(v_request); v_updateRequest.primitiveContent.aE.labels := v_labels_3; v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 3 f_cse_updateResource(v_request); f_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble f_cse_postamble_deleteResources(); //Tear down f_cf01Down(); } // end TC_CSE_SUB_UPD_008 /** * @desc Check that the IUT sends a Notify request to the subscriber resource when the “attribute” condition tag of eventNotificationCriteria attribute is set to ATTRIBUTE_NAME and an update operation has been performed on the subscribed-to resource * */ testcase TC_CSE_SUB_UPD_009() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var Labels v_labels_1:= {"VALUE_1"}; var AttributeList_1 v_attributeList := {"lbl"}; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var template RequestPrimitive v_createRequest := omit; var template PrimitiveContent v_contentResponse; var template RequestPrimitive v_updateRequest := m_updateAeBase; var RequestPrimitive v_request; var integer v_ae2Index := -1; v_updateRequest.primitiveContent.aE.labels := v_labels_1; v_contentResponse.aE := mw_contentAeBase; // all attributes expected // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); f_cse_preamble_subscriptionVerification(v_ae2Index, v_createRequest, int23); v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, m_eventNotificationCriteria({int1}, v_attributeList), omit, omit, omit, omit, -, omit); v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request if(vc_ae2.running) { vc_ae2.stop; }; // Test Body vc_ae2.start(f_cse_notifyProcedure_representationHandler(v_contentResponse)); // check if the notification is well received and if its content matchs mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Attribute of resource type int2 (Ae) updated successfully"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while updating resource type int2 (Ae)"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while updating resource type int2 (Ae) or None notification received"); } } f_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble f_cse_postamble_deleteResources(); //Tear down f_cf01Down(); } // end TC_CSE_SUB_UPD_009 }//end group Update group Delete { /** * @desc Check that the IUT sends a Notify request to the AE2_RESOURCE_ADDRESS of the subscriberURI attribute when the SUBSCRIPTION_RESOURCE_ADDRESS <subscription> resource is deleted * */ testcase TC_CSE_SUB_DEL_001() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var template RequestPrimitive v_createRequest := omit; var RequestPrimitive v_request; var integer v_ae2Index := -1; var template Notification v_notificationContent := mw_contentNotificationBase; var RequestPrimitive v_notificationRequest; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); f_cse_preamble_subscriptionVerification(v_ae2Index, v_createRequest, int23); v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, omit, omit, omit, omit,f_getResourceAddress(v_ae2Index), -, omit); // SubscriberURI ="ResourceID" v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex); // Subscription v_request := valueof(m_delete(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); // Subscription resource deletion request if(vc_ae2.running) { vc_ae2.stop; }; // Test Body v_notificationContent.subscriptionReference := ?; v_notificationContent.notificationEvent := omit; vc_ae2.start(f_cse_notifyProcedure_subscriptionDeletionHandler(v_notificationContent)); // check that no notification is received mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Subscription resource deleted successfully"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while deleting resource type int23 (Subscription)"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while deleting resource type int23 (Subscription)"); } } f_checkComponentDoneAndGetVerdict(vc_ae2); v_notificationRequest := f_getRequestPrimitive(vc_ae2); if(f_compareURIs(v_resourceIndex, v_notificationRequest.primitiveContent.notification.subscriptionReference)) { setverdict(pass, __SCOPE__ & ": Creator set to originator of the subscription creation primitive"); } else { setverdict(fail, __SCOPE__ & ": Creator not set to originator of the subscription creation primitive"); } //Postamble f_cse_postamble_deleteResources(); //Tear down f_cf01Down(); } // end TC_CSE_SUB_DEL_001 /** * @desc Check that the IUT sends a Notify request to the subscriber resource when eventType attribute is set to "Delete_of_Resource" and an delete operation has been performed the subscribed-to resource * */ testcase TC_CSE_SUB_DEL_002() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_subscriptionResourceIndex := -1; var template RequestPrimitive v_createRequest := omit; var template PrimitiveContent v_notificationContent; var RequestPrimitive v_deleteRequest; var integer v_ae2Index := -1; // Test control // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, m_eventNotificationCriteria({int2}, -), omit, omit, omit, omit, -, omit); f_cse_preamble_subscriptionVerification(v_ae2Index, v_createRequest, int23); v_subscriptionResourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex );//Subscription if(vc_ae2.running) { vc_ae2.stop; }; //Test Body v_notificationContent := {aE:= mw_contentAeBase}; // all attributes expected; vc_ae2.start(f_cse_notifyProcedure_representationHandler(v_notificationContent)); // check if the notification is well received and if its content matchs v_deleteRequest:= valueof(m_delete(f_getResourceAddress(v_aeIndex), f_getOriginator(v_aeIndex))); // Ae delete request mcaPort.send(m_request(v_deleteRequest)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) -> value v_response { tc_ac.stop; //Update vc_resourcesIndexToBeDeleted f_removeElementFromList (vc_resourcesIndexToBeDeleted, v_aeIndex); setverdict(pass, __SCOPE__ & ": resource type int2 (AE) deleted successfully"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while deleting resource type int2 (AE)"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while deleting resource type int2 (AE)"); } } f_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble f_cse_postamble_deleteResources(); //Tear down f_cf01Down(); } // end TC_CSE_SUB_DEL_002 /** * @desc Check that the IUT sends a Notify request to the subscriber resource when eventType attribute is set to "Delete_of_Direct_Child_Resource" and an delete operation has been performed on a child resource of the subscribed-to resource * */ testcase TC_CSE_SUB_DEL_003() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_subscriptionResourceIndex := -1; var integer v_containerResourceIndex := -1; var template RequestPrimitive v_createRequest := omit; var RequestPrimitive v_deleteRequest; var template PrimitiveContent v_notificationContent; var integer v_ae2Index := -1; // Test component configuration f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi; v_containerResourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex);//Container v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, m_eventNotificationCriteria({int4}, -), omit, omit, omit, omit, -, omit); f_cse_preamble_subscriptionVerification(v_ae2Index, v_createRequest, int23); v_subscriptionResourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription (with name attribute omitted) if(vc_ae2.running) { vc_ae2.stop; }; //Test Body v_notificationContent := {container := mw_contentContainer_rc1}; // all attributes expected; vc_ae2.start(f_cse_notifyProcedure_representationHandler(v_notificationContent)); // check if the notification is well received and if its content matchs v_deleteRequest := valueof(m_delete(f_getResourceAddress(v_containerResourceIndex), f_getOriginator(v_containerResourceIndex)));// Container deletion request mcaPort.send(m_request(v_deleteRequest)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Container resource deleted successfully"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while deleting resource type int3 (Container)"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while deleting resource type int3 (Container)"); } } f_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble f_cse_postamble_deleteResources(); //Tear down f_cf01Down(); } // end TC_CSE_SUB_DEL_003 }//end group Delete }//end group Subscription_And_Notification group Security { group Access_Control_Policy { group Create { /** * @desc Check that the IUT accepts the creation of a accessControlPolicy resource with privileges attribute having multiple access control rules * */ testcase TC_CSE_SEC_ACP_CRE_001() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_acpIndex := -1; var template PrimitiveContent v_contentResponse; var RequestPrimitive v_createRequest := valueof(m_createAcpBase); var AccessControlRule v_accessControlRule_1 := valueof(m_createAcr({PX_SUPER_AE_ID}, int63)); var AccessControlRule v_accessControlRule_2 := valueof(m_createAcr({"Temporary"}, int55)); const ResourceType c_accessControlPolicyType := int1; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe(-, -); // Use for setting the ACR_2's accessControlOriginators attribute to AE_ID v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule_1,v_accessControlRule_2}; v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list[1].accessControlOriginators := {f_getOriginator(v_aeIndex)}; v_contentResponse.accessControlPolicy := mw_contentAcp_rc1; v_contentResponse.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule_1,v_accessControlRule_2};// TODO To handle reverse order of acrs v_contentResponse.accessControlPolicy.privileges.accessControlRule_list[1].accessControlOriginators := {f_getOriginator(v_aeIndex)}; // Test Body v_createRequest := f_getCreateRequestPrimitive(c_accessControlPolicyType, v_createRequest, v_aeIndex); mcaPort.send(m_request(v_createRequest)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(c_accessControlPolicyType)) & " created successfully"); f_checkAttributesToBeSaved(c_accessControlPolicyType, v_createRequest, v_response.primitive.responsePrimitive); v_acpIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int1, v_aeIndex); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while creating resource type " & int2str(enum2int(c_accessControlPolicyType))); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(c_accessControlPolicyType))); } } f_checkAeSimuStatus(); //Check to see if the resource is present or not if(f_isResourcePresent(v_acpIndex)) { setverdict(pass, __SCOPE__ & ":INFO: Resource created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); } //Postamble f_cse_postamble_deleteResources(); //Tear down f_cf01Down(); }//end TC_CSE_SEC_ACP_CRE_001 /** * @desc Check that the IUT accepts the creation of a accessControlPolicy resource with selfPrivileges attribute having multiple access control rules */ testcase TC_CSE_SEC_ACP_CRE_002() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_acpIndex := -1; var template PrimitiveContent v_contentResponse; var RequestPrimitive v_createRequest := valueof(m_createAcpBase); var AccessControlRule v_accessControlRule_1 := valueof(m_createAcr({PX_SUPER_AE_ID}, int63)); var AccessControlRule v_accessControlRule_2 := valueof(m_createAcr({"Temporary"}, int55)); const ResourceType c_accessControlPolicyType := int1; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe(-, -); // Only use for setting the ACR_2's accessControlOriginators attribute to AE_ID v_createRequest.primitiveContent.accessControlPolicy.selfPrivileges.accessControlRule_list := {v_accessControlRule_1,v_accessControlRule_2}; v_createRequest.primitiveContent.accessControlPolicy.selfPrivileges.accessControlRule_list[1].accessControlOriginators := {f_getOriginator(v_aeIndex)}; v_contentResponse.accessControlPolicy := mw_contentAcp_rc1; v_contentResponse.accessControlPolicy.selfPrivileges.accessControlRule_list := {v_accessControlRule_1,v_accessControlRule_2};//TODO To handle reverse order of acrs v_contentResponse.accessControlPolicy.selfPrivileges.accessControlRule_list[1].accessControlOriginators := {f_getOriginator(v_aeIndex)}; // Test Body v_createRequest := f_getCreateRequestPrimitive(c_accessControlPolicyType, v_createRequest, v_aeIndex);// CSE child resource mcaPort.send(m_request(v_createRequest)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(c_accessControlPolicyType)) & " created successfully"); f_checkAttributesToBeSaved(c_accessControlPolicyType, v_createRequest, v_response.primitive.responsePrimitive); v_acpIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, c_accessControlPolicyType, v_aeIndex); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while creating resource type " & int2str(enum2int(c_accessControlPolicyType))); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(c_accessControlPolicyType))); } } f_checkAeSimuStatus(); //Check to see if the resource is present or not if(f_isResourcePresent(v_acpIndex)) { setverdict(pass, __SCOPE__ & ":INFO: Resource created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); } //Postamble f_cse_postamble_deleteResources(); //Tear down f_cf01Down(); }//end TC_CSE_SEC_ACP_CRE_002 }// end of group Create group Update { /** * @desc Check that the IUT updates successfully the accessControlPolicyIDs attribute of the <AE> resource when the AE has privileges for UPDATE operation in any selfPrivileges of the <accessControlPolicy> resources which this attribute originally indicates. * */ testcase TC_CSE_SEC_ACP_UPD_001() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_acpIndex1 := -1; var integer v_acpIndex2 := -1; var RequestPrimitive v_createRequestAcp1 := valueof(m_createAcp(f_getResourceAddress(-1), omit)); var RequestPrimitive v_createRequestAcp2 := valueof(m_createAcp(f_getResourceAddress(-1), omit)); var RequestPrimitive v_updateRequest := valueof(m_updateAeBase); var AccessControlRule v_accessControlRule_1; var AccessControlRule v_accessControlRule_2; var SetOfAcrs v_setOfArcs_1; var SetOfAcrs v_setOfArcs_2; var PrimitiveContent v_primitiveContentRetrievedResource; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_acpIndex1 := f_cse_createResource(int1, v_createRequestAcp1); // CSE child resource v_acpIndex2 := f_cse_createResource(int1, v_createRequestAcp2); // CSE child resource v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex1].resource)}, -); v_accessControlRule_1 := valueof(m_createAcr({f_getOriginator(v_aeIndex)}, int59)); // c_CRUDNDi v_accessControlRule_2 := valueof(m_createAcr({PX_SUPER_AE_ID, f_getOriginator(v_aeIndex)}, int63)); // c_CRDNDi v_setOfArcs_1.accessControlRule_list := {v_accessControlRule_1}; v_setOfArcs_2.accessControlRule_list := {v_accessControlRule_2}; v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs_1, v_setOfArcs_2)); v_updateRequest := f_getUpdateRequestPrimitive(int1, v_acpIndex1, v_updateRequest); f_cse_updateResource(v_updateRequest); // Test Body v_updateRequest.primitiveContent.aE.accessControlPolicyIDs := {f_getResourceId(vc_resourcesList[v_acpIndex2].resource)}; v_updateRequest := f_getUpdateRequestPrimitive(int1, v_aeIndex, v_updateRequest); mcaPort.send(m_request(v_updateRequest)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Successful Update operation on resource type int2 (Ae)"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while Update operation on resource type int2 (Ae)"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while executing update operation on resource type int2 (Ae)"); } } v_primitiveContentRetrievedResource := f_cse_retrieveResource(v_aeIndex); if(getverdict == pass){ if(ischosen(v_primitiveContentRetrievedResource.aE)) { if(not match (f_resourceIdCleaner(v_primitiveContentRetrievedResource.aE.accessControlPolicyIDs[0]), v_updateRequest.primitiveContent.aE.accessControlPolicyIDs[0])){ setverdict(fail, __SCOPE__ & ": Error: Access Control policy ID attribute not updated correctly"); } } } //Postamble f_cse_postamble_deleteResources(); //Tear down f_cf01Down(); }//end TC_CSE_SEC_ACP_UPD_001 /** * @desc Check that the IUT responds with an error when the AE tries an UPDATE operation on the accessControlPolicyIDs attribute without having privileges for such operation in any selfPrivileges of the <accessControlPolicy> resources which this attribute originally indicates. * */ testcase TC_CSE_SEC_ACP_UPD_002() runs on AeSimu system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_acpIndex1 := -1; var integer v_acpIndex2 := -1; var RequestPrimitive v_createRequestAcp1 := valueof(m_createAcp(f_getResourceAddress(-1), omit)); var RequestPrimitive v_createRequestAcp2 := valueof(m_createAcp(f_getResourceAddress(-1), omit)); var RequestPrimitive v_updateRequest; var AccessControlRule v_accessControlRule_1; var AccessControlRule v_accessControlRule_2; var SetOfAcrs v_setOfArcs_1; var SetOfAcrs v_setOfArcs_2; var PrimitiveContent v_primitiveContentRetrievedResource; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_acpIndex1 := f_cse_createResource(int1, v_createRequestAcp1); // CSE child resource v_acpIndex2 := f_cse_createResource(int1, v_createRequestAcp2); // CSE child resource v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex1].resource)}, -); v_accessControlRule_1 := valueof(m_createAcr({f_getOriginator(v_aeIndex)}, int63)); // c_CRDNDi v_accessControlRule_2 := valueof(m_createAcr({PX_SUPER_AE_ID, f_getOriginator(v_aeIndex)}, int59)); // c_CRUDNDi v_setOfArcs_1.accessControlRule_list := {v_accessControlRule_1}; v_setOfArcs_2.accessControlRule_list := {v_accessControlRule_2}; v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs_1, v_setOfArcs_2)); v_updateRequest := f_getUpdateRequestPrimitive(int1, v_acpIndex1, v_updateRequest); f_cse_updateResource(v_updateRequest); // Test Body v_updateRequest := valueof(m_updateAeBase); v_updateRequest.primitiveContent.aE.accessControlPolicyIDs := {f_getResourceId(vc_resourcesList[v_acpIndex2].resource)}; v_updateRequest := f_getUpdateRequestPrimitive(int1, v_aeIndex, v_updateRequest); mcaPort.send(m_request(v_updateRequest)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Operation denied because of lack of right on Container"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error operation have been accpeted without having privileges"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int3 (Container)"); } } v_primitiveContentRetrievedResource := f_cse_retrieveResource(v_aeIndex); if(getverdict == pass){ if(ischosen(v_primitiveContentRetrievedResource.aE)) { if(match(v_primitiveContentRetrievedResource.aE.accessControlPolicyIDs, valueof(v_updateRequest.primitiveContent.aE.accessControlPolicyIDs))){ setverdict(fail, __SCOPE__ & ": Error: Access Control policy ID attribute updated") } } } //Postamble f_cse_postamble_deleteResources(); //Tear down f_cf01Down(); }//end TC_CSE_SEC_ACP_UPD_002 }// end of group Update group Basic_Operations { group g_CSE_SEC_ACP_001{ /** * @desc Check that the IUT responds with an error when an ORIGINATOR tries an OPERATION without having privileges for performing the OPERATION on the TARGET_RESOURCE_TYPE resource. * */ testcase TC_CSE_SEC_ACP_001_CRE() runs on Tester system CseSystem { //Create var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_SEC_ACP_001(m_createContainerBase)); v_ae1.done; }//end TC_CSE_SEC_ACP_001_CRE testcase TC_CSE_SEC_ACP_001_UPD() runs on Tester system CseSystem { //Update var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_updateRequest := m_updateAeBase; var Labels v_labels_1:= {"VALUE_1"}; v_updateRequest.primitiveContent.aE.labels := v_labels_1; v_ae1.start(f_CSE_SEC_ACP_001(v_updateRequest)); v_ae1.done; }//end TC_CSE_SEC_ACP_001_UPD testcase TC_CSE_SEC_ACP_001_RET() runs on Tester system CseSystem { //Retrieve var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_SEC_ACP_001(m_retrieveResource("Temporary", "Temporary"))); v_ae1.done; }//end TC_CSE_SEC_ACP_001_RET testcase TC_CSE_SEC_ACP_001_DEL() runs on Tester system CseSystem { //Delete var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_SEC_ACP_001(m_delete("Temporary", "Temporary"))); v_ae1.done; }//end TC_CSE_SEC_ACP_001_DEL function f_CSE_SEC_ACP_001(template RequestPrimitive p_requestPrimitive) runs on AeSimu { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_acpIndex := -1; var RequestPrimitive v_createRequest := valueof(m_createAcpBase); var RequestPrimitive v_updateRequest; var AccessControlRule v_accessControlRule_1; var SetOfAcrs v_setOfArcs; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -); v_accessControlRule_1 := valueof(m_createAcr({ f_getOriginator(v_aeIndex), PX_SUPER_AE_ID}, int63)); v_setOfArcs.accessControlRule_list := {v_accessControlRule_1}; v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs, v_setOfArcs)); v_updateRequest := f_getUpdateRequestPrimitive(int1, v_acpIndex, v_updateRequest); f_cse_updateResource(v_updateRequest); // Test Body p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); p_requestPrimitive.from_ := "UnknowOriginator"; p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); mcaPort.send(m_request(valueof(p_requestPrimitive))); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Operation denied because of lack of right on Container"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error operation have been accpeted without having privileges"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int3 (Container)"); } } //Postamble //We are forced to delete the Ae because the delete request in the postamble_deleteResources is sent by Ae itself, witch doesn't have privileges if(testcasename() == "TC_CSE_SEC_ACP_001_DEL") { f_cse_deleteResource(v_aeIndex, m_delete(f_getResourceAddress(v_aeIndex), f_getOriginator()));//Use of PX_SUPER_AE_ID to remove AE } f_cse_postamble_deleteResources(); //Tear down f_cf01Down(); } //end f_CSE_SEC_ACP_001 } //end g_CSE_SEC_ACP_001 group g_CSE_SEC_ACP_002{ /** * @desc Check that the IUT responds successfully when the AE tries an OPERATION on its <AE> resource which has multiple accessControlPolicyID attribute * */ testcase TC_CSE_SEC_ACP_002_CRE() runs on Tester system CseSystem { //Create var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_SEC_ACP_002(m_createContainerBase, int2001)); v_ae1.done; }//end TC_CSE_SEC_ACP_002_CRE testcase TC_CSE_SEC_ACP_002_UPD() runs on Tester system CseSystem { //Update var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_updateRequest := m_updateAeBase; var Labels v_labels_1:= {"VALUE_1"}; v_updateRequest.primitiveContent.aE.labels := v_labels_1; v_ae1.start(f_CSE_SEC_ACP_002(v_updateRequest, int2004)); v_ae1.done; }//end TC_CSE_SEC_ACP_002_UPD testcase TC_CSE_SEC_ACP_002_RET() runs on Tester system CseSystem { //Retrieve var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_SEC_ACP_002(m_retrieveResource("Temporary", "Temporary"), int2000)); v_ae1.done; }//end TC_CSE_SEC_ACP_002_RET testcase TC_CSE_SEC_ACP_002_DEL() runs on Tester system CseSystem { //Delete var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_SEC_ACP_002(m_delete("Temporary", "Temporary"), int2002)); v_ae1.done; }//end TC_CSE_SEC_ACP_002_DEL function f_CSE_SEC_ACP_002(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_acpIndex1 := -1; var integer v_acpIndex2 := -1; var RequestPrimitive v_createRequest := valueof(m_createAcp(f_getResourceAddress(-1), omit)); var RequestPrimitive v_updateRequest; var AccessControlRule v_accessControlRule_1; var SetOfAcrs v_setOfArcs; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_acpIndex1 := f_cse_createResource(int1, v_createRequest); // CSE child resource v_acpIndex2 := f_cse_createResource(int1, v_createRequest); // CSE child resource v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex1].resource), f_getResourceId(vc_resourcesList[v_acpIndex2].resource)}, -); v_accessControlRule_1 := valueof(m_createAcr({f_getOriginator(v_aeIndex)}, int3)); // c_CR v_setOfArcs.accessControlRule_list := {v_accessControlRule_1}; v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs, -)); v_updateRequest := f_getUpdateRequestPrimitive(int1, v_acpIndex1, v_updateRequest); f_cse_updateResource(v_updateRequest); v_accessControlRule_1 := valueof(m_createAcr({f_getOriginator(v_aeIndex)}, int60)); // c_UDNDi v_setOfArcs.accessControlRule_list := {v_accessControlRule_1}; v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs, -)); v_updateRequest := f_getUpdateRequestPrimitive(int1, v_acpIndex2, v_updateRequest); f_cse_updateResource(v_updateRequest); // Test Body p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); mcaPort.send(m_request(valueof(p_requestPrimitive))); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Successful operation on resource type int2 (Ae)"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while operation on resource type int2 (Ae)"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int2 (Ae)"); } } //Postamble f_cse_postamble_deleteResources(); //Tear down f_cf01Down(); } //end f_CSE_SEC_ACP_002 } //end g_CSE_SEC_ACP_002 group g_CSE_SEC_ACP_003 { /** * @desc Check that the IUT responds successfully when an allowed DOMAIN tries an OPERATION on a AE_RESOURCE_TYPE resource. * */ testcase TC_CSE_SEC_ACP_003_CRE() runs on Tester system CseSystem { //Create var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_SEC_ACP_003(m_createContainerBase, int2001)); v_ae1.done; }//end TC_CSE_SEC_ACP_003_CRE testcase TC_CSE_SEC_ACP_003_UPD() runs on Tester system CseSystem { //Update var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_updateRequest := m_updateAeBase; var Labels v_labels_1:= {"VALUE_1"}; v_updateRequest.primitiveContent.aE.labels := v_labels_1; v_ae1.start(f_CSE_SEC_ACP_003(v_updateRequest, int2004)); v_ae1.done; }//end TC_CSE_SEC_ACP_003_02 testcase TC_CSE_SEC_ACP_003_RET() runs on Tester system CseSystem { //Retrieve var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_SEC_ACP_003(m_retrieveResource("Temporary", "Temporary"), int2000)); v_ae1.done; }//end TC_CSE_SEC_ACP_003_03 testcase TC_CSE_SEC_ACP_003_DEL() runs on Tester system CseSystem { //Delete var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_SEC_ACP_003(m_delete("Temporary", "Temporary"), int2002)); v_ae1.done; }//end TC_CSE_SEC_ACP_003_04 function f_CSE_SEC_ACP_003(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu{ // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_acpIndex := -1; var RequestPrimitive v_createRequest; var AccessControlRule v_accessControlRule_1; var RequestPrimitive v_updateRequest; var SetOfAcrs v_setOfArcs; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_createRequest := valueof(m_createAcp(f_getResourceAddress(), -, {"testDomain"})); v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -); // Test Body p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); p_requestPrimitive.from_ := "testDomain"; p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); mcaPort.send(m_request(valueof(p_requestPrimitive))); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Successful operation on resource type int2 (Ae)"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while operation on resource type int2 (Ae)"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int2 (Ae)"); } } //Postamble v_accessControlRule_1 := valueof(m_createAcr({"*"}, int63)); v_setOfArcs.accessControlRule_list := {v_accessControlRule_1}; v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs, v_setOfArcs)); v_updateRequest := f_getUpdateRequestPrimitive(int1, v_acpIndex, v_updateRequest); v_updateRequest.from_ := "testDomain"; mcaPort.send(m_request(v_updateRequest)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; log(__SCOPE__ & ":INFO: Attribute of resource type ACP updated successfully"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; log(__SCOPE__ & ":INFO: Error while updating resource type ACP"); } [] tc_ac.timeout { log(__SCOPE__ & ":INFO: No answer while updating resource type ACP"); } } f_cse_postamble_deleteResources(); //Tear down f_cf01Down(); }//end f_CSE_SEC_ACP_003 }//end g_CSE_SEC_ACP_003 group g_CSE_SEC_ACP_004 { /** * @desc Check that the IUT responds successfully when any ORIGINATOR tries an OPERATION on a AE_RESOURCE_TYPE resource for which all originators are allowed * */ testcase TC_CSE_SEC_ACP_004_CRE() runs on Tester system CseSystem { //Create var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_SEC_ACP_004(m_createContainerBase, int2001)); v_ae1.done; }//end TC_CSE_SEC_ACP_004_CRE testcase TC_CSE_SEC_ACP_004_UPD() runs on Tester system CseSystem { //Update var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_updateRequest := m_updateAeBase; var Labels v_labels_1:= {"VALUE_1"}; v_updateRequest.primitiveContent.aE.labels := v_labels_1; v_ae1.start(f_CSE_SEC_ACP_004(v_updateRequest, int2004)); v_ae1.done; }//end TC_CSE_SEC_ACP_004_UPD testcase TC_CSE_SEC_ACP_004_RET() runs on Tester system CseSystem { //Retrieve var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_SEC_ACP_004(m_retrieveResource("Temporary", "Temporary"), int2000)); v_ae1.done; }//end TC_CSE_SEC_ACP_004_RET testcase TC_CSE_SEC_ACP_004_DEL() runs on Tester system CseSystem { //Delete var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_SEC_ACP_004(m_delete("Temporary", "Temporary"), int2002)); v_ae1.done; }//end TC_CSE_SEC_ACP_004_DEL function f_CSE_SEC_ACP_004(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu{ // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_acpIndex := -1; var RequestPrimitive v_createRequest; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1); v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -); // Test Body p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); p_requestPrimitive.from_ := "UnknowOriginator"; p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); mcaPort.send(m_request(valueof(p_requestPrimitive))); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Successful operation on resource type int2 (Ae)"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while operation on resource type int2 (Ae)"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int2 (Ae)"); } } //Postamble f_cse_postamble_deleteResources(); //Tear down f_cf01Down(); }//end f_CSE_SEC_ACP_004 }//end g_CSE_SEC_ACP_004 group g_CSE_SEC_ACP_011 { /** * @desc Check that the IUT responds successfully when the AE tries an OPERATION on its child <container> resource whose accessControlPolicyID attribute is not set and AE has privileges for such OPERATION on its associated accessControlPolicy resource * */ testcase TC_CSE_SEC_ACP_011_CRE() runs on Tester system CseSystem { //Create var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_SEC_ACP_011(m_createContainerBase, int2001)); v_ae1.done; }//end TC_CSE_SEC_ACP_011_CRE testcase TC_CSE_SEC_ACP_011_UPD() runs on Tester system CseSystem { //Update var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_updateRequest := m_updateContainerBase; var Labels v_labels_1:= {"VALUE_1"}; v_updateRequest.primitiveContent.container.labels := v_labels_1; v_ae1.start(f_CSE_SEC_ACP_011(v_updateRequest, int2004)); v_ae1.done; }//end TC_CSE_SEC_ACP_011_UPD testcase TC_CSE_SEC_ACP_011_RET() runs on Tester system CseSystem { //Retrieve var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_SEC_ACP_011(m_retrieveResource("Temporary", "Temporary"), int2000)); v_ae1.done; }//end TC_CSE_SEC_ACP_011_RET testcase TC_CSE_SEC_ACP_011_DEL() runs on Tester system CseSystem { //Delete var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_SEC_ACP_011(m_delete("Temporary", "Temporary"), int2002)); v_ae1.done; }//end TC_CSE_SEC_ACP_011_DEL function f_CSE_SEC_ACP_011(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_containerIndex := -1; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe(-, -); v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); // Test Body p_requestPrimitive.to_ := f_getResourceAddress(v_containerIndex); p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); mcaPort.send(m_request(valueof(p_requestPrimitive))); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Successful operation on resource type int3 (Container)"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error while operation on resource type int3 (Container)"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int3 (Container)"); } } //Postamble f_cse_postamble_deleteResources(); //Tear down f_cf01Down(); } //end f_CSE_SEC_ACP_011 } //end g_CSE_SEC_ACP_011 group g_CSE_SEC_ACP_012 { /** * @desc Check that the IUT responds with an error when an ORIGINATOR tries an OPERATION on a <Container> resource with no accessControlPolicyID associated and such ORIGINATOR having no privileges for performing the OPERATION on the <Container> resource. * */ testcase TC_CSE_SEC_ACP_012_CRE() runs on Tester system CseSystem { //Create var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_SEC_ACP_012(m_createContainerBase, int62)); v_ae1.done; }//end TC_CSE_SEC_ACP_012_CRE testcase TC_CSE_SEC_ACP_012_UPD() runs on Tester system CseSystem { //Update var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template RequestPrimitive v_updateRequest := m_updateContainerBase; var Labels v_labels_1:= {"VALUE_1"}; v_updateRequest.primitiveContent.container.labels := v_labels_1; v_ae1.start(f_CSE_SEC_ACP_012(v_updateRequest, int59)); v_ae1.done; }//end TC_CSE_SEC_ACP_012_UPD testcase TC_CSE_SEC_ACP_012_RET() runs on Tester system CseSystem { //Retrieve var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_SEC_ACP_012(m_retrieveResource("Temporary", "Temporary"), int61)); v_ae1.done; }//end TC_CSE_SEC_ACP_012_RET testcase TC_CSE_SEC_ACP_012_DEL() runs on Tester system CseSystem { //Delete var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_CSE_SEC_ACP_012(m_delete("Temporary", "Temporary"), int55)); v_ae1.done; }//end TC_CSE_SEC_ACP_012_DEL function f_CSE_SEC_ACP_012(template RequestPrimitive p_requestPrimitive, in AccessControlOperations p_acor) runs on AeSimu { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_containerIndex := -1; var integer v_acpIndex := -1; var RequestPrimitive v_request; var RequestPrimitive v_createRequest := valueof(m_createAcpBase); var RequestPrimitive v_updateRequest; var AccessControlRule v_accessControlRule_1, v_accessControlRule_2; var SetOfAcrs v_setOfArcs; // Test control // Test component configuration f_cf01Up(); // Test adapter configuration // Preamble v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -); v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); v_accessControlRule_1 := valueof(m_createAcr({PX_SUPER_AE_ID}, int63)); v_accessControlRule_2 := valueof(m_createAcr({f_getOriginator(v_aeIndex)}, p_acor)); v_setOfArcs.accessControlRule_list := {v_accessControlRule_1, v_accessControlRule_2}; v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs, -)); v_updateRequest := f_getUpdateRequestPrimitive(int1, v_acpIndex, v_updateRequest); f_cse_updateResource(v_updateRequest); // Test Body v_request := f_getCreateRequestPrimitive(int3, p_requestPrimitive, v_containerIndex); mcaPort.send(m_request(valueof(v_request))); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Operation denied because of lack of right on Container"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error operation have been accpeted without having privileges"); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int3 (Container)"); } } //Postamble //We are forced to delete the Ae because the delete request in the postamble_deleteResources is sent by Ae itself, witch doesn't have privileges if(testcasename() == "TC_CSE_SEC_ACP_012_DEL") { f_cse_deleteResource(v_aeIndex, m_delete(f_getResourceAddress(v_aeIndex), f_getOriginator()));//Use of PX_SUPER_AE_ID to remove AE } f_cse_postamble_deleteResources(); //Tear down f_cf01Down(); } //end f_CSE_SEC_ACP_012 } //end g_CSE_SEC_ACP_012 }// end of Basic_Operations }//end group AccessControlPolicy }//end group Security }//end group CSE }