diff --git a/LibOneM2M/OneM2M_Functions.ttcn b/LibOneM2M/OneM2M_Functions.ttcn index 711167330043bff4743e4383a1f35306f912c190..9cbd91703600209dc3fac6d310b6d6e0dad5e64a 100644 --- a/LibOneM2M/OneM2M_Functions.ttcn +++ b/LibOneM2M/OneM2M_Functions.ttcn @@ -1548,7 +1548,9 @@ module OneM2M_Functions { if(ischosen(p_createRequestPrimitive.primitiveContent.subscription)){ //this condition is necessary for Subscription TCs where notification URI is set in m_createSubscriptionAdvanced p_createRequestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(p_ae2Index)}; } - vc_ae2.start(f_cse_notifyProcedure_subscriptionVerificationHandler(p_responseStatusCode)); + if(PICS_SUBSCRIPTION_VERIFICATION) { + vc_ae2.start(f_cse_notifyProcedure_subscriptionVerificationHandler(p_responseStatusCode)); + } } } @@ -6820,13 +6822,16 @@ module OneM2M_Functions { } [] tc_done.timeout { setverdict(inconc, __SCOPE__ & "INFO: Component did not finish"); + f_checkAeSimuStatus(); } } - if(v_verdict == pass) { // Component was successfully completed and got stopped state - setverdict(pass); - } else { - setverdict(inconc); // Component was not completed successfully + if(v_verdict != none) {//Component started at least once (except config) + if(v_verdict == pass) { // Component was successfully completed and got stopped state + setverdict(pass); + } else { + setverdict(inconc); // Component was not completed successfully + } } f_checkAeSimuStatus(); diff --git a/LibOneM2M/OneM2M_Pixits.ttcn b/LibOneM2M/OneM2M_Pixits.ttcn index 951705a53cba5509ca67a6d25d3046d3b594bd4d..617c5df9b80523113b134efc483a1e0d028ceca2 100644 --- a/LibOneM2M/OneM2M_Pixits.ttcn +++ b/LibOneM2M/OneM2M_Pixits.ttcn @@ -155,7 +155,7 @@ module OneM2M_Pixits { * @desc Test System settings */ modulepar AeSimuComponentDesc PX_TS_AE1 := { // AE1 component settings - aeIdStem := "", + aeIdStem := omit, appId := "NMyApp1Id", mcaPort := { binding := { @@ -189,7 +189,7 @@ module OneM2M_Pixits { } }; modulepar AeSimuComponentDesc PX_TS_AE2 := { // AE2 component settings - aeIdStem := "", + aeIdStem := omit, appId := "NMyApp2Id", mcaPort := { binding := { diff --git a/OneM2M_PermutationFunctions.ttcn b/OneM2M_PermutationFunctions.ttcn index 5d3d2059f3076db53747f2dee63b3591ae7fa2ad..c80e79eddd4a45d334ce294d4b7418f2d877e84a 100644 --- a/OneM2M_PermutationFunctions.ttcn +++ b/OneM2M_PermutationFunctions.ttcn @@ -729,7 +729,7 @@ module OneM2M_PermutationFunctions { }//end SUB subgroup group Onthology_Based_Interworking { - + group Registration { function f_AE_OBI_REG_001() runs on CseSimu { @@ -1452,8 +1452,8 @@ module OneM2M_PermutationFunctions { // Tear down f_cf01Down(); - }//end f_CSE_GEN_CRE_002 - + }//end f_CSE_GEN_CRE_002 + function f_CSE_GEN_CRE_003(in PrimitiveScope p_primitiveScope) runs on AeSimu system CseSystem { // Local variables @@ -1539,7 +1539,7 @@ module OneM2M_PermutationFunctions { // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - + v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); v_groupRequest.primitiveContent.group_.memberIDs := {f_getResourceId(vc_resourcesList[v_resourceIndex].resource)}; @@ -1792,7 +1792,7 @@ module OneM2M_PermutationFunctions { v_addressingMethod := e_nonHierarchical; v_request := valueof(m_retrieve(f_getResourceAddress(v_groupIndex, v_addressingMethod, p_primitiveScope), f_getOriginator(v_groupIndex))); v_request.to_ := v_request.to_ & "/fopt"; - + f_send(e_mcaPort, m_request(valueof(v_request))); tc_ac.start; alt { @@ -1818,7 +1818,7 @@ module OneM2M_PermutationFunctions { // Tear down f_cf01Down(); - + }//end f_CSE_GEN_RET_004 } // end of group Retrieve @@ -2051,7 +2051,7 @@ module OneM2M_PermutationFunctions { v_addressingMethod := e_nonHierarchical; v_updateRequest.to_ := f_getResourceAddress(v_groupIndex, v_addressingMethod, p_primitiveScope); v_updateRequest.to_ := v_updateRequest.to_ & "/fopt"; - + f_send(e_mcaPort, m_request(v_updateRequest)); tc_ac.start; alt { @@ -2077,7 +2077,7 @@ module OneM2M_PermutationFunctions { // Tear down f_cf01Down(); - + }//end f_CSE_GEN_UPD_004 } // end of group Update @@ -2299,7 +2299,7 @@ module OneM2M_PermutationFunctions { v_addressingMethod := e_nonHierarchical; v_request := valueof(m_delete(f_getResourceAddress(v_groupIndex, v_addressingMethod, p_primitiveScope), f_getOriginator(v_resourceIndex))); v_request.to_ := v_request.to_ & "/fopt"; - + f_send(e_mcaPort, m_request(v_request)); tc_ac.start; alt { @@ -2337,7 +2337,7 @@ module OneM2M_PermutationFunctions { group Create{ function f_CSE_REG_CRE_001(in XSD.ID p_aeIdStem) runs on AeSimu system CseSystem { - + var MsgIn v_response; var RequestPrimitive v_request; var integer v_cseBaseIndex := -1; @@ -2446,228 +2446,228 @@ module OneM2M_PermutationFunctions { function f_CSE_REG_CRE_012(in template RequestPrimitive p_createAe) runs on AeSimu system CseSystem { - //Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var ResourceType v_resourceType := int2; //AE - - // Test control + //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); - // Test component configuration - f_cf01Up(); - - //Test Body - - v_request := valueof(p_createAe); - v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, -1); - f_send(e_mcaPort, 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); + 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_aeIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int2); - - 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"); - } + + 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(); } - - function f_CSE_REG_CRE_013(template RequestPrimitive p_requestPrimitive, in AttributeAux p_optionalAttribute) runs on CseSimu system CseSystem { - - // 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); + //Postamble + f_cse_postamble_deleteResources(); - f_send(e_mccPort, 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_response.primitive.responsePrimitive.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_response.primitive.responsePrimitive.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_response.primitive.responsePrimitive.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"); - } - } + // Tear down + f_cf01Down(); + } - // Postamble - f_cse_postamble_deleteResourcesCSE(); - - // Tear down - f_cf04Down(); - - }//end f_CSE_REG_CRE_BV_013 - + function f_CSE_REG_CRE_013(template RequestPrimitive p_requestPrimitive, in AttributeAux p_optionalAttribute) runs on CseSimu system CseSystem { + + // 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); + + f_send(e_mccPort, 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_response.primitive.responsePrimitive.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_response.primitive.responsePrimitive.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_response.primitive.responsePrimitive.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 + + function f_CSE_REG_CRE_017(template RequestPrimitive p_createRequestPrimitive) runs on AeSimu system CseSystem { - - //Local variables - var ResourceType v_resourceType := int2; - var RequestPrimitive v_request; - - // Test control + + //Local variables + var ResourceType v_resourceType := int2; + var RequestPrimitive v_request; + + // Test control - // Test component configuration - f_cf01Up(); + // Test component configuration + f_cf01Up(); - // Test adapter configuration + // Test adapter configuration - // Preamble + // Preamble - // Test Body - v_request := f_getCreateRequestPrimitive(int2, p_createRequestPrimitive, -1); - + // Test Body + v_request := f_getCreateRequestPrimitive(int2, p_createRequestPrimitive, -1); + f_send(e_mcaPort, 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)){ - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error, AE has been registered"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); - } - } + 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(); + // Postamble + f_cse_postamble_deleteResources(); - // Tear down - f_cf01Down(); - - } + // Tear down + f_cf01Down(); + + } function f_CSE_REG_CRE_026(template UtTriggerPrimitive p_utRequest, template RequestPrimitive p_request, in universal charstring p_action) runs on CseSimu system CseSystem { - - var MsgIn v_request; - var ResponsePrimitive v_responsePrimitive; - - //Test control - if(not(PICS_MN_CSE or PICS_ASN_CSE)) { - setverdict(inconc, __SCOPE__ & ": IUT shall be MN-CSE or ASN-CSE to run this test case"); - stop; - } + + var MsgIn v_request; + var ResponsePrimitive v_responsePrimitive; + + //Test control + if(not(PICS_MN_CSE or PICS_ASN_CSE)) { + setverdict(inconc, __SCOPE__ & ": IUT shall be MN-CSE or ASN-CSE to run this test case"); + stop; + } - //Test component configuration - f_cf04Up(); + //Test component configuration + f_cf04Up(); - //send triggering primitive to SUT + //send triggering primitive to SUT f_cse_sendUtPrimitive_cseSimu(p_utRequest,p_action); - //Test behavior - tc_ac.start; - alt{ + //Test behavior + tc_ac.start; + alt{ - //receive MsgIn requestPrimitive - [] mccPortIn.receive(mw_request(p_request)) -> value v_request { - tc_ac.stop; - setverdict(pass, __SCOPE__&":INFO: Resource type remoteCSE created successfuly"); + //receive MsgIn requestPrimitive + [] mccPortIn.receive(mw_request(p_request)) -> value v_request { + tc_ac.stop; + setverdict(pass, __SCOPE__&":INFO: Resource type remoteCSE created successfuly"); - //set responseStatusCode back to SUT - v_responsePrimitive := valueof(m_responsePrimitive(int2001, v_request.primitive.requestPrimitive.requestIdentifier, omit)); + //set responseStatusCode back to SUT + v_responsePrimitive := valueof(m_responsePrimitive(int2001, v_request.primitive.requestPrimitive.requestIdentifier, omit)); - //send back responsePrimitive + //send back responsePrimitive f_send(e_mccPortIn, m_response(v_responsePrimitive)); - } - [] mccPortIn.receive { - tc_ac.stop; - setverdict(fail, __SCOPE__&":INFO: Unexpected message received"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__&":INFO: No request received for creating resource type remoteCSE"); - } } - - // Postamble - f_cse_postamble_deleteResourcesCSE(); - - // Tear down - f_cf04Down(); - + [] mccPortIn.receive { + tc_ac.stop; + setverdict(fail, __SCOPE__&":INFO: Unexpected message received"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__&":INFO: No request received for creating resource type remoteCSE"); + } } - + + // Postamble + f_cse_postamble_deleteResourcesCSE(); + + // Tear down + f_cf04Down(); + + } + 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_cseSimu(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 + //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_cseSimu(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 group Create @@ -3108,7 +3108,7 @@ module OneM2M_PermutationFunctions { var integer v_resourceIndex := -1; var integer v_ae2Index := -1; var template RequestPrimitive v_parentRequestPrimitive; - + // Test control // Test component configuration @@ -3123,14 +3123,12 @@ module OneM2M_PermutationFunctions { if(match(int23, p_parentRequestPrimitive.resourceType)){ f_cse_preamble_subscriptionVerification(v_ae2Index, v_parentRequestPrimitive, int23, -); } - if(ischosen(p_parentRequestPrimitive.primitiveContent.group_)){ + if(ischosen(p_parentRequestPrimitive.primitiveContent.group_)) { f_cse_preamble_registerAe(); } v_parentIndex := f_cse_createResource(valueof(v_parentRequestPrimitive.resourceType), v_parentRequestPrimitive, v_parentIndex); - if(vc_ae2.running) { - vc_ae2.stop; - } + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); } else {//Resource under CSEBase @@ -3178,7 +3176,7 @@ module OneM2M_PermutationFunctions { } } - f_checkAeSimuStatus(); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); //Check to see if the resource is present or not if (f_cse_isResourcePresent(v_resourceIndex)){ @@ -3326,7 +3324,7 @@ module OneM2M_PermutationFunctions { } } - f_checkAeSimuStatus(); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); //Check to see if the resource is present or not if(f_cse_isResourcePresent(v_resourceIndex)){ @@ -3382,10 +3380,9 @@ module OneM2M_PermutationFunctions { v_request.requestIdentifier := "Existing resource"; if(p_resourceType == int23){ - if(vc_ae2.running) { - f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + if(PICS_SUBSCRIPTION_VERIFICATION) { + vc_ae2.start(f_cse_notifyProcedure_subscriptionVerificationHandler()); } - vc_ae2.start(f_cse_notifyProcedure_subscriptionVerificationHandler()); } f_send(e_mcaPort, m_request(v_request)); @@ -3769,7 +3766,7 @@ module OneM2M_PermutationFunctions { if(p_resourceType == int4) { v_parentIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); } - + if(p_resourceType == int30) { v_parentIndex := f_cse_createResource(int29, m_createTimeSeriesBase, v_aeIndex); } @@ -3808,9 +3805,9 @@ module OneM2M_PermutationFunctions { } } - f_checkAeSimuStatus(); - - //Check to see if the resource is present or not + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + + //Check to see if the resource is present or not if(f_cse_isResourcePresent(v_resourceIndex)) { setverdict(pass, __SCOPE__ & ":INFO: Resource created"); } else { @@ -4330,7 +4327,7 @@ module OneM2M_PermutationFunctions { v_aEAnncIndex := f_cse_createResource_cseSimu(int10002, m_createAEAnnc(-, vc_cseSimuDesc.cseId, omit, -), vc_remoteCseIndex); //AEAnnnc under RemoteCSE // Test Body - + v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aEAnncIndex); f_send(e_mccPort, m_request(v_request)); @@ -4379,7 +4376,7 @@ module OneM2M_PermutationFunctions { var integer v_parentIndex := -1; var template RequestPrimitive v_create := m_createAe(PX_TS_AE1.appId, omit, omit); v_create.primitiveContent.aE.announceTo := {PX_TS_CSE1.cseId}; - + // Test control // Test component configuration @@ -4408,8 +4405,8 @@ module OneM2M_PermutationFunctions { // Test Body vc_cse1.start(f_cse_announcementProcedure_createHandler(p_requestAnnc)); f_cse_createResource(p_resourceType, p_requestPrimitive, v_parentIndex); - f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1); - + f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1); + // Postamble f_cse_postamble_deleteResources(); @@ -4425,7 +4422,7 @@ module OneM2M_PermutationFunctions { var integer v_parentIndex := -1; var template RequestPrimitive v_create := m_createAe(PX_TS_AE1.appId, omit, omit); v_create.primitiveContent.aE.announceTo := {PX_TS_CSE1.cseId}; - + // Test control // Test component configuration @@ -4436,12 +4433,12 @@ module OneM2M_PermutationFunctions { // Preamble vc_cse1.start(f_cse_registerRemoteCse(m_createRemoteCSE_poa(-, -, -, -, -, {f_getLocalPoA()}))); - f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1); vc_cse1.start(f_cse_announcementProcedure_createHandler(mw_createAEAnnc(-, -, -))); v_aeIndex := f_cse_createResource(int2,v_create); - f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1); - + f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1); + if(p_resourceType == int4) { v_create := m_createContainerBase; v_create.primitiveContent.container.announceTo := {PX_TS_CSE1.cseId}; @@ -4455,8 +4452,8 @@ module OneM2M_PermutationFunctions { // Test Body vc_cse1.start(f_cse_announcementProcedure_createHandler(p_requestAnnc)); f_cse_createResource(p_resourceType, p_requestPrimitive, v_parentIndex); - f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1); - + f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1); + // Postamble f_cse_postamble_deleteResources(); @@ -4527,7 +4524,9 @@ module OneM2M_PermutationFunctions { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } - + + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + // Postamble f_cse_postamble_deleteResources(); @@ -4628,7 +4627,7 @@ module OneM2M_PermutationFunctions { if(p_resourceType != int18) { v_parentIndex := v_aeIndex;//For resources that can have AE resource as parent } - + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_parentIndex); // Test Body @@ -4749,7 +4748,7 @@ module OneM2M_PermutationFunctions { if(p_resourceType != int18) { v_parentIndex := v_aeIndex;//For resources that can have AE resource as parent } - + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_parentIndex); // Test Body @@ -4868,7 +4867,7 @@ module OneM2M_PermutationFunctions { if(p_resourceType != int18) { v_parentIndex := v_aeIndex;//For resources that can have AE resource as parent } - + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_parentIndex); // Test Body @@ -5115,7 +5114,7 @@ module OneM2M_PermutationFunctions { f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive);//under the CSEBase resource - + if (p_resourceType==int2){ v_aeIndex := v_resourceIndex; } @@ -5200,7 +5199,7 @@ module OneM2M_PermutationFunctions { f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive);//under the CSEBase resource - + if (p_resourceType==int2){ v_aeIndex := v_resourceIndex; } @@ -5284,7 +5283,7 @@ module OneM2M_PermutationFunctions { f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive);//under the CSEBase resource - + if (p_resourceType==int2){ v_aeIndex := v_resourceIndex; } @@ -5725,7 +5724,7 @@ module OneM2M_PermutationFunctions { v_parentIndex := v_aeIndex;//For resources that can have AE resource as parent } v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_parentIndex); - + if(p_resourceType != int15) { v_childResourceIndex := f_cse_createResource(valueof(p_childResourceType), p_childRequestPrimitive, v_resourceIndex); } @@ -5910,7 +5909,7 @@ module OneM2M_PermutationFunctions { f_cf01Down(); }//end f_CSE_DMR_RET_025 - + function f_CSE_DMR_RET_026(ResourceType p_resourceType, template PrimitiveContent p_originalResource, template RequestPrimitive p_createRequestAnnc) runs on AeSimu system CseSystem { //Local variables @@ -6078,7 +6077,7 @@ module OneM2M_PermutationFunctions { var integer v_resourceIndex := -1; var integer v_ae2Index := -1; var integer v_parentIndex := -1; - + // Test control // Test component configuration @@ -6119,6 +6118,8 @@ module OneM2M_PermutationFunctions { } } + f_checkAeSimuStatus(); + //Used to check that the resource has been updated vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); @@ -6183,6 +6184,8 @@ module OneM2M_PermutationFunctions { } } + f_checkAeSimuStatus(); + vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); // Postamble @@ -6243,8 +6246,10 @@ module OneM2M_PermutationFunctions { [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); } - } - + } + + f_checkAeSimuStatus(); + vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); // Postamble @@ -6292,7 +6297,7 @@ module OneM2M_PermutationFunctions { v_parentIndex := v_aeIndex;//For resources that can have AE resource as parent } v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_parentIndex); - + // Test Body v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); @@ -6316,6 +6321,8 @@ module OneM2M_PermutationFunctions { } } + f_checkAeSimuStatus(); + vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); // Postamble @@ -6376,6 +6383,8 @@ module OneM2M_PermutationFunctions { } } + f_checkAeSimuStatus(); + vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); // Postamble @@ -6436,6 +6445,8 @@ module OneM2M_PermutationFunctions { } } + f_checkAeSimuStatus(); + vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); // Postamble @@ -6751,6 +6762,8 @@ module OneM2M_PermutationFunctions { } } + f_checkAeSimuStatus(); + vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); //Postamble @@ -6861,6 +6874,8 @@ module OneM2M_PermutationFunctions { } } + f_checkAeSimuStatus(); + vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); //Postamble @@ -6900,16 +6915,16 @@ module OneM2M_PermutationFunctions { vc_ae1.start(f_cse_createResource(int2,v_create)); f_cse_announcementProcedure_createHandler(mw_createAEAnnc(-, -, -)); f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1); - + v_aeIndex:= f_getLatestResourceIndex(vc_ae1); if(p_resourceType != int18) { v_parentIndex := v_aeIndex;//For resources that can have AE resource as parent } - + vc_ae1.start(f_cse_createResource(p_resourceType, p_requestCreatePrimitive, v_parentIndex)); f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1); - + v_latestResourceIndex := f_getLatestResourceIndex(vc_ae1); // Test Body @@ -6934,7 +6949,7 @@ module OneM2M_PermutationFunctions { } } f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1); - + // Postamble f_cse_postamble_deleteResourcesCSE(); @@ -6952,7 +6967,7 @@ module OneM2M_PermutationFunctions { var integer v_latestResourceIndex; var ResponsePrimitive v_responsePrimitive; var template RequestPrimitive v_create := m_createAe(PX_TS_AE1.appId, omit, omit); - + v_create.primitiveContent.aE.announceTo := {PX_TS_CSE1.cseId}; //Test control @@ -6979,7 +6994,7 @@ module OneM2M_PermutationFunctions { vc_ae1.start(f_cse_createResource(p_resourceType, p_requestCreatePrimitive, v_parentIndex)); f_cse_announcementProcedure_createHandler(p_createRequestAnnc); f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1); - + v_latestResourceIndex := f_getLatestResourceIndex(vc_ae1); p_updateRequestAnnc.to_ := f_getLocalResourceAddress(lengthof(vc_localResourcesList)-1); @@ -7002,7 +7017,7 @@ module OneM2M_PermutationFunctions { } } f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1); - + // Postamble f_cse_postamble_deleteResourcesCSE(); @@ -7101,13 +7116,13 @@ module OneM2M_PermutationFunctions { v_childResourceIndex := f_cse_createResource(valueof(p_childResourceType), p_childRequestPrimitive, v_resourceIndex); } + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + // Test Body v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); v_request.resultContent := int0;//Nothing if(valueof(p_childResourceType) == int23) { - if (vc_ae2.running) { - vc_ae2.stop; - } + vc_ae2.start(f_cse_notifyProcedure_defaultHandler()); } f_send(e_mcaPort, m_request(v_request)); @@ -7170,7 +7185,7 @@ module OneM2M_PermutationFunctions { f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, valueof(p_resourceType)); } } - + if(p_resourceType != int18) { v_parentIndex := v_aeIndex;//For resources that can have AE resource as parent } @@ -7180,13 +7195,13 @@ module OneM2M_PermutationFunctions { v_childResourceIndex := f_cse_createResource(valueof(p_childResourceType), p_childRequestPrimitive, v_resourceIndex); } + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + // Test Body v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); v_request.resultContent := int1;//Attributes if(valueof(p_childResourceType) == int23) { - if (vc_ae2.running) { - vc_ae2.stop; - } + vc_ae2.start(f_cse_notifyProcedure_defaultHandler()); } f_send(e_mcaPort, m_request(v_request)); @@ -7259,13 +7274,13 @@ module OneM2M_PermutationFunctions { v_childResourceIndex := f_cse_createResource(valueof(p_childResourceType), p_childRequestPrimitive, v_resourceIndex); } + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + // Test Body v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); v_request.resultContent := int9;//Modified Attributes if(valueof(p_childResourceType) == int23) { - if (vc_ae2.running) { - vc_ae2.stop; - } + vc_ae2.start(f_cse_notifyProcedure_defaultHandler()); } f_send(e_mcaPort, m_request(v_request)); @@ -7335,12 +7350,11 @@ module OneM2M_PermutationFunctions { v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_parentIndex); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + // Test Body if(p_resourceType == int23) { - if (vc_ae2.running) { - vc_ae2.stop; - } - vc_ae2.start(f_cse_notifyProcedure_noNotificationHandler()); + vc_ae2.start(f_cse_notifyProcedure_defaultHandler()); } v_request := valueof(m_delete(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); @@ -7391,7 +7405,7 @@ module OneM2M_PermutationFunctions { var integer v_resourceIndex := -1; var integer v_ae2Index := -1; var integer v_parentIndex := -1; - + // Test control if(not(PICS_ACP_SUPPORT)) { setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); @@ -7738,7 +7752,7 @@ module OneM2M_PermutationFunctions { f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, valueof(p_resourceType)); } } - + if(p_resourceType != int18) { v_parentIndex := v_aeIndex;//For resources that can have AE resource as parent } @@ -8155,9 +8169,9 @@ module OneM2M_PermutationFunctions { }//end f_CSE_DMR_DEL_017 }//end group Delete - + }//end group Data_Management_and_Repository - + group Group_Managment { group Create { @@ -8251,7 +8265,7 @@ module OneM2M_PermutationFunctions { } // end f_CSE_GMG_001 function f_CSE_GMG_002(template RequestPrimitive p_requestPrimitive, in AccessControlOperations p_accessControlOperations) runs on AeSimu system CseSystem { - // Local variables + //Local variables var integer v_aeIndex := -1; var integer v_acpIndex := -1; var integer v_containerIndex_1 := -1; @@ -8391,7 +8405,7 @@ module OneM2M_PermutationFunctions { } // end f_CSE_GMG_003 function f_CSE_GMG_004(template RequestPrimitive p_requestPrimitive, in AccessControlOperations p_accessControlOperations) runs on AeSimu system CseSystem { - // Local variables + //Local variables var integer v_aeIndex := -1; var integer v_acpIndex := -1; var integer v_containerIndex_1 := -1; @@ -8458,7 +8472,7 @@ module OneM2M_PermutationFunctions { //Local constants const integer c_numberOfResponsePrimitive := 2; - // Local variables + //Local variables var integer v_acpIndex, v_aeIndex_1, v_aeIndex_2 := -1; var integer v_groupIndex := -1; var ListOfURIs v_memberIDs; @@ -8479,7 +8493,7 @@ module OneM2M_PermutationFunctions { // Preamble v_acpIndex := f_cse_createResource(int1, v_createAcp, -); // AE child resource - + v_acpIds := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; v_aeIndex_1 := f_cse_preamble_registerAe(v_acpIds, -); //c_CRUDNDi @@ -8587,11 +8601,11 @@ module OneM2M_PermutationFunctions { v_createContainerInAE1 := f_setAcpId(v_createContainerInAE1, v_acpIds); v_containerIndex_1 := f_cse_createResource(int3, v_createContainerInAE1, v_aeIndex_1); // AE1 child resource - + v_createContainerInAE2 := f_setAcpId(v_createContainerInAE2, v_acpIds); vc_ae2.start(f_cse_createResource(int3, v_createContainerInAE2, v_aeIndex_2)); f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); - + v_memberIDs := {f_getResourceId(vc_resourcesList[v_aeIndex_1].resource), f_getResourceId(vc_resourcesList[v_ae2LocalIndex].resource)}; //v_membersAcpIds := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; @@ -8778,7 +8792,7 @@ module OneM2M_PermutationFunctions { //Tear down f_cf01Down(); }// end f_CSE_SUB_CRE_001 - + function f_CSE_SUB_CRE_006(template RequestPrimitive p_createRequest) runs on AeSimu system CseSystem { // Local variables var integer v_aeIndex := -1; @@ -9636,7 +9650,7 @@ module OneM2M_PermutationFunctions { // Preamble v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1); - v_accessControlRule.accessControlContexts_list := {{{}, omit, { choice := { countryCode := {"ES"}}}}}; + v_accessControlRule.accessControlContexts_list := {{omit, omit, { choice := { countryCode := {"ES"}}}}}; v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule}; v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource @@ -9693,7 +9707,7 @@ module OneM2M_PermutationFunctions { // Preamble v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1); - v_accessControlRule.accessControlContexts_list := {{{}, omit, { choice := { countryCode := {"ES"}}}}}; + v_accessControlRule.accessControlContexts_list := {{omit, omit, { choice := { countryCode := {"ES"}}}}}; v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule}; v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource @@ -9809,7 +9823,7 @@ module OneM2M_PermutationFunctions { // Preamble v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1); - v_accessControlRule.accessControlContexts_list := {{{}, {{"240.0.0.0"}, omit}, omit}}; + v_accessControlRule.accessControlContexts_list := {{omit, {{"240.0.0.0"}, omit}, omit}}; v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule}; vc_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource @@ -12107,576 +12121,576 @@ module OneM2M_PermutationFunctions { } - group Non_Blocking_Requests{ - - group Synchronous{ - - function f_CSE_RT_NBS_001(template RequestPrimitive p_requestPrimitive, in template (omit) RequestPrimitive p_parentRequestPrimitive := omit) 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; - - // Test control - if(PICS_NON_BLOCKING_REQUEST_SYNCH){ - setverdict(inconc, __SCOPE__ & ": It is required to not support Non-blocking access resource in synchronous mode to run this test case"); - stop; - } - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble + group Non_Blocking_Requests{ - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + group Synchronous{ - if(ispresent(p_parentRequestPrimitive)) { - v_resourceIndex := f_cse_createResource(valueof(p_parentRequestPrimitive.resourceType), p_parentRequestPrimitive, v_aeIndex); - p_requestPrimitive.to_ := f_getResourceAddress(v_resourceIndex); - }else{ - p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); - } - p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); - p_requestPrimitive.responseType := {int1, omit}; //nonBlockingRequestSynch - - // Test Body - - f_send(e_mcaPort, m_request(valueof(p_requestPrimitive))); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int5206))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Operation rejected because Non-blocking access resource in synchronous mode is not supported"); - } - [] 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 accepted without supporting Non-Blocking Requests"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while executing a Non-blocking access resource in synchronous mode operation"); + function f_CSE_RT_NBS_001(template RequestPrimitive p_requestPrimitive, in template (omit) RequestPrimitive p_parentRequestPrimitive := omit) 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; + + // Test control + if(PICS_NON_BLOCKING_REQUEST_SYNCH){ + setverdict(inconc, __SCOPE__ & ": It is required to not support Non-blocking access resource in synchronous mode to run this test case"); + stop; } - } - f_checkAeSimuStatus(); - - // Postamble - f_cse_postamble_deleteResources(); + // Test component configuration + f_cf01Up(); + + // Test adapter configuration - // Tear down - f_cf01Down(); + // Preamble + + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + if(ispresent(p_parentRequestPrimitive)) { + v_resourceIndex := f_cse_createResource(valueof(p_parentRequestPrimitive.resourceType), p_parentRequestPrimitive, v_aeIndex); + p_requestPrimitive.to_ := f_getResourceAddress(v_resourceIndex); + }else{ + p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); + } + p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); + p_requestPrimitive.responseType := {int1, omit}; //nonBlockingRequestSynch - }//end f_CSE_RT_NBS_001 + // Test Body + + f_send(e_mcaPort, m_request(valueof(p_requestPrimitive))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int5206))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Operation rejected because Non-blocking access resource in synchronous mode is not supported"); + } + [] 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 accepted without supporting Non-Blocking Requests"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while executing a Non-blocking access resource in synchronous mode operation"); + } + } - function f_CSE_RT_NBS_002(template RequestPrimitive p_requestPrimitive, in template (omit) RequestPrimitive p_parentRequestPrimitive := omit) 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 template PrimitiveContent v_contentResponse; - - // Test control - if(not PICS_NON_BLOCKING_REQUEST_SYNCH){ - setverdict(inconc, __SCOPE__ & ": It is required to support Non-blocking access resource in synchronous mode to run this test case"); - stop; - } - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble + f_checkAeSimuStatus(); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_RT_NBS_001 - v_contentResponse.uRI := ?; - - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - if(ispresent(p_parentRequestPrimitive)) { - v_resourceIndex := f_cse_createResource(valueof(p_parentRequestPrimitive.resourceType), p_parentRequestPrimitive, v_aeIndex); - p_requestPrimitive.to_ := f_getResourceAddress(v_resourceIndex); - }else{ - p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); - } - p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); - p_requestPrimitive.responseType := {int1,omit}; //nonBlockingRequestSynch - - // Test Body - - f_send(e_mcaPort, m_request(valueof(p_requestPrimitive))); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int1001, v_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": URI attribute is set to <request> resource address"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitive(int1001))) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": URI attribute is not set to <request> resource address"); - } - [] 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__ & ": Wrong response status code"); + function f_CSE_RT_NBS_002(template RequestPrimitive p_requestPrimitive, in template (omit) RequestPrimitive p_parentRequestPrimitive := omit) 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 template PrimitiveContent v_contentResponse; + + // Test control + if(not PICS_NON_BLOCKING_REQUEST_SYNCH){ + setverdict(inconc, __SCOPE__ & ": It is required to support Non-blocking access resource in synchronous mode to run this test case"); + stop; } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while executing a Non-blocking access resource in synchronous mode operation"); + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + + v_contentResponse.uRI := ?; + + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + if(ispresent(p_parentRequestPrimitive)) { + v_resourceIndex := f_cse_createResource(valueof(p_parentRequestPrimitive.resourceType), p_parentRequestPrimitive, v_aeIndex); + p_requestPrimitive.to_ := f_getResourceAddress(v_resourceIndex); + }else{ + p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); + p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); + p_requestPrimitive.responseType := {int1,omit}; //nonBlockingRequestSynch + // Test Body + + f_send(e_mcaPort, m_request(valueof(p_requestPrimitive))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int1001, v_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": URI attribute is set to <request> resource address"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitive(int1001))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": URI attribute is not set to <request> resource address"); + } + [] 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__ & ": Wrong response status code"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while executing a Non-blocking access resource in synchronous mode operation"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + }//end f_CSE_RT_NBS_002 - - function f_CSE_RT_NBS_003(template RequestPrimitive p_requestPrimitive, in template (omit) RequestPrimitive p_parentRequestPrimitive := omit, in Operation p_operation) 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 template PrimitiveContent v_contentResponseUri; - var template PrimitiveContent v_contentResponseRequestResource; - var RequestStatus v_requestStatus; + function f_CSE_RT_NBS_003(template RequestPrimitive p_requestPrimitive, in template (omit) RequestPrimitive p_parentRequestPrimitive := omit, in Operation p_operation) 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 template PrimitiveContent v_contentResponseUri; + var template PrimitiveContent v_contentResponseRequestResource; + var RequestStatus v_requestStatus; var OneM2M_Types.URI v_requestResourceURI; - var ResponseStatusCode v_statusCode; - var RequestID v_requestIdentifier; - var template PrimitiveContent v_primitiveContent; - - // Test control - if(not PICS_NON_BLOCKING_REQUEST_SYNCH){ - setverdict(inconc, __SCOPE__ & ": It is required to support Non-blocking access resource in synchronous mode to run this test case"); - stop; - } - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - - v_contentResponseUri.uRI := ?; - - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - if(ispresent(p_parentRequestPrimitive)) { - v_resourceIndex := f_cse_createResource(valueof(p_parentRequestPrimitive.resourceType), p_parentRequestPrimitive, v_aeIndex); - p_requestPrimitive.to_ := f_getResourceAddress(v_resourceIndex); - }else{ - p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); - } - p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); - p_requestPrimitive.responseType := {int1, omit}; //nonBlockingRequestSynch - - // Test Body - f_send(e_mcaPort, m_request(valueof(p_requestPrimitive))); - v_requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier; - - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int1001, v_contentResponseUri))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": URI attribute is set to <request> resource address"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitive(int1001))) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": URI attribute is not set to <request> resource address"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); + var ResponseStatusCode v_statusCode; + var RequestID v_requestIdentifier; + var template PrimitiveContent v_primitiveContent; + + // Test control + if(not PICS_NON_BLOCKING_REQUEST_SYNCH){ + setverdict(inconc, __SCOPE__ & ": It is required to support Non-blocking access resource in synchronous mode to run this test case"); + stop; } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + + v_contentResponseUri.uRI := ?; + + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + if(ispresent(p_parentRequestPrimitive)) { + v_resourceIndex := f_cse_createResource(valueof(p_parentRequestPrimitive.resourceType), p_parentRequestPrimitive, v_aeIndex); + p_requestPrimitive.to_ := f_getResourceAddress(v_resourceIndex); + }else{ + p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while executing a Non-blocking access resource in synchronous mode operation"); + p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); + p_requestPrimitive.responseType := {int1, omit}; //nonBlockingRequestSynch + + // Test Body + f_send(e_mcaPort, m_request(valueof(p_requestPrimitive))); + v_requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier; + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int1001, v_contentResponseUri))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": URI attribute is set to <request> resource address"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitive(int1001))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": URI attribute is not set to <request> resource address"); + } + [] 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__ & ": Wrong response status code"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while executing a Non-blocking access resource in synchronous mode operation"); + } } - } - - f_checkAeSimuStatus(); - - //Check to see if the resource is present or not - if (ischosen(v_response.primitive.responsePrimitive.primitiveContent.uRI)){ - v_contentResponseRequestResource.request := mw_contentRequestBase; - v_requestResourceURI := v_response.primitive.responsePrimitive.primitiveContent.uRI; + + f_checkAeSimuStatus(); + + //Check to see if the resource is present or not + if (ischosen(v_response.primitive.responsePrimitive.primitiveContent.uRI)){ + v_contentResponseRequestResource.request := mw_contentRequestBase; + v_requestResourceURI := v_response.primitive.responsePrimitive.primitiveContent.uRI; v_contentResponseRequestResource.request.primitiveContent := p_requestPrimitive.primitiveContent; - if (p_operation == int1){ //create - v_statusCode := int2001; - v_primitiveContent := f_getTemplateFromPrimitiveContent(p_requestPrimitive.primitiveContent); - }else if (p_operation == int2){ //retrieve - v_statusCode := int2000; - v_primitiveContent.container := mw_contentContainer_rc1; - }else if (p_operation == int3){ //update - v_statusCode := int2004; - v_primitiveContent := f_getTemplateFromPrimitiveContent(p_requestPrimitive.primitiveContent); - }else if (p_operation == int4){ //delete - v_statusCode := int2002; + if (p_operation == int1){ //create + v_statusCode := int2001; + v_primitiveContent := f_getTemplateFromPrimitiveContent(p_requestPrimitive.primitiveContent); + }else if (p_operation == int2){ //retrieve + v_statusCode := int2000; + v_primitiveContent.container := mw_contentContainer_rc1; + }else if (p_operation == int3){ //update + v_statusCode := int2004; + v_primitiveContent := f_getTemplateFromPrimitiveContent(p_requestPrimitive.primitiveContent); + }else if (p_operation == int4){ //delete + v_statusCode := int2002; v_primitiveContent := omit; - } + } f_send(e_mcaPort, m_request(m_retrieve(v_requestResourceURI, f_getOriginator(v_aeIndex)))); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponseRequestResource))) -> value v_response{ - setverdict(pass, testcasename() & ": Request resource has been received"); - v_requestStatus := v_response.primitive.responsePrimitive.primitiveContent.request.requestStatus; - if (v_requestStatus==int1){ //COMPLETED - tc_ac.stop; - if (valueof(v_requestIdentifier) == valueof(v_response.primitive.responsePrimitive.primitiveContent.request.operationResult.requestIdentifier) ){ - setverdict(pass, testcasename() & ": RequestStatus: COMPLETED and requestIdentifier attribute correctly received"); - }else{ - setverdict(fail, testcasename() & ": RequestStatus: COMPLETED and requestIdentifier attribute not correctly received"); - } - - if (valueof(v_statusCode) == valueof(v_response.primitive.responsePrimitive.primitiveContent.request.operationResult.responseStatusCode) ){ - setverdict(pass, testcasename() & ": RequestStatus: COMPLETED and responseStatusCode attribute correctly received"); - }else{ - setverdict(fail, testcasename() & ": RequestStatus: COMPLETED and responseStatusCode attribute not correctly received"); - } - - if (match(v_response.primitive.responsePrimitive.primitiveContent.request.operationResult.primitiveContent, v_primitiveContent) ){ - setverdict(pass, testcasename() & ": RequestStatus: COMPLETED and primitiveContent template correctly received"); - }else{ - setverdict(fail, testcasename() & ": RequestStatus: COMPLETED and primitiveContent template not correctly received"); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponseRequestResource))) -> value v_response{ + setverdict(pass, testcasename() & ": Request resource has been received"); + v_requestStatus := v_response.primitive.responsePrimitive.primitiveContent.request.requestStatus; + if (v_requestStatus==int1){ //COMPLETED + tc_ac.stop; + if (valueof(v_requestIdentifier) == valueof(v_response.primitive.responsePrimitive.primitiveContent.request.operationResult.requestIdentifier) ){ + setverdict(pass, testcasename() & ": RequestStatus: COMPLETED and requestIdentifier attribute correctly received"); + }else{ + setverdict(fail, testcasename() & ": RequestStatus: COMPLETED and requestIdentifier attribute not correctly received"); + } + + if (valueof(v_statusCode) == valueof(v_response.primitive.responsePrimitive.primitiveContent.request.operationResult.responseStatusCode) ){ + setverdict(pass, testcasename() & ": RequestStatus: COMPLETED and responseStatusCode attribute correctly received"); + }else{ + setverdict(fail, testcasename() & ": RequestStatus: COMPLETED and responseStatusCode attribute not correctly received"); + } + + if (match(v_response.primitive.responsePrimitive.primitiveContent.request.operationResult.primitiveContent, v_primitiveContent) ){ + setverdict(pass, testcasename() & ": RequestStatus: COMPLETED and primitiveContent template correctly received"); + }else{ + setverdict(fail, testcasename() & ": RequestStatus: COMPLETED and primitiveContent template not correctly received"); + } + + }else if (v_requestStatus==int2){ //FAILED + tc_ac.stop; + setverdict(fail, testcasename() & ": RequestStatus: FAIL"); + }else{ //PENDING, FORWARDING or PARTIALLY_COMPLETED + f_sleep(PX_TAC/5.0); + f_send(e_mcaPort, m_request(m_retrieve(v_requestResourceURI, f_getOriginator(v_aeIndex)))); + repeat; } - - }else if (v_requestStatus==int2){ //FAILED + } + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) { tc_ac.stop; - setverdict(fail, testcasename() & ": RequestStatus: FAIL"); - }else{ //PENDING, FORWARDING or PARTIALLY_COMPLETED - f_sleep(PX_TAC/5.0); - f_send(e_mcaPort, m_request(m_retrieve(v_requestResourceURI, f_getOriginator(v_aeIndex)))); - repeat; + setverdict(fail, testcasename() & ": Request resource not found"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitive(?, -))) { + tc_ac.stop; + setverdict(fail, testcasename() & ": Wrong response status code in the response"); } + [] tc_ac.timeout { + setverdict(fail, testcasename() & ": No answer while retrieving resource"); + } + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_RT_NBS_003 + }//end Group Synchronous + + group Asynchronous{ + + function f_CSE_RT_NBA_001(template RequestPrimitive p_requestPrimitive, in template (omit) RequestPrimitive p_parentRequestPrimitive := omit) 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; + + // Test control + if(PICS_NON_BLOCKING_REQUEST_ASYNCH){ + setverdict(inconc, __SCOPE__ & ": It is required to not support Non-blocking access resource in asynchronous mode to run this test case"); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + if(ispresent(p_parentRequestPrimitive)) { + v_resourceIndex := f_cse_createResource(valueof(p_parentRequestPrimitive.resourceType), p_parentRequestPrimitive, v_aeIndex); + p_requestPrimitive.to_ := f_getResourceAddress(v_resourceIndex); + }else{ + p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); + } + p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); + p_requestPrimitive.responseType := {int2,omit}; //nonBlockingRequestAsynch + // Test Body + + f_send(e_mcaPort, m_request(valueof(p_requestPrimitive))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int1002, omit))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": No content provided with the right status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(omit))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": No content provided with a wrong status code"); } - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) { + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Request resource not found"); + setverdict(fail, __SCOPE__ & ": Content provided"); } - [] mcaPort.receive(mw_response(mw_responsePrimitive(?, -))) { + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Wrong response status code in the response"); + setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] tc_ac.timeout { - setverdict(fail, testcasename() & ": No answer while retrieving resource"); + setverdict(fail, __SCOPE__ & ": No answer while executing a Non-blocking access resource in asynchronous mode operation"); } - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end f_CSE_RT_NBS_003 - }//end Group Synchronous - - group Asynchronous{ - - function f_CSE_RT_NBA_001(template RequestPrimitive p_requestPrimitive, in template (omit) RequestPrimitive p_parentRequestPrimitive := omit) 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; - - // Test control - if(PICS_NON_BLOCKING_REQUEST_ASYNCH){ - setverdict(inconc, __SCOPE__ & ": It is required to not support Non-blocking access resource in asynchronous mode to run this test case"); - stop; - } - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - if(ispresent(p_parentRequestPrimitive)) { - v_resourceIndex := f_cse_createResource(valueof(p_parentRequestPrimitive.resourceType), p_parentRequestPrimitive, v_aeIndex); - p_requestPrimitive.to_ := f_getResourceAddress(v_resourceIndex); - }else{ - p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); - } - p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); - p_requestPrimitive.responseType := {int2,omit}; //nonBlockingRequestAsynch - // Test Body - - f_send(e_mcaPort, m_request(valueof(p_requestPrimitive))); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int1002, omit))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": No content provided with the right status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(omit))) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": No content provided with a wrong status code"); } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Content provided"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while executing a Non-blocking access resource in asynchronous mode operation"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + }//end f_CSE_RT_NBA_001 - + function f_CSE_RT_NBA_002(template RequestPrimitive p_requestPrimitive, in template (omit) RequestPrimitive p_parentRequestPrimitive := omit) 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 template PrimitiveContent v_contentResponse; - - // Test control - if(not PICS_NON_BLOCKING_REQUEST_SYNCH){ - setverdict(inconc, __SCOPE__ & ": It is required to support Non-blocking access resource in synchronous mode to run this test case"); - stop; - } - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - - v_contentResponse.uRI := ?; - - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - if(ispresent(p_parentRequestPrimitive)) { - v_resourceIndex := f_cse_createResource(valueof(p_parentRequestPrimitive.resourceType), p_parentRequestPrimitive, v_aeIndex); - p_requestPrimitive.to_ := f_getResourceAddress(v_resourceIndex); - }else{ - p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); - } - p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); - p_requestPrimitive.responseType := {int2,omit}; //nonBlockingRequestAsynch - - // Test Body - - f_send(e_mcaPort, m_request(valueof(p_requestPrimitive))); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int1002, v_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": URI attribute is set to <request> resource address"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitive(int1002))) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": URI attribute is not set to <request> resource address"); - } - [] 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__ & ": Wrong response status code"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while executing a Non-blocking access resource in synchronous mode operation"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end f_CSE_RT_NBA_002 - function f_CSE_RT_NBA_003(template RequestPrimitive p_requestPrimitive, in template (omit) RequestPrimitive p_parentRequestPrimitive := omit, in ResponseStatusCode p_responseStatusCode) 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 template PrimitiveContent v_contentResponse; - - // Test control - if(not PICS_NON_BLOCKING_REQUEST_SYNCH){ - setverdict(inconc, __SCOPE__ & ": It is required to support Non-blocking access resource in synchronous mode to run this test case"); - stop; - } - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - - v_contentResponse.uRI := ?; - - v_aeIndex := f_cse_preamble_registerAe(-, {f_getLocalPoA(vc_aeSimuDesc.mcaPortIn, "")});//c_CRUDNDi); - if(ispresent(p_parentRequestPrimitive)) { - v_resourceIndex := f_cse_createResource(valueof(p_parentRequestPrimitive.resourceType), p_parentRequestPrimitive, v_aeIndex); - p_requestPrimitive.to_ := f_getResourceAddress(v_resourceIndex); - }else{ - p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); - } - p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); - p_requestPrimitive.responseType := {int2, omit}; //nonBlockingRequestAsynch and no notification target list is provided" - - f_send(e_mcaPort, m_request(valueof(p_requestPrimitive))); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int1002, v_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": URI attribute is set to <request> resource address"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitive(int1002))) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": URI attribute is not set to <request> resource address"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var template PrimitiveContent v_contentResponse; + + // Test control + if(not PICS_NON_BLOCKING_REQUEST_SYNCH){ + setverdict(inconc, __SCOPE__ & ": It is required to support Non-blocking access resource in synchronous mode to run this test case"); + stop; } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + + v_contentResponse.uRI := ?; + + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + if(ispresent(p_parentRequestPrimitive)) { + v_resourceIndex := f_cse_createResource(valueof(p_parentRequestPrimitive.resourceType), p_parentRequestPrimitive, v_aeIndex); + p_requestPrimitive.to_ := f_getResourceAddress(v_resourceIndex); + }else{ + p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while executing a Non-blocking access resource in synchronous mode operation"); + p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); + p_requestPrimitive.responseType := {int2,omit}; //nonBlockingRequestAsynch + + // Test Body + + f_send(e_mcaPort, m_request(valueof(p_requestPrimitive))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int1002, v_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": URI attribute is set to <request> resource address"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitive(int1002))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": URI attribute is not set to <request> resource address"); + } + [] 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__ & ": Wrong response status code"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while executing a Non-blocking access resource in synchronous mode operation"); + } } - } - - f_checkAeSimuStatus(); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_RT_NBA_002 - //Test Body - - //Check to see if the notification is received - f_cse_notifyProcedure_responsePrimitiveHandler(mw_responsePrimitive(p_responseStatusCode)); - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end f_CSE_RT_NBA_003 + function f_CSE_RT_NBA_003(template RequestPrimitive p_requestPrimitive, in template (omit) RequestPrimitive p_parentRequestPrimitive := omit, in ResponseStatusCode p_responseStatusCode) runs on AeSimu system CseSystem{ - function f_CSE_RT_NBA_004(template RequestPrimitive p_requestPrimitive, in template (omit) RequestPrimitive p_parentRequestPrimitive := omit) 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 template PrimitiveContent v_contentResponse; - - // Test control - if(not PICS_NON_BLOCKING_REQUEST_SYNCH){ - setverdict(inconc, __SCOPE__ & ": It is required to support Non-blocking access resource in synchronous mode to run this test case"); - stop; - } - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - - v_contentResponse.uRI := ?; - + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var template PrimitiveContent v_contentResponse; + + // Test control + if(not PICS_NON_BLOCKING_REQUEST_SYNCH){ + setverdict(inconc, __SCOPE__ & ": It is required to support Non-blocking access resource in synchronous mode to run this test case"); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + + v_contentResponse.uRI := ?; + v_aeIndex := f_cse_preamble_registerAe(-, {f_getLocalPoA(vc_aeSimuDesc.mcaPortIn, "")});//c_CRUDNDi); - - if(ispresent(p_parentRequestPrimitive)) { - v_resourceIndex := f_cse_createResource(valueof(p_parentRequestPrimitive.resourceType), p_parentRequestPrimitive, v_aeIndex); - p_requestPrimitive.to_ := f_getResourceAddress(v_resourceIndex); - }else{ - p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); - } - p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); - p_requestPrimitive.responseType.responseTypeValue := int2; //nonBlockingRequestAsynch - p_requestPrimitive.responseType.notificationURI := {}; //"...an empty notification target list is provided" - - // Test Body - - f_send(e_mcaPort, m_request(valueof(p_requestPrimitive))); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int1002, v_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": URI attribute is set to <request> resource address"); + if(ispresent(p_parentRequestPrimitive)) { + v_resourceIndex := f_cse_createResource(valueof(p_parentRequestPrimitive.resourceType), p_parentRequestPrimitive, v_aeIndex); + p_requestPrimitive.to_ := f_getResourceAddress(v_resourceIndex); + }else{ + p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); } - [] mcaPort.receive(mw_response(mw_responsePrimitive(int1002))) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": URI attribute is not set to <request> resource address"); + p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); + p_requestPrimitive.responseType := {int2, omit}; //nonBlockingRequestAsynch and no notification target list is provided" + + f_send(e_mcaPort, m_request(valueof(p_requestPrimitive))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int1002, v_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": URI attribute is set to <request> resource address"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitive(int1002))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": URI attribute is not set to <request> resource address"); + } + [] 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__ & ": Wrong response status code"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while executing a Non-blocking access resource in synchronous mode operation"); + } } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); + + f_checkAeSimuStatus(); + + //Test Body + + //Check to see if the notification is received + f_cse_notifyProcedure_responsePrimitiveHandler(mw_responsePrimitive(p_responseStatusCode)); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_RT_NBA_003 + + function f_CSE_RT_NBA_004(template RequestPrimitive p_requestPrimitive, in template (omit) RequestPrimitive p_parentRequestPrimitive := omit) 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 template PrimitiveContent v_contentResponse; + + // Test control + if(not PICS_NON_BLOCKING_REQUEST_SYNCH){ + setverdict(inconc, __SCOPE__ & ": It is required to support Non-blocking access resource in synchronous mode to run this test case"); + stop; } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + + v_contentResponse.uRI := ?; + + v_aeIndex := f_cse_preamble_registerAe(-, {f_getLocalPoA(vc_aeSimuDesc.mcaPortIn, "")});//c_CRUDNDi); + + if(ispresent(p_parentRequestPrimitive)) { + v_resourceIndex := f_cse_createResource(valueof(p_parentRequestPrimitive.resourceType), p_parentRequestPrimitive, v_aeIndex); + p_requestPrimitive.to_ := f_getResourceAddress(v_resourceIndex); + }else{ + p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while executing a Non-blocking access resource in synchronous mode operation"); + p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); + p_requestPrimitive.responseType.responseTypeValue := int2; //nonBlockingRequestAsynch + p_requestPrimitive.responseType.notificationURI := {}; //"...an empty notification target list is provided" + + // Test Body + + f_send(e_mcaPort, m_request(valueof(p_requestPrimitive))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int1002, v_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": URI attribute is set to <request> resource address"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitive(int1002))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": URI attribute is not set to <request> resource address"); + } + [] 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__ & ": Wrong response status code"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while executing a Non-blocking access resource in synchronous mode operation"); + } } - } - - f_checkAeSimuStatus(); - - //Check if Notification is sent or not - - f_cse_notifyProcedure_noNotificationHandler(); - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - + + f_checkAeSimuStatus(); + + //Check if Notification is sent or not + + f_cse_notifyProcedure_noNotificationHandler(); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + }//end f_CSE_RT_NBA_004 - + function f_CSE_RT_NBA_005(template RequestPrimitive p_requestPrimitive, in template (omit) RequestPrimitive p_parentRequestPrimitive := omit, in ResponseStatusCode p_responseStatusCode) runs on AeSimu system CseSystem{ - + // Local variables var MsgIn v_response; var RequestPrimitive v_request; @@ -12722,7 +12736,7 @@ module OneM2M_PermutationFunctions { p_requestPrimitive.responseType.notificationURI := {f_getResourceAddress(v_aeIndex), f_getResourceAddress(v_ae2Index)}; //"...an empty notification target list is provided" // Test Body - + f_send(e_mcaPort, m_request(valueof(p_requestPrimitive))); tc_ac.start; alt { @@ -12746,9 +12760,9 @@ module OneM2M_PermutationFunctions { setverdict(fail, __SCOPE__ & ": No answer while executing a Non-blocking access resource in synchronous mode operation"); } } - + f_checkAeSimuStatus(); - + //Check if Notification is sent or not @@ -12756,24 +12770,24 @@ module OneM2M_PermutationFunctions { f_cse_notifyProcedure_responsePrimitiveHandler(mw_responsePrimitive(p_responseStatusCode)); - f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); - + }//end f_CSE_RT_NBA_005 - - - }//end Group Asynchronous - - }//end group Non_Blocking_Requests + + }//end Group Asynchronous + + }//end group Non_Blocking_Requests + }//end of group Response_Type group Interworking_3GPP { - + group device_trigerring { function f_CSE_3GPP_TRIG_001(in TriggerPurpose p_triggerPurpose, in template (value) Bytes p_triggerPayload ) runs on ScefSimu system ScefSystem { diff --git a/OneM2M_Testcases_CSE_Release_1.ttcn b/OneM2M_Testcases_CSE_Release_1.ttcn index 11bedb2994b31021ae80fc0a9f3dc2b8e81a923d..a1a152fce4ea0da1cfcb81c882d2cc827b613c22 100644 --- a/OneM2M_Testcases_CSE_Release_1.ttcn +++ b/OneM2M_Testcases_CSE_Release_1.ttcn @@ -8506,20 +8506,24 @@ module OneM2M_Testcases_CSE_Release_1 { function f_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; + 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 control + if(not(PICS_SUBSCRIPTION_VERIFICATION)) { + setverdict(inconc, __SCOPE__ & ": Subscription verification support is required to run this test case"); + stop; + } + + // Test component configuration + f_cf01Up(true); - // Test adapter configuration + // Test adapter configuration - // Preamble + // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); f_cse_preamble_subscriptionVerification(v_ae2Index, v_request, int23); @@ -8529,11 +8533,6 @@ module OneM2M_Testcases_CSE_Release_1 { v_resourceIndex := f_cse_createResource(int23, v_request, v_aeIndex);//Subscription - if(vc_ae2.running) { - setverdict(inconc, __SCOPE__ & ": Notification not received"); - vc_ae2.stop; - }; - f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); // Test Body @@ -8594,10 +8593,8 @@ module OneM2M_Testcases_CSE_Release_1 { v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription - if(vc_ae2.running) { - vc_ae2.stop; - }; - + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + // Test Body v_request:= f_getCreateRequestPrimitive(int3, m_createContainerBase, v_aeIndex); @@ -8623,8 +8620,6 @@ module OneM2M_Testcases_CSE_Release_1 { } } - f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); - //Postamble f_cse_postamble_deleteResources(); @@ -8676,9 +8671,7 @@ module OneM2M_Testcases_CSE_Release_1 { v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription - if(vc_ae2.running) { - vc_ae2.stop; - }; + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); // Test Body v_contentResponse.aE := mw_contentAeBase; // all attributes expected @@ -8763,10 +8756,8 @@ module OneM2M_Testcases_CSE_Release_1 { v_request := valueof(m_delete(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); // Subscription resource deletion request - if(vc_ae2.running) { - vc_ae2.stop; - }; - + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + // Test Body v_notificationContent.subscriptionReference := ?; v_notificationContent.notificationEvent := omit; diff --git a/OneM2M_Testcases_CSE_Release_2.ttcn b/OneM2M_Testcases_CSE_Release_2.ttcn index 0a28580f4e7400d21704cea5199ac0ecc4a0aecd..8f1f92d6e02b7aa447c3168bd8e31637bde41784 100644 --- a/OneM2M_Testcases_CSE_Release_2.ttcn +++ b/OneM2M_Testcases_CSE_Release_2.ttcn @@ -2524,10 +2524,8 @@ module OneM2M_Testcases_CSE_Release_2 { v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex); //Subscription - if(vc_ae2.running) { - vc_ae2.stop; - }; - + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + // 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 @@ -2698,9 +2696,7 @@ module OneM2M_Testcases_CSE_Release_2 { v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex); // Subscription - if(vc_ae2.running) { - vc_ae2.stop; - }; + f_aeSimu_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 @@ -2790,10 +2786,8 @@ module OneM2M_Testcases_CSE_Release_2 { v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);// Subscription - if(vc_ae2.running) { - vc_ae2.stop; - }; - + f_aeSimu_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 f_cse_updateResource(int2, v_aeIndex, v_updateRequest); // AE update request @@ -2877,10 +2871,8 @@ module OneM2M_Testcases_CSE_Release_2 { v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request - if(vc_ae2.running) { - vc_ae2.stop; - }; - + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + // Test Body vc_ae2.start(f_cse_notifyProcedure_noNotificationHandler()); // check that no notification is received @@ -2960,10 +2952,8 @@ module OneM2M_Testcases_CSE_Release_2 { v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription - if(vc_ae2.running) { - vc_ae2.stop; - }; - + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + // Test Body vc_ae2.start(f_cse_notifyProcedure_aggregatedNoficationHandler(v_contentResponse, numberOfAggregatedNotification)); // check that no notification is received @@ -3032,9 +3022,7 @@ module OneM2M_Testcases_CSE_Release_2 { v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription - if(vc_ae2.running) { - vc_ae2.stop; - }; + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); // Test Body v_contentResponse.aE.labels := v_labels_3; @@ -3107,10 +3095,8 @@ module OneM2M_Testcases_CSE_Release_2 { v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request - if(vc_ae2.running) { - vc_ae2.stop; - }; - + f_aeSimu_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 @@ -3190,10 +3176,8 @@ module OneM2M_Testcases_CSE_Release_2 { v_subscriptionResourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex );//Subscription - if(vc_ae2.running) { - vc_ae2.stop; - }; - + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + //Test Body v_notificationContent := {aE:= mw_contentAeBase}; // all attributes expected; @@ -3274,10 +3258,8 @@ module OneM2M_Testcases_CSE_Release_2 { v_subscriptionResourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription (with name attribute omitted) - if(vc_ae2.running) { - vc_ae2.stop; - }; - + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + //Test Body v_notificationContent := {container := mw_contentContainer_rc1}; // all attributes expected;