From ace9ad757d9fd2a87e98e6581087a5c7ff860f69 Mon Sep 17 00:00:00 2001
From: reinaortega <miguelangel.reinaortega@etsi.org>
Date: Wed, 21 Oct 2020 11:03:10 +0200
Subject: [PATCH] Small corrections for TC_CSE_RT_NBS_003 and TC_CSE_RT_NBA_005

Signed-off-by: reinaortega <miguelangel.reinaortega@etsi.org>
---
 OneM2M_PermutationFunctions.ttcn    | 180 +++++++++-------------------
 OneM2M_Testcases_CSE_Release_2.ttcn |  21 +---
 2 files changed, 56 insertions(+), 145 deletions(-)

diff --git a/OneM2M_PermutationFunctions.ttcn b/OneM2M_PermutationFunctions.ttcn
index 3f74115..27f8d89 100644
--- a/OneM2M_PermutationFunctions.ttcn
+++ b/OneM2M_PermutationFunctions.ttcn
@@ -9755,20 +9755,18 @@ module OneM2M_PermutationFunctions {
 							v_resourceIndex := f_cse_createResource(int3, v_create, v_aeIndex);
 							f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1);
 							v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestCreatePrimitive, v_resourceIndex);
-							//Retrieve the parent resource index
-							v_parentIndex := f_getLatestLocalResourceIndex(vc_cse1);
-						} else if (p_resourceType == int30) {
+					  	} else if (p_resourceType == int30) {
 							v_create := m_createTimeSeriesBase;
 							v_create.primitiveContent.timeSeries.announceTo := {PX_TS_CSE1.cseId};
 							vc_cse1.start(f_cse_announcementProcedure_createHandler(mw_createTimeSeriesAnnc(), -, v_parentIndex));
 							v_resourceIndex := f_cse_createResource(int29, v_create, v_aeIndex);
 							f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1);
 							v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestCreatePrimitive, v_resourceIndex);
-							//Retrieve the parent resource index
-							v_parentIndex := f_getLatestLocalResourceIndex(vc_cse1);
-						} else {
+					  	} else {
 					  		v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestCreatePrimitive, v_aeIndex);
 						}
+						//Retrieve the parent resource index
+						v_parentIndex := f_getLatestLocalResourceIndex(vc_cse1);
 						
 					  	v_responsePrimitive.responseStatusCode := int2001;
 					}
@@ -9894,9 +9892,7 @@ module OneM2M_PermutationFunctions {
 				function f_CSE_ANNC_CRE_004(ResourceType p_resourceType, template RequestPrimitive p_createRequestAnnc, in template RequestPrimitive p_requestCreatePrimitive := omit) runs on CseSimu system CseSystem {
 					// Local variables
 					var integer v_aeIndex := -1;
-					var integer v_resourceIndex := -1;
-					var integer v_parentIndex := -1;
-					var RequestPrimitive v_request;
+					var integer v_aEAnncIndex := -1;
 					var template RequestPrimitive v_create := m_createAe(PX_TS_AE1.appId, omit, omit);
 					
 					v_create.primitiveContent.aE.announceTo := {PX_TS_CSE1.cseId};
@@ -9910,37 +9906,17 @@ module OneM2M_PermutationFunctions {
 					// Register the CSE
 					f_cse_registerRemoteCse(m_createRemoteCSE_poa(vc_cseSimuDesc.cseId, -, -, -, -, {f_getLocalPoA()}));
 					
-					v_parentIndex := vc_localRemoteCseIndex;
-					
 					//Preamble
 					vc_ae1.start(f_cse_createResource(int2,v_create));
-					f_cse_announcementProcedure_createHandler(mw_createAEAnnc(-, -, -));
+					v_aEAnncIndex := f_cse_announcementProcedure_createHandler(mw_createAEAnnc(-, -, -));
 					f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1);
 					
 					v_aeIndex := f_getLatestResourceIndex(vc_ae1);
 					
-					v_resourceIndex := v_aeIndex;
-					
 					// Test Body
-					if (p_resourceType == int4) {
-						v_create := m_createContainerBase;
-						v_create.primitiveContent.container.announceTo := {PX_TS_CSE1.cseId};
-						vc_ae1.start(f_cse_createResource(int3,v_create, v_aeIndex));
-						v_parentIndex := f_cse_announcementProcedure_createHandler(mw_createContainerAnnc(), -, -);
-						f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1);
-						v_resourceIndex := f_getLatestResourceIndex(vc_ae1);
-					} else if (p_resourceType == int30) {
-						v_create := m_createTimeSeriesBase;
-						v_create.primitiveContent.timeSeries.announceTo := {PX_TS_CSE1.cseId};
-						vc_ae1.start(f_cse_createResource(int29,v_create, v_aeIndex));
-						v_parentIndex := f_cse_announcementProcedure_createHandler(mw_createTimeSeriesAnnc(), -, -);
-						f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1);
-						v_resourceIndex := f_getLatestResourceIndex(vc_ae1);
-					}
-					
-					vc_ae1.start(f_cse_createResource(p_resourceType,p_requestCreatePrimitive, v_resourceIndex));
+					vc_ae1.start(f_cse_createResource(p_resourceType,p_requestCreatePrimitive, v_aeIndex));
 					
-					f_cse_announcementProcedure_createHandler(p_createRequestAnnc, -, v_parentIndex);					
+					f_cse_announcementProcedure_createHandler(p_createRequestAnnc, -, v_aEAnncIndex);					
 					
 					f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1);
 
@@ -10015,8 +9991,6 @@ module OneM2M_PermutationFunctions {
 				function f_CSE_ANNC_CRE_006(ResourceType p_resourceType, template RequestPrimitive p_createRequestAnnc, in template RequestPrimitive p_requestCreatePrimitive := omit) runs on CseSimu system CseSystem {
 					// Local variables
 					var integer v_aeIndex := -1;
-					var integer v_resourceIndex := -1;
-					var integer v_parentIndex := -1;
 					var template RequestPrimitive v_create := m_createAe(PX_TS_AE1.appId, omit, omit);
 					
 					// Test control
@@ -10027,7 +10001,6 @@ module OneM2M_PermutationFunctions {
 					// Test adapter configuration
 					// Register the CSE
 					vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSE_poa(vc_cseSimuDesc.cseId, -, -, -, -, {f_getLocalPoA()}));
-					v_parentIndex := vc_localRemoteCseIndex;
 					
 					//Preamble
 					vc_ae1.start(f_cse_createResource(int2,v_create));
@@ -10035,28 +10008,10 @@ module OneM2M_PermutationFunctions {
 					
 					v_aeIndex := f_getLatestResourceIndex(vc_ae1);
 
-					v_resourceIndex := v_aeIndex;
-					
 					// Test Body
-					if (p_resourceType == int4) {
-						v_create := m_createContainerBase;
-						v_create.primitiveContent.container.announceTo := {PX_TS_CSE1.cseId};
-						vc_ae1.start(f_cse_createResource(int3,v_create, v_aeIndex));
-						v_parentIndex := f_cse_announcementProcedure_createHandler(mw_createContainerAnnc(), -, -);
-						f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1);
-						v_resourceIndex := f_getLatestResourceIndex(vc_ae1);
-					} else if (p_resourceType == int30) {
-						v_create := m_createTimeSeriesBase;
-						v_create.primitiveContent.timeSeries.announceTo := {PX_TS_CSE1.cseId};
-						vc_ae1.start(f_cse_createResource(int29,v_create, v_aeIndex));
-						v_parentIndex := f_cse_announcementProcedure_createHandler(mw_createTimeSeriesAnnc(), -, -);
-						f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1);
-						v_resourceIndex := f_getLatestResourceIndex(vc_ae1);
-					}
-
-					vc_ae1.start(f_cse_createResource(p_resourceType,p_requestCreatePrimitive, v_resourceIndex));
+					vc_ae1.start(f_cse_createResource(p_resourceType,p_requestCreatePrimitive, v_aeIndex));
 
-					f_cse_announcementProcedure_createHandler(p_createRequestAnnc, -, v_parentIndex);
+					f_cse_announcementProcedure_createHandler(p_createRequestAnnc, -, vc_localRemoteCseIndex);
 										
 					f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1);
 
