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..2e90ebb12ecd7e52545b1f9f9559b7c9067a6902 100644 --- a/OneM2M_PermutationFunctions.ttcn +++ b/OneM2M_PermutationFunctions.ttcn @@ -3128,9 +3128,7 @@ module OneM2M_PermutationFunctions { } 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)); @@ -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 { @@ -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(); @@ -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 @@ -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 @@ -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)); @@ -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))); 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;