Skip to content
Snippets Groups Projects
Commit 563428f8 authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

Minor enhancements for defaults, f_updateLocalResource and...

Minor enhancements for defaults, f_updateLocalResource and checkComponentDoneAndGetVerdict functions

Signed-off-by: Miguel Angel Reina Ortega's avatarreinaortega <miguelangel.reinaortega@etsi.org>
parent 859c0c4f
No related branches found
No related tags found
No related merge requests found
......@@ -1968,6 +1968,7 @@ module OneM2M_Functions {
mccPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
}
[] mccPortIn.receive(mw_request(?)) -> value v_request {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ":ERROR: Request received with unexpected parameters");
v_responsePrimitive := valueof(m_responsePrimitive(int4000,v_request.primitive.requestPrimitive.requestIdentifier));
mccPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
......@@ -3005,6 +3006,46 @@ module OneM2M_Functions {
if(ispresent(p_resource.aE.supportedReleaseVersions)) {
vc_localResourcesList[p_localResourceIndex].resource.aE.supportedReleaseVersions := p_resource.aE.supportedReleaseVersions;
}
} else if(ischosen(vc_localResourcesList[p_localResourceIndex].resource.aEAnnc) and (ischosen(p_resource.aEAnnc))) {//AEAnnc
if(ispresent(p_resource.aEAnnc.accessControlPolicyIDs)) {
vc_localResourcesList[p_localResourceIndex].resource.aEAnnc.accessControlPolicyIDs := p_resource.aEAnnc.accessControlPolicyIDs;
}
if(ispresent(p_resource.aEAnnc.expirationTime)) {
vc_localResourcesList[p_localResourceIndex].resource.aEAnnc.expirationTime := p_resource.aEAnnc.expirationTime;
}
if(ispresent(p_resource.aEAnnc.labels)) {
vc_localResourcesList[p_localResourceIndex].resource.aEAnnc.labels := p_resource.aEAnnc.labels;
}
if(ispresent(p_resource.aEAnnc.link)) {
vc_localResourcesList[p_localResourceIndex].resource.aEAnnc.link := p_resource.aEAnnc.link;
}
if(ispresent(p_resource.aEAnnc.dynamicAuthorizationConsultationIDs)) {
vc_localResourcesList[p_localResourceIndex].resource.aEAnnc.dynamicAuthorizationConsultationIDs := p_resource.aEAnnc.dynamicAuthorizationConsultationIDs;
}
if(ispresent(p_resource.aEAnnc.appName)) {
vc_localResourcesList[p_localResourceIndex].resource.aEAnnc.appName := p_resource.aEAnnc.appName;
}
if(ispresent(p_resource.aEAnnc.pointOfAccess)) {
vc_localResourcesList[p_localResourceIndex].resource.aEAnnc.pointOfAccess := p_resource.aEAnnc.pointOfAccess;
}
if(ispresent(p_resource.aEAnnc.ontologyRef)) {
vc_localResourcesList[p_localResourceIndex].resource.aEAnnc.ontologyRef := p_resource.aEAnnc.ontologyRef;
}
if(ispresent(p_resource.aEAnnc.nodeLink)) {
vc_localResourcesList[p_localResourceIndex].resource.aEAnnc.nodeLink := p_resource.aEAnnc.nodeLink;
}
if(ispresent(p_resource.aEAnnc.requestReachability)) {
vc_localResourcesList[p_localResourceIndex].resource.aEAnnc.requestReachability := p_resource.aEAnnc.requestReachability;
}
if(ispresent(p_resource.aEAnnc.contentSerialization)) {
vc_localResourcesList[p_localResourceIndex].resource.aEAnnc.contentSerialization := p_resource.aEAnnc.contentSerialization;
}
if(ispresent(p_resource.aEAnnc.e2eSecInfo)) {
vc_localResourcesList[p_localResourceIndex].resource.aEAnnc.e2eSecInfo := p_resource.aEAnnc.e2eSecInfo;
}
if(ispresent(p_resource.aEAnnc.supportedReleaseVersions)) {
vc_localResourcesList[p_localResourceIndex].resource.aEAnnc.supportedReleaseVersions := p_resource.aEAnnc.supportedReleaseVersions;
}
} else if(ischosen(vc_localResourcesList[p_localResourceIndex].resource.accessControlPolicy) and (ischosen(p_resource.accessControlPolicy))) { //AccessControlPolicy
if(ispresent(p_resource.accessControlPolicy.expirationTime)) {
vc_localResourcesList[p_localResourceIndex].resource.accessControlPolicy.expirationTime := p_resource.accessControlPolicy.expirationTime;
......@@ -3157,16 +3198,13 @@ module OneM2M_Functions {
[] mccPortIn.receive(mw_request(mw_create())) -> value v_request {
log(__SCOPE__&": WARNING: Unexpected CREATE message received");
tc_ac.stop;
v_localResourceIndex := f_processCreateRequestPrimitive(v_request.primitive.requestPrimitive);
mccPortIn.send(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive)));
tc_ac.start(10.0);
repeat;
}
[] mccPortIn.receive(mw_request(mw_retrieve(?))) -> value v_request {
tc_ac.stop;
log(__SCOPE__&": WARNING: Unexpected RETRIEVE message received");
f_processRetrieveRequestPrimitive(v_request.primitive.requestPrimitive);
......@@ -3175,36 +3213,29 @@ module OneM2M_Functions {
} else {
mccPortIn.send(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive)));
}
tc_ac.start(10.0);
repeat;
}
[] mccPortIn.receive(mw_request(mw_update())) -> value v_request {
tc_ac.stop;
log(__SCOPE__&": WARNING: Unexpected UPDATE message received");
f_processUpdateRequestPrimitive(v_request.primitive.requestPrimitive);
mccPortIn.send(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive)));
tc_ac.start(10.0);
repeat;
}
[] mccPortIn.receive(mw_request(mw_delete())) -> value v_request {
tc_ac.stop;
log(__SCOPE__&": WARNING: Unexpected DELETE message received");
f_processDeleteRequestPrimitive(v_request.primitive.requestPrimitive);
mccPortIn.send(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive)));
tc_ac.start(10.0);
repeat;
}
[] mccPortIn.receive(mw_request(mw_notify)) -> value v_request {
tc_ac.stop;
log(__SCOPE__&": WARNING: Unexpected NOTIFY message received");
//Send response in any case
v_response := valueof(m_responseNotification(int2000, omit));
v_response.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier;
mccPortIn.send(f_getMsgOutPrimitive(m_response(v_response)));
tc_ac.start(10.0);
repeat;
}
[] mccPortIn.receive (mw_request(?)){
......@@ -3225,14 +3256,12 @@ module OneM2M_Functions {
var ResponsePrimitive v_response;
[] mcaPortIn.receive(mw_request(mw_notify)) -> value v_request {
tc_ac.stop;
log(__SCOPE__&": WARNING: Unexpected NOTIFY message received");
//Send response in any case
v_response := valueof(m_responseNotification(int2000, omit));
v_response.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier;
mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_response)));
tc_ac.start(10.0);
repeat;
}
[] mcaPortIn.receive {
......@@ -3249,32 +3278,39 @@ module OneM2M_Functions {
* @desc Activation of the corresponding default altstep depending on config for CseSimu
*/
function f_cse_activateDefaults_cse1() runs on CseSimu {
if(not(self == mtc)) {
activate(a_default());
if(vc_config == e_cf02) {
activate(a_cse_cf02_cse1());
log(__SCOPE__&": INFO: Default cf02_cse1 activated");
} else if(vc_config == e_cf04) {
activate(a_cse_cf04());
log(__SCOPE__&": INFO: Default cf04 activated");
}
}
deactivate;
activate(a_default());
if(vc_config == e_cf02) {
activate(a_cse_cf02_cse1());
log(__SCOPE__&": INFO: Default cf02_cse1 activated");
} else if(vc_config == e_cf02CseSimuMaster) {
activate(a_cse_cf02_cse1());
log(__SCOPE__&": INFO: Default cf02_cse1 activated");
} else if(vc_config == e_cf03) {
activate(a_cse_cf03());
log(__SCOPE__&": INFO: Default cf03 activated");
} else if(vc_config == e_cf04) {
activate(a_cse_cf04());
log(__SCOPE__&": INFO: Default cf04 activated");
}
}
/**
* @desc Activation of the corresponding default altstep depending on config for AeSimu
*/
function f_cse_activateDefaults_ae() runs on AeSimu {
if(not(self == mtc)) {
activate(a_default());
if(vc_config == e_cf01) {
activate(a_cse_cf01());
log(__SCOPE__&": INFO: Default cf01 and cf01_ae2 activated");
} else if(vc_config == e_cf02CseSimuMaster) {
activate(a_cse_cf02_ae1());
log(__SCOPE__&": INFO: Default cf02_ae1 activated");
}
}
deactivate;
activate(a_default());
if(vc_config == e_cf01) {
activate(a_cse_cf01());
log(__SCOPE__&": INFO: Default cf01 activated");
} else if(vc_config == e_cf02) {
activate(a_cse_cf02_ae1());
log(__SCOPE__&": INFO: Default cf02_ae1 activated");
} else if(vc_config == e_cf02CseSimuMaster) {
activate(a_cse_cf02_ae1());
log(__SCOPE__&": INFO: Default cf02_ae1 activated");
}
}
}//end group CseAltstepFunctions
......@@ -4757,12 +4793,12 @@ module OneM2M_Functions {
var verdicttype v_verdict := none;
tc_ac.start(15.0);
tc_done.start(15.0);
alt {
[] p_component.done -> value v_verdict {
tc_ac.stop;
tc_done.stop;
}
[] tc_ac.timeout {
[] tc_done.timeout {
setverdict(inconc, __SCOPE__ & "INFO: Component did not finish");
}
}
......@@ -4786,12 +4822,12 @@ module OneM2M_Functions {
var verdicttype v_verdict := none;
tc_ac.start(15.0);
tc_done.start(15.0);
alt {
[] p_component.done -> value v_verdict {
tc_ac.stop;
tc_done.stop;
}
[] tc_ac.timeout {
[] tc_done.timeout {
setverdict(inconc, __SCOPE__ & "INFO: Component did not finish");
}
}
......
......@@ -29,6 +29,7 @@ module OneM2M_TestSystem {
//timers
timer tc_ac := PX_TAC;
timer tc_wait := PX_TWAIT;
timer tc_done := PX_TDONE;
//global variables
var charstring vc_protocolBinding;
var Configurations vc_config;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment