Fixing handling of PTC sync when errors occur to avoid wrong code behaviour

Signed-off-by: Miguel Angel Reina Ortega's avatarreinaortega <miguelangel.reinaortega@etsi.org>
parent 9176ee90
...@@ -682,11 +682,10 @@ module OneM2M_Functions { ...@@ -682,11 +682,10 @@ module OneM2M_Functions {
if(p_resourceType == int23){ if(p_resourceType == int23){
vc_ae2.start(f_cse_createAccessControlPolicyAux("SubscriptionVerificationAcp",{"all"}, int63)); vc_ae2.start(f_cse_createAccessControlPolicyAux("SubscriptionVerificationAcp",{"all"}, 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, {f_getAnnouncementTargetPoA("HTTP", PX_AE2_ADDRESS, "")}), -1)); // AE2 is registred
vc_ae2.done;
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); 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 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 { ...@@ -3376,10 +3375,21 @@ module OneM2M_Functions {
if (getverdict != pass) { if (getverdict != pass) {
f_cse_postamble_deleteResources(); 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 // Tear down
if(vc_config == e_cf01) { if(vc_config == e_cf01) {
f_cf01Down(); f_cf01Down();
} else if (vc_config ==e_cf02) { } else if (vc_config ==e_cf02) {
if(vc_cse1.running) {
vc_cse1.stop;
}
vc_cse1.start(f_cse_postamble_deleteResourcesCSE()); vc_cse1.start(f_cse_postamble_deleteResourcesCSE());
vc_cse1.done; vc_cse1.done;
f_cf02Down(); f_cf02Down();
...@@ -3394,7 +3404,7 @@ module OneM2M_Functions { ...@@ -3394,7 +3404,7 @@ module OneM2M_Functions {
* @param data Corresponding information for the correct execution of the given action * @param data Corresponding information for the correct execution of the given action
* @verdict * @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; var verdicttype v_verdict := none;
...@@ -3417,6 +3427,35 @@ module OneM2M_Functions { ...@@ -3417,6 +3427,35 @@ module OneM2M_Functions {
f_checkAeSimuStatus(); 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 * @desc Sending of an Adapter Control primitive
* @param event Action to be performed by TA * @param event Action to be performed by TA
...@@ -3430,6 +3469,7 @@ module OneM2M_Functions { ...@@ -3430,6 +3469,7 @@ module OneM2M_Functions {
// Tear down // Tear down
//f_cfAeTesterDown(); //f_cfAeTesterDown();
f_cse_postamble_deleteResourcesCSE(); f_cse_postamble_deleteResourcesCSE();
//Tear down
if(vc_config == e_cf03) { if(vc_config == e_cf03) {
f_cf03Down(); f_cf03Down();
stop; stop;
...@@ -3437,6 +3477,11 @@ module OneM2M_Functions { ...@@ -3437,6 +3477,11 @@ module OneM2M_Functions {
f_cf04Down(); f_cf04Down();
stop; stop;
} else if (vc_config == e_cf02CseSimuMaster) { } 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(); f_cf02DownCseSimuMaster();
stop; stop;
} }
......
...@@ -1796,9 +1796,11 @@ module OneM2M_PermutationFunctions { ...@@ -1796,9 +1796,11 @@ module OneM2M_PermutationFunctions {
if(ispresent(p_parentRequestPrimitive)) { if(ispresent(p_parentRequestPrimitive)) {
if(match(int23, p_parentRequestPrimitive.resourceType)){ if(match(int23, p_parentRequestPrimitive.resourceType)){
vc_ae2.start(f_cse_preamble_createAcpAux("SubscriptionVerificationAcp", int63)); 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.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); v_ae2Index := f_getResource(vc_ae2);
p_parentRequestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_ae2Index)}; p_parentRequestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_ae2Index)};
vc_ae2.start(f_cse_notifyProcedure_subscriptionVerificationHandler()); vc_ae2.start(f_cse_notifyProcedure_subscriptionVerificationHandler());
...@@ -1833,9 +1835,9 @@ module OneM2M_PermutationFunctions { ...@@ -1833,9 +1835,9 @@ module OneM2M_PermutationFunctions {
if(match(int23, p_requestPrimitive.resourceType)){ if(match(int23, p_requestPrimitive.resourceType)){
vc_ae2.start(f_cse_preamble_createAcpAux("SubscriptionVerificationAcp", int63)); 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.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); v_ae2Index := f_getResource(vc_ae2);
p_requestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_ae2Index)}; p_requestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_ae2Index)};
vc_ae2.start(f_cse_notifyProcedure_subscriptionVerificationHandler()); vc_ae2.start(f_cse_notifyProcedure_subscriptionVerificationHandler());
...@@ -1907,9 +1909,9 @@ module OneM2M_PermutationFunctions { ...@@ -1907,9 +1909,9 @@ module OneM2M_PermutationFunctions {
if(match(int23, p_resourceType)){ if(match(int23, p_resourceType)){
vc_ae1.start(f_cse_preamble_createAcpAux("SubscriptionVerificationAcp", int63)); 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.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); v_ae1Index := f_getResource(vc_ae1);
p_requestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_ae1Index)}; p_requestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_ae1Index)};
vc_ae1.start(f_cse_notifyProcedure_subscriptionVerificationHandler()); vc_ae1.start(f_cse_notifyProcedure_subscriptionVerificationHandler());
......
...@@ -745,7 +745,8 @@ module OneM2M_Testcases_CSE_Release_1 { ...@@ -745,7 +745,8 @@ module OneM2M_Testcases_CSE_Release_1 {
vc_remoteCseIndex := f_cse_registrationRemoteCse(mw_createRemoteCSE); vc_remoteCseIndex := f_cse_registrationRemoteCse(mw_createRemoteCSE);
vc_ae1.start(f_cse_createResource(int2, m_createAe(PX_APP_ID, omit, "S"))); vc_ae1.start(f_cse_createResource(int2, m_createAe(PX_APP_ID, omit, "S")));
vc_ae1.done; f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1);
//TODO: //TODO:
//v_request := valueof(m_delete(f_getResourceAddress(v_aeIndex), f_getOriginator(v_aeIndex))); //v_request := valueof(m_delete(f_getResourceAddress(v_aeIndex), f_getOriginator(v_aeIndex)));
...@@ -7962,7 +7963,7 @@ module OneM2M_Testcases_CSE_Release_1 { ...@@ -7962,7 +7963,7 @@ module OneM2M_Testcases_CSE_Release_1 {
vc_ae2.stop; vc_ae2.stop;
}; };
f_checkComponentDoneAndGetVerdict(vc_ae2); f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
// Test Body // Test Body
v_notificationRequest := f_getRequestPrimitive(vc_ae2); v_notificationRequest := f_getRequestPrimitive(vc_ae2);
...@@ -8041,7 +8042,7 @@ module OneM2M_Testcases_CSE_Release_1 { ...@@ -8041,7 +8042,7 @@ module OneM2M_Testcases_CSE_Release_1 {
} }
} }
f_checkComponentDoneAndGetVerdict(vc_ae2); f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
//Postamble //Postamble
f_cse_postamble_deleteResources(); f_cse_postamble_deleteResources();
...@@ -8116,7 +8117,7 @@ module OneM2M_Testcases_CSE_Release_1 { ...@@ -8116,7 +8117,7 @@ module OneM2M_Testcases_CSE_Release_1 {
} }
}; };
f_checkComponentDoneAndGetVerdict(vc_ae2); f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
//Postamble //Postamble
f_cse_postamble_deleteResources(); f_cse_postamble_deleteResources();
...@@ -8192,7 +8193,7 @@ module OneM2M_Testcases_CSE_Release_1 { ...@@ -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); v_notificationRequest := f_getRequestPrimitive(vc_ae2);
......
...@@ -5850,7 +5850,7 @@ module OneM2M_Testcases_CSE_Release_2 { ...@@ -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 //Check to see if the resource is NOT present
if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){
...@@ -5915,7 +5915,7 @@ module OneM2M_Testcases_CSE_Release_2 { ...@@ -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 //Check to see if the resource is NOT present
if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){
...@@ -5994,7 +5994,7 @@ module OneM2M_Testcases_CSE_Release_2 { ...@@ -5994,7 +5994,7 @@ module OneM2M_Testcases_CSE_Release_2 {
setverdict(fail, __SCOPE__ & ": Notifications sent before bathNotify/duration expired"); setverdict(fail, __SCOPE__ & ": Notifications sent before bathNotify/duration expired");
} }
f_checkComponentDoneAndGetVerdict(vc_ae2); f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
//Postamble //Postamble
f_cse_postamble_deleteResources(); f_cse_postamble_deleteResources();
...@@ -6075,7 +6075,7 @@ module OneM2M_Testcases_CSE_Release_2 { ...@@ -6075,7 +6075,7 @@ module OneM2M_Testcases_CSE_Release_2 {
} }
} }
f_checkComponentDoneAndGetVerdict(vc_ae2); f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
//Postamble //Postamble
f_cse_postamble_deleteResources(); f_cse_postamble_deleteResources();
...@@ -6121,7 +6121,7 @@ module OneM2M_Testcases_CSE_Release_2 { ...@@ -6121,7 +6121,7 @@ module OneM2M_Testcases_CSE_Release_2 {
v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription
f_checkComponentDoneAndGetVerdict(vc_ae2); f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
// Test Body // Test Body
vc_ae2.start(f_cse_notifyProcedure_representationHandler(v_contentResponse)); // check if the notification is well received and if its content matchs 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 { ...@@ -6148,7 +6148,7 @@ module OneM2M_Testcases_CSE_Release_2 {
} }
} }
f_checkComponentDoneAndGetVerdict(vc_ae2); f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
//Postamble //Postamble
f_cse_postamble_deleteResources(); f_cse_postamble_deleteResources();
...@@ -6205,7 +6205,7 @@ module OneM2M_Testcases_CSE_Release_2 { ...@@ -6205,7 +6205,7 @@ module OneM2M_Testcases_CSE_Release_2 {
v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // AE update request v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // AE update request
f_cse_updateResource(v_request); // AE update 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)))); mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))));
...@@ -6233,7 +6233,7 @@ module OneM2M_Testcases_CSE_Release_2 { ...@@ -6233,7 +6233,7 @@ module OneM2M_Testcases_CSE_Release_2 {
} }
} }
f_checkComponentDoneAndGetVerdict(vc_ae2); f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
//Postamble //Postamble
f_cse_postamble_deleteResources(); f_cse_postamble_deleteResources();
...@@ -6287,7 +6287,7 @@ module OneM2M_Testcases_CSE_Release_2 { ...@@ -6287,7 +6287,7 @@ module OneM2M_Testcases_CSE_Release_2 {
v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // AE update request v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // AE update request
f_cse_updateResource(v_request); // AE update 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)))); mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))));
...@@ -6310,7 +6310,7 @@ module OneM2M_Testcases_CSE_Release_2 { ...@@ -6310,7 +6310,7 @@ module OneM2M_Testcases_CSE_Release_2 {
} }
} }
f_checkComponentDoneAndGetVerdict(vc_ae2); f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
//Postamble //Postamble
f_cse_postamble_deleteResources(); f_cse_postamble_deleteResources();
...@@ -6383,7 +6383,7 @@ module OneM2M_Testcases_CSE_Release_2 { ...@@ -6383,7 +6383,7 @@ module OneM2M_Testcases_CSE_Release_2 {
} }
} }
f_checkComponentDoneAndGetVerdict(vc_ae2); f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
//Postamble //Postamble
f_cse_postamble_deleteResources(); f_cse_postamble_deleteResources();
...@@ -6448,7 +6448,7 @@ module OneM2M_Testcases_CSE_Release_2 { ...@@ -6448,7 +6448,7 @@ module OneM2M_Testcases_CSE_Release_2 {
v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 3 v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 3
f_cse_updateResource(v_request); f_cse_updateResource(v_request);
f_checkComponentDoneAndGetVerdict(vc_ae2); f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
//Postamble //Postamble
f_cse_postamble_deleteResources(); f_cse_postamble_deleteResources();
...@@ -6517,7 +6517,7 @@ module OneM2M_Testcases_CSE_Release_2 { ...@@ -6517,7 +6517,7 @@ module OneM2M_Testcases_CSE_Release_2 {
v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 3 v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 3
f_cse_updateResource(v_request); f_cse_updateResource(v_request);
f_checkComponentDoneAndGetVerdict(vc_ae2); f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
//Postamble //Postamble
f_cse_postamble_deleteResources(); f_cse_postamble_deleteResources();
...@@ -6592,7 +6592,7 @@ module OneM2M_Testcases_CSE_Release_2 { ...@@ -6592,7 +6592,7 @@ module OneM2M_Testcases_CSE_Release_2 {
} }
} }
f_checkComponentDoneAndGetVerdict(vc_ae2); f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
//Postamble //Postamble
f_cse_postamble_deleteResources(); f_cse_postamble_deleteResources();
...@@ -6671,7 +6671,7 @@ module OneM2M_Testcases_CSE_Release_2 { ...@@ -6671,7 +6671,7 @@ module OneM2M_Testcases_CSE_Release_2 {
} }
} }
f_checkComponentDoneAndGetVerdict(vc_ae2); f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
//Postamble //Postamble
f_cse_postamble_deleteResources(); f_cse_postamble_deleteResources();
...@@ -6743,7 +6743,7 @@ module OneM2M_Testcases_CSE_Release_2 { ...@@ -6743,7 +6743,7 @@ module OneM2M_Testcases_CSE_Release_2 {
} }
} }
f_checkComponentDoneAndGetVerdict(vc_ae2); f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
//Postamble //Postamble
f_cse_postamble_deleteResources(); f_cse_postamble_deleteResources();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment