diff --git a/LibOneM2M/OneM2M_Functions.ttcn b/LibOneM2M/OneM2M_Functions.ttcn index e812745d23c295fd54afdaa1aa5584eca3837da5..69bb20476f3d36cbe20d9494f87fdd386e771536 100644 --- a/LibOneM2M/OneM2M_Functions.ttcn +++ b/LibOneM2M/OneM2M_Functions.ttcn @@ -1192,7 +1192,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)); + } } } @@ -5306,13 +5308,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 9c08c456e6b1f1b887f346767c43f264093c2742..889eeeeed7dc144161a6f3be5da3f87c0b82cbb5 100644 --- a/LibOneM2M/OneM2M_Pixits.ttcn +++ b/LibOneM2M/OneM2M_Pixits.ttcn @@ -151,7 +151,7 @@ module OneM2M_Pixits { * @desc Test System settings */ modulepar AeSimuComponentDesc PX_TS_AE1 := { // AE1 component settings - aeIdStem := "", + aeIdStem := omit, appId := "NMyApp1Id", mcaPort := { binding := { @@ -183,7 +183,7 @@ module OneM2M_Pixits { } }; modulepar AeSimuComponentDesc PX_TS_AE2 := { // AE2 component settings - aeIdStem := "", + aeIdStem := omit, appId := "NMyApp2Id", mcaPort := { binding := { diff --git a/LibOneM2M/OneM2M_Templates.ttcn b/LibOneM2M/OneM2M_Templates.ttcn index b3851c716692a71725ebcd08f4363879c245183a..bc36385c01ef8694910719997329022c864354e9 100644 --- a/LibOneM2M/OneM2M_Templates.ttcn +++ b/LibOneM2M/OneM2M_Templates.ttcn @@ -1850,9 +1850,9 @@ module OneM2M_Templates { template (value) AccessControlRule m_createAcr (in template (value) ListOfURIs p_acor, in template (value) AccessControlOperations p_allowedOperations) := { accessControlOriginators := p_acor,//{"*"},//{PX_AE_ID_STEM}, //{"admin:admin"}, accessControlOperations := p_allowedOperations, - accessControlContexts_list := {}, + accessControlContexts_list := omit, accessControlAuthenticationFlag := omit, - accessControlObjectDetails_list := {} + accessControlObjectDetails_list := omit } /*template (value) CSEBase_optional m_contentCreateCSEBase (in template (value) ServiceSubscribedAppRule p_serviceSubscribedAppRule) := { diff --git a/LibOneM2M/oneM2M_Types b/LibOneM2M/oneM2M_Types index b55ce90a964bd32e0dfd3f48f17f0d938814ecca..69efab890e4654840e4eb5a27a5fdb197473b245 160000 --- a/LibOneM2M/oneM2M_Types +++ b/LibOneM2M/oneM2M_Types @@ -1 +1 @@ -Subproject commit b55ce90a964bd32e0dfd3f48f17f0d938814ecca +Subproject commit 69efab890e4654840e4eb5a27a5fdb197473b245 diff --git a/OneM2M_PermutationFunctions.ttcn b/OneM2M_PermutationFunctions.ttcn index a53e93702f2ca2b3e2a71a0618ded0665c8889a0..6b9c48b7bd5b433516c0341b7d93eeb07f00e47c 100644 --- a/OneM2M_PermutationFunctions.ttcn +++ b/OneM2M_PermutationFunctions.ttcn @@ -2533,9 +2533,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 @@ -2583,7 +2581,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)){ @@ -2727,7 +2725,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)){ @@ -2779,10 +2777,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_mca_port, m_request(v_request)); @@ -3197,9 +3194,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 { @@ -3895,7 +3892,9 @@ module OneM2M_PermutationFunctions { setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } - + + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + // Postamble f_cse_postamble_deleteResources(); @@ -5323,6 +5322,8 @@ module OneM2M_PermutationFunctions { } } + f_checkAeSimuStatus(); + //Used to check that the resource has been updated vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); @@ -5383,6 +5384,8 @@ module OneM2M_PermutationFunctions { } } + f_checkAeSimuStatus(); + vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); // Postamble @@ -5439,8 +5442,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 @@ -5509,6 +5514,8 @@ module OneM2M_PermutationFunctions { } } + f_checkAeSimuStatus(); + vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); // Postamble @@ -5565,6 +5572,8 @@ module OneM2M_PermutationFunctions { } } + f_checkAeSimuStatus(); + vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); // Postamble @@ -5621,6 +5630,8 @@ module OneM2M_PermutationFunctions { } } + f_checkAeSimuStatus(); + vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); // Postamble @@ -5932,6 +5943,8 @@ module OneM2M_PermutationFunctions { } } + f_checkAeSimuStatus(); + vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); //Postamble @@ -6042,6 +6055,8 @@ module OneM2M_PermutationFunctions { } } + f_checkAeSimuStatus(); + vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); //Postamble @@ -6272,13 +6287,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_mca_port, m_request(v_request)); @@ -6347,13 +6362,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_mca_port, m_request(v_request)); @@ -6422,13 +6437,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_mca_port, m_request(v_request)); @@ -6498,12 +6513,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))); @@ -8084,7 +8098,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 @@ -8141,7 +8155,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 @@ -8197,7 +8211,7 @@ module OneM2M_PermutationFunctions { // Preamble v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1); - v_accessControlRule.accessControlContexts_list := {{{}, {{f_getIpv4Address(PX_TS_AE1.mcaPortIn)}, omit}, omit}}; + v_accessControlRule.accessControlContexts_list := {{omit, {{f_getIpv4Address(PX_TS_AE1.mcaPortIn)}, omit}, omit}}; v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule}; vc_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource @@ -8257,7 +8271,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 diff --git a/OneM2M_Testcases_CSE_Release_1.ttcn b/OneM2M_Testcases_CSE_Release_1.ttcn index 79d8dec872a881fd9716b333301300bf5b9a2f0d..46aed999f8d5dbd0d0ca75cc4161d71ab82629cd 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 a766c71ee84219104da449fb25cecffd720231e7..98a635056cf217221395294dfc30e8b6f8e4b218 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;