@@ -10117,8 +10072,7 @@ module OneM2M_PermutationFunctions {
 				function f_CSE_ANNC_CRE_008(ResourceType p_resourceType, template RequestPrimitive p_createRequestAnnc, in template RequestPrimitive p_requestCreatePrimitive := omit) runs on CseSimu system CseSystem {
 					// Local variables
 					var integer v_aeIndex := -1;
-					var integer v_resourceIndex := -1;
-					var integer v_parentIndex := -1;
+					var integer v_aEAnncIndex := -1;
 					var template RequestPrimitive v_create := m_createAe(PX_TS_AE1.appId, omit, omit);
 					
 					v_create.primitiveContent.aE.announceTo := {PX_TS_CSE1.cseId};
@@ -10131,35 +10085,18 @@ module OneM2M_PermutationFunctions {
 					//Test adapter configuration
 					// Register the CSE
 					vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSE_poa(vc_cseSimuDesc.cseId, -, -, -, -, {f_getLocalPoA()}));
-					v_parentIndex := vc_localRemoteCseIndex;
+					
+					f_checkCseSimuStatus();
 					
 					vc_ae1.start(f_cse_createResource(int2,v_create));
-					f_cse_announcementProcedure_createHandler(mw_createAEAnnc(-, -, -));
+					v_aEAnncIndex := f_cse_announcementProcedure_createHandler(mw_createAEAnnc(-, -, -));
 					f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1);
 					
 					v_aeIndex := f_getLatestResourceIndex(vc_ae1);
 
-					v_resourceIndex := v_aeIndex;
-					
 					// Test Body
-					if (p_resourceType == int4) {
-						v_create := m_createContainerBase;
-						v_create.primitiveContent.container.announceTo := {PX_TS_CSE1.cseId};
-						vc_ae1.start(f_cse_createResource(int3,v_create, v_aeIndex));
-						v_parentIndex := f_cse_announcementProcedure_createHandler(mw_createContainerAnnc(), -, -);
-						f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1);
-						v_resourceIndex := f_getLatestResourceIndex(vc_ae1);
-					} else if (p_resourceType == int30) {
-						v_create := m_createTimeSeriesBase;
-						v_create.primitiveContent.timeSeries.announceTo := {PX_TS_CSE1.cseId};
-						vc_ae1.start(f_cse_createResource(int29,v_create, v_aeIndex));
-						v_parentIndex := f_cse_announcementProcedure_createHandler(mw_createTimeSeriesAnnc(), -, -);
-						f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1);
-						v_resourceIndex := f_getLatestResourceIndex(vc_ae1);
-					}
-
-					vc_ae1.start(f_cse_createResource(p_resourceType,p_requestCreatePrimitive, v_resourceIndex));
-					f_cse_announcementProcedure_createHandler(p_createRequestAnnc, -, v_parentIndex);
+					vc_ae1.start(f_cse_createResource(p_resourceType,p_requestCreatePrimitive, v_aeIndex));
+					f_cse_announcementProcedure_createHandler(p_createRequestAnnc, -, v_aEAnncIndex);
 					f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1);
 					
 					// Postamble
@@ -10196,7 +10133,7 @@ module OneM2M_PermutationFunctions {
 
 					// Test Body
 					vc_ae1.start(f_cse_createResource(p_resourceType,p_requestCreatePrimitive, v_aeIndex));
-					f_cse_announcementProcedure_createHandler(p_createRequestAnnc, -, -);
+					f_cse_announcementProcedure_createHandler(p_createRequestAnnc, -, v_aEAnncIndex);
 					f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1);
 
 					// Postamble
