diff --git a/LibOneM2M/OneM2M_Functions.ttcn b/LibOneM2M/OneM2M_Functions.ttcn index 22c64e0366476d6ed1bc023b5853c90216dd5d68..91ac1b30862f243f0bc15a9a113867187b7826f5 100644 --- a/LibOneM2M/OneM2M_Functions.ttcn +++ b/LibOneM2M/OneM2M_Functions.ttcn @@ -682,11 +682,10 @@ module OneM2M_Functions { if(p_resourceType == int23){ vc_ae2.start(f_cse_createAccessControlPolicyAux("SubscriptionVerificationAcp",{"all"}, int63)); - vc_ae2.done; - vc_ae2.start(f_cse_createResource_withAcpAux(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, c_defaultAE2Name, {f_getAnnouncementTargetPoA("HTTP", PX_AE2_ADDRESS, "")}), -1)); // AE2 is registred - vc_ae2.done; + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); - f_checkComponentDoneAndGetVerdict(vc_ae2); + vc_ae2.start(f_cse_createResource_withAcpAux(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, c_defaultAE2Name, {f_getAnnouncementTargetPoA("HTTP", PX_AE2_ADDRESS, "")}), -1)); // AE2 is registred + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); p_ae2Index := f_getResource(vc_ae2); if(ischosen(p_createRequestPrimitive.primitiveContent.subscription)){ //this condition is necessary for Subscription TCs where notification URI is set in m_createSubscriptionAdvanced @@ -3376,10 +3375,21 @@ module OneM2M_Functions { if (getverdict != pass) { f_cse_postamble_deleteResources(); + if(vc_auxiliaryAe2Up) { + if(vc_ae2.running) { + vc_ae2.stop; + } + vc_ae2.start(f_cse_postamble_deleteResources()); + vc_ae2.done; + + } // Tear down if(vc_config == e_cf01) { f_cf01Down(); } else if (vc_config ==e_cf02) { + if(vc_cse1.running) { + vc_cse1.stop; + } vc_cse1.start(f_cse_postamble_deleteResourcesCSE()); vc_cse1.done; f_cf02Down(); @@ -3394,7 +3404,7 @@ module OneM2M_Functions { * @param data Corresponding information for the correct execution of the given action * @verdict */ - function f_checkComponentDoneAndGetVerdict(AeSimu p_ae) runs on AeSimu { + function f_aeSimu_checkComponentDoneAndGetVerdict(AeSimu p_ae) runs on AeSimu { var verdicttype v_verdict := none; @@ -3417,6 +3427,35 @@ module OneM2M_Functions { f_checkAeSimuStatus(); } + /** + * @desc Sending of an Adapter Control primitive + * @param event Action to be performed by TA + * @param data Corresponding information for the correct execution of the given action + * @verdict + */ + function f_cseSimu_checkComponentDoneAndGetVerdict(AeSimu p_ae) runs on CseSimu { + + var verdicttype v_verdict := none; + + tc_ac.start(15.0); + alt { + [] p_ae.done -> value v_verdict { + tc_ac.stop; + } + [] tc_ac.timeout { + setverdict(inconc, __SCOPE__ & "INFO: Component did not finish"); + } + } + + if(v_verdict == pass) { // Component was successfully completed and got stopped state + setverdict(pass); + } else { + setverdict(inconc); // Component was not completed successfully + } + + f_checkCseSimuStatus(); + } + /** * @desc Sending of an Adapter Control primitive * @param event Action to be performed by TA @@ -3430,6 +3469,7 @@ module OneM2M_Functions { // Tear down //f_cfAeTesterDown(); f_cse_postamble_deleteResourcesCSE(); + //Tear down if(vc_config == e_cf03) { f_cf03Down(); stop; @@ -3437,6 +3477,11 @@ module OneM2M_Functions { f_cf04Down(); stop; } else if (vc_config == e_cf02CseSimuMaster) { + if(vc_ae1.running) { + vc_ae1.stop; + } + vc_ae1.start(f_cse_postamble_deleteResources()); + vc_ae1.done; f_cf02DownCseSimuMaster(); stop; } diff --git a/OneM2M_PermutationFunctions.ttcn b/OneM2M_PermutationFunctions.ttcn index e4bdd37ecd44befc0c81ee631c54102960aeec3b..49bb2a438a1890aa89c0acdad6a6a4f68df3ba3f 100644 --- a/OneM2M_PermutationFunctions.ttcn +++ b/OneM2M_PermutationFunctions.ttcn @@ -1796,9 +1796,11 @@ module OneM2M_PermutationFunctions { if(ispresent(p_parentRequestPrimitive)) { if(match(int23, p_parentRequestPrimitive.resourceType)){ vc_ae2.start(f_cse_preamble_createAcpAux("SubscriptionVerificationAcp", int63)); - vc_ae2.done; + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + vc_ae2.start(f_cse_createResource_withAcpAux(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, c_defaultAE2Name, v_poaList), -1)); // AE2 is registred - vc_ae2.done; + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + v_ae2Index := f_getResource(vc_ae2); p_parentRequestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_ae2Index)}; vc_ae2.start(f_cse_notifyProcedure_subscriptionVerificationHandler()); @@ -1833,9 +1835,9 @@ module OneM2M_PermutationFunctions { if(match(int23, p_requestPrimitive.resourceType)){ vc_ae2.start(f_cse_preamble_createAcpAux("SubscriptionVerificationAcp", int63)); - vc_ae2.done; + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); vc_ae2.start(f_cse_createResource_withAcpAux(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, c_defaultAE2Name, v_poaList), -1)); // AE2 is registred - vc_ae2.done; + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); v_ae2Index := f_getResource(vc_ae2); p_requestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_ae2Index)}; vc_ae2.start(f_cse_notifyProcedure_subscriptionVerificationHandler()); @@ -1907,9 +1909,9 @@ module OneM2M_PermutationFunctions { if(match(int23, p_resourceType)){ vc_ae1.start(f_cse_preamble_createAcpAux("SubscriptionVerificationAcp", int63)); - vc_ae1.done; + f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1); vc_ae1.start(f_cse_createResource_withAcpAux(int2, m_createAe(PX_APP_ID, -, PX_AE1_ID_STEM, "MyAe", v_poaList), -1)); // AE1 is registered - vc_ae1.done; + f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1); v_ae1Index := f_getResource(vc_ae1); p_requestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_ae1Index)}; vc_ae1.start(f_cse_notifyProcedure_subscriptionVerificationHandler()); diff --git a/OneM2M_Testcases_CSE_Release_1.ttcn b/OneM2M_Testcases_CSE_Release_1.ttcn index 29b72ba32dc571c48d03a3e47ead31b1e718fe6e..13f3a88196c2646fda7b37e566f11d9dbd2f3e62 100644 --- a/OneM2M_Testcases_CSE_Release_1.ttcn +++ b/OneM2M_Testcases_CSE_Release_1.ttcn @@ -745,7 +745,8 @@ module OneM2M_Testcases_CSE_Release_1 { vc_remoteCseIndex := f_cse_registrationRemoteCse(mw_createRemoteCSE); vc_ae1.start(f_cse_createResource(int2, m_createAe(PX_APP_ID, omit, "S"))); - vc_ae1.done; + f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1); + //TODO: //v_request := valueof(m_delete(f_getResourceAddress(v_aeIndex), f_getOriginator(v_aeIndex))); @@ -7962,7 +7963,7 @@ module OneM2M_Testcases_CSE_Release_1 { vc_ae2.stop; }; - f_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); // Test Body v_notificationRequest := f_getRequestPrimitive(vc_ae2); @@ -8041,7 +8042,7 @@ module OneM2M_Testcases_CSE_Release_1 { } } - f_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble f_cse_postamble_deleteResources(); @@ -8116,7 +8117,7 @@ module OneM2M_Testcases_CSE_Release_1 { } }; - f_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble f_cse_postamble_deleteResources(); @@ -8192,7 +8193,7 @@ module OneM2M_Testcases_CSE_Release_1 { } } - f_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); v_notificationRequest := f_getRequestPrimitive(vc_ae2); diff --git a/OneM2M_Testcases_CSE_Release_2.ttcn b/OneM2M_Testcases_CSE_Release_2.ttcn index df11592a036f1daf20008b2c82a4468ea6c79554..389eaf3a1aeb67b1d120d248f6b776954af6c24c 100644 --- a/OneM2M_Testcases_CSE_Release_2.ttcn +++ b/OneM2M_Testcases_CSE_Release_2.ttcn @@ -5850,7 +5850,7 @@ module OneM2M_Testcases_CSE_Release_2 { } } - f_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); //Check to see if the resource is NOT present if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ @@ -5915,7 +5915,7 @@ module OneM2M_Testcases_CSE_Release_2 { } } - f_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); //Check to see if the resource is NOT present if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ @@ -5994,7 +5994,7 @@ module OneM2M_Testcases_CSE_Release_2 { setverdict(fail, __SCOPE__ & ": Notifications sent before bathNotify/duration expired"); } - f_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble f_cse_postamble_deleteResources(); @@ -6075,7 +6075,7 @@ module OneM2M_Testcases_CSE_Release_2 { } } - f_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble f_cse_postamble_deleteResources(); @@ -6121,7 +6121,7 @@ module OneM2M_Testcases_CSE_Release_2 { v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription - f_checkComponentDoneAndGetVerdict(vc_ae2); + 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 @@ -6148,7 +6148,7 @@ module OneM2M_Testcases_CSE_Release_2 { } } - f_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble f_cse_postamble_deleteResources(); @@ -6205,7 +6205,7 @@ module OneM2M_Testcases_CSE_Release_2 { v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // AE update request f_cse_updateResource(v_request); // AE update - f_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)))); @@ -6233,7 +6233,7 @@ module OneM2M_Testcases_CSE_Release_2 { } } - f_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble f_cse_postamble_deleteResources(); @@ -6287,7 +6287,7 @@ module OneM2M_Testcases_CSE_Release_2 { v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // AE update request f_cse_updateResource(v_request); // AE update - f_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)))); @@ -6310,7 +6310,7 @@ module OneM2M_Testcases_CSE_Release_2 { } } - f_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble f_cse_postamble_deleteResources(); @@ -6383,7 +6383,7 @@ module OneM2M_Testcases_CSE_Release_2 { } } - f_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble f_cse_postamble_deleteResources(); @@ -6448,7 +6448,7 @@ module OneM2M_Testcases_CSE_Release_2 { v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 3 f_cse_updateResource(v_request); - f_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble f_cse_postamble_deleteResources(); @@ -6517,7 +6517,7 @@ module OneM2M_Testcases_CSE_Release_2 { v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 3 f_cse_updateResource(v_request); - f_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble f_cse_postamble_deleteResources(); @@ -6592,7 +6592,7 @@ module OneM2M_Testcases_CSE_Release_2 { } } - f_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble f_cse_postamble_deleteResources(); @@ -6671,7 +6671,7 @@ module OneM2M_Testcases_CSE_Release_2 { } } - f_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble f_cse_postamble_deleteResources(); @@ -6743,7 +6743,7 @@ module OneM2M_Testcases_CSE_Release_2 { } } - f_checkComponentDoneAndGetVerdict(vc_ae2); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); //Postamble f_cse_postamble_deleteResources();