diff --git a/OneM2M_PermutationFunctions.ttcn b/OneM2M_PermutationFunctions.ttcn index 863cc04b99ef9546fb9c0383d2ea653a189723ae..98a63fc8d96034e4a794507c4a40a2e9462c8a08 100644 --- a/OneM2M_PermutationFunctions.ttcn +++ b/OneM2M_PermutationFunctions.ttcn @@ -826,7 +826,7 @@ module OneM2M_PermutationFunctions { v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); // Test Body - //Force usage of Non-Hierarchical addressing method + //Force usage of Hierarchical addressing method v_addressingMethod := e_hierarchical; v_primitiveScope := p_primitiveScope; v_request := f_getCreateRequestPrimitive(int3, m_createContainerBase, v_resourceIndex); @@ -860,7 +860,7 @@ module OneM2M_PermutationFunctions { }//end f_CSE_GEN_CRE_002 - function f_CSE_GEN_CRE_003(in PrimitiveScope p_primitiveScope) runs on AeSimu { + function f_CSE_GEN_CRE_004(in PrimitiveScope p_primitiveScope) runs on AeSimu { // Local variables var RequestPrimitive v_request; @@ -918,7 +918,7 @@ module OneM2M_PermutationFunctions { // Tear down f_cf01Down(); - }//end f_CSE_GEN_CRE_003 + }//end f_CSE_GEN_CRE_004 } // end of group Create @@ -1007,7 +1007,7 @@ module OneM2M_PermutationFunctions { v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); // Test Body - //Force usage of Non-Hierarchical addressing method + //Force usage of Hierarchical addressing method v_addressingMethod := e_hierarchical; v_primitiveScope := p_primitiveScope; @@ -1038,6 +1038,62 @@ module OneM2M_PermutationFunctions { }//end f_CSE_GEN_RET_002 + function f_CSE_GEN_RET_004(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 Hybrid Hierarchical addressing method + v_addressingMethod := e_hybrid; + v_primitiveScope := p_primitiveScope; + + mcaPort.send(f_getMsgOutPrimitive(m_request(m_retrieve(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 hybrid 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 hybrid 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_004 + } // end of group Retrieve group Update { @@ -1131,7 +1187,7 @@ module OneM2M_PermutationFunctions { v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); // Test Body - //Force usage of Non-Hierarchical addressing method + //Force usage of Hierarchical addressing method v_addressingMethod := e_hierarchical; v_primitiveScope := p_primitiveScope; @@ -1168,6 +1224,69 @@ module OneM2M_PermutationFunctions { }//end f_CSE_GEN_UPD_002 + function f_CSE_GEN_UPD_004(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 Hybrid Hierarchical addressing method + v_addressingMethod := e_hybrid; + 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(f_getMsgOutPrimitive(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_004 + } // end of group Update group Delete { @@ -1258,7 +1377,7 @@ module OneM2M_PermutationFunctions { v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); // Test Body - //Force usage of Non-Hierarchical addressing method + //Force usage of Hierarchical addressing method v_addressingMethod := e_hierarchical; v_primitiveScope := p_primitiveScope; @@ -1292,6 +1411,66 @@ module OneM2M_PermutationFunctions { }//end f_CSE_GEN_DEL_002 + function f_CSE_GEN_DEL_004(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 Hybrid Hierarchical addressing method + v_addressingMethod := e_hybrid; + v_primitiveScope := p_primitiveScope; + + v_request := valueof(m_delete(f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope), f_getOriginator(v_resourceIndex))); + + mcaPort.send(f_getMsgOutPrimitive(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_004 + } // end of group Delete } // end of group Generic diff --git a/OneM2M_Testcases_CSE_Release_2.ttcn b/OneM2M_Testcases_CSE_Release_2.ttcn index 367bf4a0db2c24128b1d230c2a621dc67c87555b..478fb2362064b6ed773488efd44b4c2bfb693929 100644 --- a/OneM2M_Testcases_CSE_Release_2.ttcn +++ b/OneM2M_Testcases_CSE_Release_2.ttcn @@ -83,56 +83,182 @@ module OneM2M_Testcases_CSE_Release_2 { group Create { - group g_CSE_GEN_CRE_003 { + group g_CSE_GEN_CRE_004 { /** * @desc Check that the IUT accepts the creation of a <container> resource using structured resource identifier with hybrid addressing. * */ - testcase TC_CSE_GEN_CRE_003_CSR() runs on Tester system CseSystem { + testcase TC_CSE_GEN_CRE_004_CSR() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1)); v_ae1.done; - v_ae1.start(f_CSE_GEN_CRE_003(e_cseRelative)); + v_ae1.start(f_CSE_GEN_CRE_004(e_cseRelative)); v_ae1.done; } - testcase TC_CSE_GEN_CRE_003_SPR() runs on Tester system CseSystem { + testcase TC_CSE_GEN_CRE_004_SPR() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1)); v_ae1.done; - v_ae1.start(f_CSE_GEN_CRE_003(e_spRelative)); + v_ae1.start(f_CSE_GEN_CRE_004(e_spRelative)); v_ae1.done; } - testcase TC_CSE_GEN_CRE_003_ABS() runs on Tester system CseSystem { + testcase TC_CSE_GEN_CRE_004_ABS() runs on Tester system CseSystem { // Local variables var AeSimu v_ae1 := AeSimu.create("AE1") alive; v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1)); v_ae1.done; - v_ae1.start(f_CSE_GEN_CRE_003(e_absolute)); + v_ae1.start(f_CSE_GEN_CRE_004(e_absolute)); v_ae1.done; } - } // end of group g_CSE_GEN_CRE_003 + } // end of group g_CSE_GEN_CRE_004 } // end of group Create group Retrieve { + + group g_CSE_GEN_RET_004 { + + /** + * @desc Check that the IUT accepts the retrieval of a <container> resource using structured resource identifier with hybrid addressing. + * + */ + testcase TC_CSE_GEN_RET_004_CSR() runs on Tester system CseSystem { + // Local variables + + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1)); + v_ae1.done; + + v_ae1.start(f_CSE_GEN_RET_004(e_cseRelative)); + v_ae1.done; + } + + testcase TC_CSE_GEN_RET_004_SPR() runs on Tester system CseSystem { + // Local variables + + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1)); + v_ae1.done; + + v_ae1.start(f_CSE_GEN_RET_004(e_spRelative)); + v_ae1.done; + } + + testcase TC_CSE_GEN_RET_004_ABS() runs on Tester system CseSystem { + // Local variables + + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1)); + v_ae1.done; + + v_ae1.start(f_CSE_GEN_RET_004(e_absolute)); + v_ae1.done; + } + + } // end of group g_CSE_GEN_RET_004 + } // end of group Retrieve group Update { + + group g_CSE_GEN_UPD_004 { + + /** + * @desc Check that the IUT accepts the update of a <container> resource using structured resource identifier with hybrid addressing.. + * + */ + testcase TC_CSE_GEN_UPD_004_CSR() runs on Tester system CseSystem { + // Local variables + + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1)); + v_ae1.done; + + v_ae1.start(f_CSE_GEN_UPD_004(e_cseRelative)); + v_ae1.done; + } + + testcase TC_CSE_GEN_UPD_004_SPR() runs on Tester system CseSystem { + // Local variables + + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1)); + v_ae1.done; + + v_ae1.start(f_CSE_GEN_UPD_004(e_spRelative)); + v_ae1.done; + } + + testcase TC_CSE_GEN_UPD_004_ABS() runs on Tester system CseSystem { + // Local variables + + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1)); + v_ae1.done; + + v_ae1.start(f_CSE_GEN_UPD_004(e_absolute)); + v_ae1.done; + } + + } // end of group g_CSE_GEN_UPD_004 + } // end of group Update group Delete { + + group g_CSE_GEN_DEL_004 { + + /** + * @desc Check that the IUT accepts the deletion of a <container> resource using structured resource identifier with hybrid addressing. + * + */ + testcase TC_CSE_GEN_DEL_004_CSR() runs on Tester system CseSystem { + // Local variables + + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1)); + v_ae1.done; + + v_ae1.start(f_CSE_GEN_DEL_004(e_cseRelative)); + v_ae1.done; + } + + testcase TC_CSE_GEN_DEL_004_SPR() runs on Tester system CseSystem { + // Local variables + + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1)); + v_ae1.done; + + v_ae1.start(f_CSE_GEN_DEL_004(e_spRelative)); + v_ae1.done; + } + + testcase TC_CSE_GEN_DEL_004_ABS() runs on Tester system CseSystem { + // Local variables + + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1)); + v_ae1.done; + + v_ae1.start(f_CSE_GEN_DEL_004(e_absolute)); + v_ae1.done; + } + + } // end of group g_CSE_GEN_DEL_004 + } // end of group Delete } // end of group Generic