@@ -10232,14 +10169,9 @@ module OneM2M_PermutationFunctions {
 					// Test adapter configuration
 		
 					//Preamble
-					v_aeIndex := f_cse_createResource(int2,v_createAE);
-					
-					v_acpIndex := f_cse_createResource(int1, v_createAcp, -); // AE child resource
-					
 					v_cseBaseIndex := f_getLatestLocalResourceIndex(vc_cse1);
-					
 					//Register the CSE
-					vc_cse1.start(f_cse_registerRemoteCse(m_createRemoteCSE_poa(-, {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -, -, -, {f_getLocalPoA()})));
+					vc_cse1.start(f_cse_registerRemoteCse(m_createRemoteCSE_poa(-, -, -, -, -, {f_getLocalPoA()})));
 				    f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1);
 
 					v_remoteCSEIndex := f_getLatestResourceIndex(vc_cse1);
@@ -10252,6 +10184,10 @@ module OneM2M_PermutationFunctions {
 					
 					v_originalResourceIndex := f_getLatestLocalResource(vc_cse1);
 					
+					v_aeIndex := f_cse_createResource(int2,v_createAE);
+					
+					v_acpIndex := f_cse_createResource(int1, v_createAcp, -); // AE child resource
+					
 					if((p_resourceType == int3) or (p_resourceType == int9) or (p_resourceType == int29)) {
 						p_createRequestAnnc := f_setAcpId(p_createRequestAnnc, {f_getResourceId(vc_resourcesList[v_acpIndex].resource)});
 					}
@@ -10313,30 +10249,38 @@ module OneM2M_PermutationFunctions {
 					// Test adapter configuration
 		
 					//Preamble
-					v_aeIndex := f_cse_createResource(int2,v_createAE);
-					
-					v_acpIndex := f_cse_createResource(int1, v_createAcp, -); // AE child resource
-					
 					v_cseBaseIndex := f_getLatestLocalResourceIndex(vc_cse1);
-					
 					//Register the CSE
-					vc_cse1.start(f_cse_registerRemoteCse(m_createRemoteCSE_poa(-, {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -, -, -, {f_getLocalPoA()})));
+					vc_cse1.start(f_cse_registerRemoteCse(m_createRemoteCSE_poa(-, -, -, -, -, {f_getLocalPoA()})));
 					f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1);
 
 					v_remoteCSEIndex := f_getLatestResourceIndex(vc_cse1);
 					
+					//Creating resource in Hosting CSE
+					vc_cse1.start(f_generateAndSetLocalResource(valueof(p_originalResource), v_cseBaseIndex, p_resourceType));
+					f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1);
+					
+					v_originalResourceAddress := f_getLatestLocalResourceAddress(vc_cse1, -, e_spRelative);
+					
+					v_originalResourceIndex := f_getLatestLocalResource(vc_cse1);
+					
+					v_originalLocalResourceIndex := f_getLatestLocalResourceIndex(vc_cse1);
+					
+					v_aeIndex := f_cse_createResource(int2,v_createAE);
+					
+					v_acpIndex := f_cse_createResource(int1, v_createAcp, -); // AE child resource
+					
 					if((p_resourceType == int3) or (p_resourceType == int9) or (p_resourceType == int29)) {
 						p_createRequestAnnc := f_setAcpId(p_createRequestAnnc, {f_getResourceId(vc_resourcesList[v_acpIndex].resource)});
 					}
+					p_createRequestAnnc.primitiveContent := f_setLink(valueof(p_createRequestAnnc.primitiveContent), v_originalResourceAddress);
+					p_createRequestAnnc.primitiveContent := f_setExpirationTime(valueof(p_createRequestAnnc.primitiveContent), vc_resourcesList[v_originalResourceIndex].resource);
 					
-					//Creation of original resource locally and then announcement of it to IUT
 					vc_cse1.start(f_cse_createResource_cseSimu(f_getAnnouncedResourceType(p_resourceType), p_createRequestAnnc, v_remoteCSEIndex));
 					f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1);
 					
 					v_resourceAnncAddress := f_getLatestResourceAddress(vc_cse1, -, -);
 					v_resourceAnncIndex := f_getLatestResourceIndex(vc_cse1);
-					v_originalLocalResourceIndex := f_getLatestLocalResourceIndex(vc_cse1);
-					v_originalResourceIndex := f_getLatestLocalResource(vc_cse1);
 					
 					v_request := m_retrieve(v_resourceAnncAddress, f_getOriginator(v_aeIndex));
 					v_request.resultContent := int7;
@@ -10480,7 +10424,7 @@ module OneM2M_PermutationFunctions {
 							tc_ac.stop;
 							setverdict(pass, __SCOPE__ & ":INFO: Announcement deletion received");
 			
-							f_processDeleteRequestPrimitive(vc_request.primitive.requestPrimitive, -, v_announcedResourceIndex); 
+							f_processDeleteRequestPrimitive(vc_request.primitive.requestPrimitive, -, vc_localRemoteCseIndex); 
 							f_send(e_mccPortIn, m_response(vc_response.primitive.responsePrimitive));
 						}
 						[] tc_ac.timeout {
@@ -10615,7 +10559,7 @@ module OneM2M_PermutationFunctions {
 
 					tc_ac.start;
 					alt {
-						[] mcaPort.receive(mw_response(mw_responsePrimitive(int2004, p_updateResponse))) -> value vc_response {
+						[] mcaPort.receive(mw_response(mw_responsePrimitive(int2004, p_updateResponse), {*, "announceAttribute", *})) -> value vc_response {
 							tc_ac.stop;
 							setverdict(pass, __SCOPE__ & ": Resource updated successfully");
 
@@ -10681,25 +10625,18 @@ module OneM2M_PermutationFunctions {
 
 					tc_ac.start;
 					alt {
-						[] mccPortIn.receive(mw_request(p_updateRequestAnnc, {p_nullFields[0].name})) -> value vc_request {
-							tc_ac.stop;
-							setverdict(pass, __SCOPE__ & ":INFO: Update for announced resource received");
-			
-							f_processUpdateRequestPrimitive(vc_request.primitive.requestPrimitive, -, v_announcedResourceIndex);
-							f_send(e_mccPortIn, m_response(vc_response.primitive.responsePrimitive));
-						}
 						[] mccPortIn.receive(mw_request(p_updateRequestAnnc)) -> value vc_request {
 							tc_ac.stop;
-							setverdict(fail, __SCOPE__ & ":ERROR: Update for announced resource received but not deannouncing attribute");
+							setverdict(pass, __SCOPE__ & ":INFO: Announcement received");
 			
-							f_processUpdateRequestPrimitive(vc_request.primitive.requestPrimitive, -, v_announcedResourceIndex);
+							f_processUpdateRequestPrimitive(vc_request.primitive.requestPrimitive, -, vc_localRemoteCseIndex);
 							f_send(e_mccPortIn, m_response(vc_response.primitive.responsePrimitive));
 						}
 						[] mccPortIn.receive(mw_request(mw_update)) -> value vc_request {
 							tc_ac.stop;
 							setverdict(fail, __SCOPE__ & ":ERROR: Unexpected update operation received");
 	
-							f_processUpdateRequestPrimitive(vc_request.primitive.requestPrimitive, -, v_announcedResourceIndex);
+							f_processUpdateRequestPrimitive(vc_request.primitive.requestPrimitive, -, vc_localRemoteCseIndex);
 							f_send(e_mccPortIn, m_response(vc_response.primitive.responsePrimitive));
 						}
 						[] tc_ac.timeout {
@@ -10937,14 +10874,14 @@ module OneM2M_PermutationFunctions {
 							tc_ac.stop;
 							setverdict(pass, __SCOPE__ & ":INFO: Announcement received");
 			
-							f_processUpdateRequestPrimitive(vc_request.primitive.requestPrimitive, -, v_announcedResourceIndex);
+							f_processUpdateRequestPrimitive(vc_request.primitive.requestPrimitive, -, vc_localRemoteCseIndex);
 							f_send(e_mccPortIn, m_response(vc_response.primitive.responsePrimitive));
 						}
 						[] mccPortIn.receive(mw_request(mw_update)) -> value vc_request {
 							tc_ac.stop;
 							setverdict(fail, __SCOPE__ & ":ERROR: Unexpected update operation received");
 	
-							f_processUpdateRequestPrimitive(vc_request.primitive.requestPrimitive, -, v_announcedResourceIndex);
+							f_processUpdateRequestPrimitive(vc_request.primitive.requestPrimitive, -, vc_localRemoteCseIndex);
 							f_send(e_mccPortIn, m_response(vc_response.primitive.responsePrimitive));
 						}
 						[] tc_ac.timeout {
@@ -10998,14 +10935,14 @@ module OneM2M_PermutationFunctions {
 							tc_ac.stop;
 							setverdict(pass, __SCOPE__ & ":INFO: Announcement received");
 			
-							f_processUpdateRequestPrimitive(vc_request.primitive.requestPrimitive, -, v_announcedResourceIndex);
+							f_processUpdateRequestPrimitive(vc_request.primitive.requestPrimitive, -, vc_localRemoteCseIndex);
 							f_send(e_mccPortIn, m_response(vc_response.primitive.responsePrimitive));
 						}
 						[] mccPortIn.receive(mw_request(mw_update)) -> value vc_request {
 							tc_ac.stop;
 							setverdict(fail, __SCOPE__ & ":ERROR: Unexpected update operation received");
 	
-							f_processUpdateRequestPrimitive(vc_request.primitive.requestPrimitive, -, v_announcedResourceIndex);
+							f_processUpdateRequestPrimitive(vc_request.primitive.requestPrimitive, -, vc_localRemoteCseIndex);
 							f_send(e_mccPortIn, m_response(vc_response.primitive.responsePrimitive));
 						}
 						[] tc_ac.timeout {
@@ -11059,14 +10996,14 @@ module OneM2M_PermutationFunctions {
 							tc_ac.stop;
 							setverdict(pass, __SCOPE__ & ":INFO: Announcement received");
 			
-							f_processUpdateRequestPrimitive(vc_request.primitive.requestPrimitive, -, v_announcedResourceIndex);
+							f_processUpdateRequestPrimitive(vc_request.primitive.requestPrimitive, -, vc_localRemoteCseIndex);
 							f_send(e_mccPortIn, m_response(vc_response.primitive.responsePrimitive));
 						}
 						[] mccPortIn.receive(mw_request(mw_update)) -> value vc_request {
 							tc_ac.stop;
 							setverdict(fail, __SCOPE__ & ":ERROR: Unexpected update operation received");
 	
-							f_processUpdateRequestPrimitive(vc_request.primitive.requestPrimitive, -, v_announcedResourceIndex);
+							f_processUpdateRequestPrimitive(vc_request.primitive.requestPrimitive, -, vc_localRemoteCseIndex);
 							f_send(e_mccPortIn, m_response(vc_response.primitive.responsePrimitive));
 						}
 						[] tc_ac.timeout {
@@ -11118,21 +11055,14 @@ module OneM2M_PermutationFunctions {
 							tc_ac.stop;
 							setverdict(pass, __SCOPE__ & ":INFO: Announcement received");
 			
-							f_processUpdateRequestPrimitive(vc_request.primitive.requestPrimitive, -, v_announcedResourceIndex);
-							f_send(e_mccPortIn, m_response(vc_response.primitive.responsePrimitive));
-						}
-						[] mccPortIn.receive(mw_request(p_updateRequestAnnc)) -> value vc_request {
-							tc_ac.stop;
-							setverdict(fail, __SCOPE__ & ":ERROR: Announcement received but not deannouncing attribute");
-	
-							f_processUpdateRequestPrimitive(vc_request.primitive.requestPrimitive, -, v_announcedResourceIndex);//Update function with expected index
+							f_processUpdateRequestPrimitive(vc_request.primitive.requestPrimitive, -, vc_localRemoteCseIndex);
 							f_send(e_mccPortIn, m_response(vc_response.primitive.responsePrimitive));
 						}
 						[] mccPortIn.receive(mw_request(mw_update)) -> value vc_request {
 							tc_ac.stop;
 							setverdict(fail, __SCOPE__ & ":ERROR: Unexpected update operation received");
 	
-							f_processUpdateRequestPrimitive(vc_request.primitive.requestPrimitive, -, v_announcedResourceIndex);//Update function with expected index
+							f_processUpdateRequestPrimitive(vc_request.primitive.requestPrimitive, -, vc_localRemoteCseIndex);//Update function with expected index
 							f_send(e_mccPortIn, m_response(vc_response.primitive.responsePrimitive));
 						}
 						[] tc_ac.timeout {
@@ -11185,7 +11115,7 @@ module OneM2M_PermutationFunctions {
 
 					tc_ac.start;
 					alt {
-						[] mcaPort.receive(mw_response(mw_responsePrimitive(int2004, p_updateResponse))) -> value vc_response {
+						[] mcaPort.receive(mw_response(mw_responsePrimitive(int2004, p_updateResponse), {"announcedAttribute"})) -> value vc_response {
 							tc_ac.stop;
 							setverdict(pass, __SCOPE__ & ": Resource updated successfully");
 
@@ -11249,7 +11179,7 @@ module OneM2M_PermutationFunctions {
 
 					tc_ac.start;
 					alt {
-						[] mcaPort.receive(mw_response(mw_responsePrimitive(int2004, p_updateResponse))) -> value vc_response {
+						[] mcaPort.receive(mw_response(mw_responsePrimitive(int2004, p_updateResponse), {"announceTo"})) -> value vc_response {
 							tc_ac.stop;
 							setverdict(pass, __SCOPE__ & ": Resource updated successfully");
 						}
@@ -12205,4 +12135,4 @@ module OneM2M_PermutationFunctions {
 	}//end group CSE
 
 	
-}
+}
\ No newline at end of file
diff --git a/OneM2M_Testcases_CSE_Release_2.ttcn b/OneM2M_Testcases_CSE_Release_2.ttcn
index 28a252f..3b1be7d 100644
--- a/OneM2M_Testcases_CSE_Release_2.ttcn
+++ b/OneM2M_Testcases_CSE_Release_2.ttcn
@@ -2447,25 +2447,6 @@ module OneM2M_Testcases_CSE_Release_2 {
 							v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier;
 							f_send(e_mcaPortIn, 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");
@@ -4693,4 +4674,4 @@ module OneM2M_Testcases_CSE_Release_2 {
 	
 	}//end group CSE
 		
-}
+}
\ No newline at end of file
-- 
GitLab