Skip to content
Snippets Groups Projects
Commit 03967dd4 authored by Carlos Arroyo Narvaez's avatar Carlos Arroyo Narvaez
Browse files

Added functions to fix and enhance f_CSE_SUB_NTF_007

Removed compilation errors
parent 0ac6f03a
Branches
Tags
1 merge request!63Merge Release4-onwards into Release4
......@@ -1290,6 +1290,59 @@ module OneM2M_Functions {
return vc_aeIndex;
}
/**
* @desc Creation of auxiliar resource AE for correct execution of the test case containing POINT_OF_ACCESS attribute and REQUEST_REACHABILITY set to true
* @param p_accessControlPolicyIDs AccessControlPolicyIDs for the auxiliar AE resource
* @param p_poaList Point of contact of the auxiliar AE resource
* @return Internal AE resource index
* @verdict
*/
function f_cse_preamble_registerAeWithRequestReachability(template (omit) AcpType p_accessControlPolicyIDs := omit, in template (omit) PoaList p_poaList := omit) runs on AeSimu return integer {//c_CRUDNDi
var RequestPrimitive v_request;
var MsgIn v_response;
//Activate defaults when running on a PTC
f_cse_activateDefaults_ae();
v_request := valueof(m_createAe(vc_aeSimuDesc.appId, p_accessControlPolicyIDs, vc_aeSimuDesc.aeIdStem, c_defaultAe1ResourceName, p_poaList));
v_request.primitiveContent.aE.requestReachability := true;
v_request := f_getCreateRequestPrimitive(int2, v_request, -1);
f_send(e_mcaPort, m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(pass,__SCOPE__&":INFO: Application registered successfuly");
if(ischosen(v_response.primitive.responsePrimitive.primitiveContent.aE)) {
f_checkAttributesToBeSaved(int2, v_request, v_response.primitive.responsePrimitive);
vc_aeIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int2);
if(ispresent(v_response.primitive.responsePrimitive.primitiveContent.aE.aE_ID)){
f_sendAcPrimitive("AE-ID_changed", vc_aeIndex);
}
}
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
tc_ac.stop;
setverdict(inconc, __SCOPE__&":INFO: Error while registering application");
stop;
}
[] tc_ac.timeout {
setverdict(inconc, __SCOPE__&":INFO: No answer while registering resource");
stop;
}
}
f_checkAeSimuStatus();
return vc_aeIndex;
}
/**
* @desc Creation of auxiliar resources ACP and AE for correct execution of the test case
* @param p_allowedOperations Allowed operations for the auxiliar AE resource
......@@ -2553,6 +2606,50 @@ module OneM2M_Functions {
} //end f_cse_notifyProcedure_notify
/**
* @desc Handling of valid NOTIFY and send to POINT_OF_ACCESS to finish a notification procedure
* @verdict
*/
function f_cse_notifyProcedure_SendtoPOA() runs on AeSimu {
// Local variables
var ResponsePrimitive v_responsePrimitive;
//Activate defaults when running on a PTC
f_cse_activateDefaults_ae();
tc_ac.start;
alt {
[] mcaPortIn.receive(mw_request(mw_notifyNotification(mw_contentNotification(?)))) -> value vc_request {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ":INFO: Notification received");
//Send response in any case
v_responsePrimitive := valueof(m_responseNotification(int2000, omit));
v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier;
v_responsePrimitive.to_ := f_getLocalPoA(vc_aeSimuDesc.mcaPortIn);
f_send(e_mcaPortIn, m_response(v_responsePrimitive));
tc_ac.start;
repeat;
}
[] mcaPortIn.receive(mw_request(mw_notifyResponsePrimitive(?))) -> value vc_request {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error, Non expected notification received");
//Send response in any case
v_responsePrimitive := valueof(m_responseNotification(int2000, omit));
v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier;
f_send(e_mcaPortIn, m_response(v_responsePrimitive));
}
[] mcaPortIn.receive{
tc_ac.stop;
setverdict(inconc, __SCOPE__ & ":ERROR: unexpected message received");
tc_ac.start;
repeat;
}
}
} //end f_cse_notifyProcedure_SendtoPOA
/**
* @desc Handling message exchange for the dynamic authorization procedure
* @desc Processing details are out of scope of oneM2M
......
......@@ -7942,7 +7942,7 @@ module OneM2M_Testcases_CSE_Release_3 {
v_request.from_ := f_getResourceAddress(v_aeIndex);
// Test Body
f_send(e_mcaPort, m_request(v_request));
f_send(e_mcaPort, m_request(valueof(v_request)));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { //CREATED - TS-004 - Table 6.6.3.3 1: RSCs for successful response class
......@@ -8596,7 +8596,6 @@ module OneM2M_Testcases_CSE_Release_3 {
var RequestPrimitive v_request;
var template RequestPrimitive v_requestCreateAE := m_createAe(vc_aeSimuDesc.appId, omit, vc_aeSimuDesc.aeIdStem, c_defaultAe1ResourceName, {f_getLocalPoA(vc_aeSimuDesc.mcaPortIn)});
var RequestPrimitive v_reqNotify;
//var XSD.ID v_targetResourceAddress;
// Test control
 
......@@ -8606,50 +8605,19 @@ module OneM2M_Testcases_CSE_Release_3 {
// Test adapter configuration
 
// Preamble
f_cse_activateDefaults_ae(); //Activate defaults when running on a PTC
v_requestCreateAE.primitiveContent.aE.requestReachability := true;
v_request := f_getCreateRequestPrimitive(int2, valueof(v_requestCreateAE), -1);//c_CRUDNDi
f_send(e_mcaPort, m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(pass,__SCOPE__&":INFO: Application registered successfuly");
if(ischosen(v_response.primitive.responsePrimitive.primitiveContent.aE)) {
f_checkAttributesToBeSaved(int2, v_request, v_response.primitive.responsePrimitive);
v_aeIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int2);
if(ispresent(v_response.primitive.responsePrimitive.primitiveContent.aE.aE_ID)){
f_sendAcPrimitive("AE-ID_changed", v_aeIndex);
}
}
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
tc_ac.stop;
setverdict(inconc, __SCOPE__&":INFO: Error while registering application");
stop;
}
[] tc_ac.timeout {
setverdict(inconc, __SCOPE__&":INFO: No answer while registering resource");
stop;
}
}
f_checkAeSimuStatus();
v_aeIndex := f_cse_preamble_registerAeWithRequestReachability(-, {f_getLocalPoA(vc_aeSimuDesc.mcaPortIn, "")});//c_CRUDNDi);
// Test Body
v_reqNotify := valueof(m_notifyNotification(f_getResourceAddress(v_aeIndex), m_contentNotification_subscriptionVerification(PX_TS_CSE1.cseId)));
vc_cse1.start(f_cse_notifyProcedure_notify(v_reqNotify)); //Message exchange for notification
f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1);
vc_cse1.start(f_cse_notifyProcedure_SendtoPOA()); //The IUT sends the valid NOTIFY to POINT_OF_ACCESS
f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1);
 
// Postamble
f_cse_postamble_deleteResourcesCSE();
f_cse_postamble_deleteResources();
 
// Tear down
f_cf02Down();
......@@ -15893,7 +15861,7 @@ module OneM2M_Testcases_CSE_Release_3 {
var XSD.ID v_remoteOntologyAddress;
var integer v_remoteOntologyRepoIndex := -1;
var integer v_remoteOntologyIndex := -1;
var RequestPrimitive v_updateSdRequestPrimitive := m_updateSemanticDescriptorBase;
var template RequestPrimitive v_updateSdRequestPrimitive := m_updateSemanticDescriptorBase;
// Test control
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment