Commit 38f233b7 authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

Merge branch 'Release2-onwards' into Release2

parents d556bf04 01c5afb3
......@@ -2020,7 +2020,7 @@ module OneM2M_Functions {
[] mcaPortIn.receive(mw_request(mw_notifyAggregatedNotification)) -> value vc_request {
tc_ac.stop;
if(p_numberOfAggregatedNotification == lengthof(vc_request.primitive.requestPrimitive.primitiveContent.aggregatedNotification.notification_list)){
if(f_check_notificationContent(vc_response.primitive.requestPrimitive, p_primitiveContent)){
if(f_check_notificationContent(vc_request.primitive.requestPrimitive, p_primitiveContent)){
setverdict(pass, __SCOPE__ & ": Notification received");
}
else{
......@@ -2096,7 +2096,8 @@ module OneM2M_Functions {
*/
function f_cse_notifyProcedure_noNotificationHandler() runs on AeSimu {
// Local variables
var ResponsePrimitive v_responsePrimitive;
//Activate defaults when running on a PTC
f_cse_activateDefaults_ae();
......@@ -2105,10 +2106,18 @@ module OneM2M_Functions {
[] mcaPortIn.receive(mw_request(mw_notifyNotification(mw_contentNotification(?)))) -> 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_mca_in_port, m_response(v_responsePrimitive));
}
[] 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_mca_in_port, m_response(v_responsePrimitive));
}
[] tc_ac.timeout {
setverdict(pass, __SCOPE__ & ": No notification received");
......@@ -3571,7 +3580,16 @@ module OneM2M_Functions {
var ResponsePrimitive v_response;
[] mcaPortIn.receive(mw_request(mw_notify)) -> value v_request {
log(__SCOPE__&": WARNING: Unexpected NOTIFY message received");
log(__SCOPE__&": WARNING: Unexpected NOTIFY (single notification) message received");
//Send response in any case
v_response := valueof(m_responseNotification(int2000, omit));
v_response.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier;
f_send(e_mca_in_port, m_response(v_response));
repeat;
}
[] mcaPortIn.receive(mw_request(mw_notifyAggregatedNotification)) -> value v_request {
log(__SCOPE__&": WARNING: Unexpected NOTIFY (aggregated notification) message received");
//Send response in any case
v_response := valueof(m_responseNotification(int2000, omit));
......
......@@ -8763,6 +8763,7 @@ module OneM2M_PermutationFunctions {
if (ischosen(v_response.primitive.responsePrimitive.primitiveContent.uRI)){
v_contentResponseRequestResource.request := mw_contentRequestBase;
v_requestResourceURI := v_response.primitive.responsePrimitive.primitiveContent.uRI;
v_contentResponseRequestResource.request.primitiveContent := p_requestPrimitive.primitiveContent;
if (p_operation == int1){ //create
v_statusCode := int2001;
v_primitiveContent := f_getTemplateFromPrimitiveContent(p_requestPrimitive.primitiveContent);
......@@ -8774,8 +8775,7 @@ module OneM2M_PermutationFunctions {
v_primitiveContent := f_getTemplateFromPrimitiveContent(p_requestPrimitive.primitiveContent);
}else if (p_operation == int4){ //delete
v_statusCode := int2002;
v_primitiveContent.container := mw_contentContainer_rc1;
//v_primitiveContent := omit;
v_primitiveContent := omit;
}
f_send(e_mca_port, m_request(m_retrieve(v_requestResourceURI, f_getOriginator(v_aeIndex))));
tc_ac.start;
......@@ -9199,7 +9199,7 @@ module OneM2M_PermutationFunctions {
f_cse_notifyProcedure_responsePrimitiveHandler(mw_responsePrimitive(p_responseStatusCode));
vc_ae2.done;
f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
// Postamble
f_cse_postamble_deleteResources();
......
......@@ -2222,7 +2222,7 @@ module OneM2M_Testcases_CSE_Release_2 {
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int4101))) -> value v_response { //SUBSCRIPTION_CREATOR_HAS_NO_PRIVILEGE
[] mcaPort.receive(mw_response(mw_responsePrimitive(int5204))) -> value v_response { //SUBSCRIPTION_VERIFICATION_INITIATION_FAILED
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": OK : Subscription creator has no privilege");
}
......@@ -2301,7 +2301,7 @@ module OneM2M_Testcases_CSE_Release_2 {
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int5205))) -> value v_response { //SUBSCRIPTION_CREATOR_HAS_NO_PRIVILEGE
[] mcaPort.receive(mw_response(mw_responsePrimitive(int5204))) -> value v_response { //SUBSCRIPTION_VERIFICATION_INITIATION_FAILED
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": OK : Subscription creator has no privilege");
}
......@@ -2447,6 +2447,25 @@ module OneM2M_Testcases_CSE_Release_2 {
v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier;
f_send(e_mca_in_port, m_response(v_responsePrimitive));
}
[] mcaPortIn.receive(mw_request(mw_notifyAggregatedNotification({{mw_contentNotification(?)}}))) -> value vc_request {
tc_ac.stop;
if(f_check_notificationContent(vc_request.primitive.requestPrimitive, v_contentResponse)){
setverdict(pass, __SCOPE__ & ":INFO: Notification received");
v_elapsedTime := t_batchNotificationTimer.read;
t_batchNotificationTimer.stop;
if(v_elapsedTime < 10.0) {
setverdict(fail, __SCOPE__ & ": Notifications sent before bathNotify/duration expired");
}
}
else{
setverdict(fail, __SCOPE__ & ":ERROR: Notification received but the content doesn't match");
}
//Send response in any case
v_responsePrimitive := valueof(m_responseNotification(int2000, omit));
v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier;
f_send(e_mca_in_port, m_response(v_responsePrimitive));
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No notification received");
......@@ -3023,7 +3042,7 @@ module OneM2M_Testcases_CSE_Release_2 {
// Test Body
v_contentResponse.aE.labels := v_labels_3;
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_aggregatedNoficationHandler(v_contentResponse, 1)); // check if the notification is well received and if its content matchs
v_updateRequest.primitiveContent.aE.labels := v_labels_1;
f_cse_updateResource(int2, v_aeIndex, v_updateRequest); // Update request 1
......
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