From 7efb8fafb47cfbc38cd4262e8fd74a1aa07545d1 Mon Sep 17 00:00:00 2001
From: reinaortega <miguelangel.reinaortega@etsi.org>
Date: Tue, 16 Jan 2018 13:48:13 +0100
Subject: [PATCH] New TPs mapped to IN and MN profiles

Signed-off-by: reinaortega <miguelangel.reinaortega@etsi.org>
---
 OneM2M_PermutationFunctions.ttcn    |  73 +++++
 OneM2M_TestControl_IN_profile.ttcn  |   6 +
 OneM2M_TestControl_MN_profile.ttcn  |   6 +
 OneM2M_Testcases_CSE_Release_1.ttcn | 397 ++++++++++++++++++++++++
 OneM2M_Testcases_CSE_Release_2.ttcn | 466 ----------------------------
 5 files changed, 482 insertions(+), 466 deletions(-)

diff --git a/OneM2M_PermutationFunctions.ttcn b/OneM2M_PermutationFunctions.ttcn
index 43fb43f..c638175 100644
--- a/OneM2M_PermutationFunctions.ttcn
+++ b/OneM2M_PermutationFunctions.ttcn
@@ -2355,7 +2355,80 @@ module OneM2M_PermutationFunctions {
 						f_cf01Down();
 					    					    				
 					}//end f_CSE_DMR_CRE_012
+					
+					function f_CSE_DMR_CRE_014(ResourceType p_parentResourceType, template RequestPrimitive p_parentResourceRequestPrimitive, ResourceType p_childResourceType, template RequestPrimitive p_childRequestPrimitive) runs on AeSimu {
+						// Local variables
+						var MsgIn v_response;
+						var RequestPrimitive v_request;
+						var integer v_aeIndex := -1;
+						var integer v_resourceIndex := -1;
+			   
+						// Test control
+
+						// Test component configuration
+						f_cf01Up();
+
+						// Test adapter configuration
+
+						// Preamble
+						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
+
+						v_resourceIndex := f_cse_createResource(p_parentResourceType, p_parentResourceRequestPrimitive, v_aeIndex);
+						
+						// Test Body
+						v_request := f_getCreateRequestPrimitive(p_childResourceType, p_childRequestPrimitive, v_resourceIndex); 
+	
+						mcaPort.send(m_request(v_request));
+						tc_ac.start;
+						alt {
+							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response {
+								tc_ac.stop;
+								setverdict(pass, __SCOPE__ & ": Resource created");
+							}
+							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
+								tc_ac.stop;
+								setverdict(fail, __SCOPE__ & ": Wrong response status code");
+							}
+							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
+								tc_ac.stop;
+								setverdict(fail, __SCOPE__ & ": Error when creating resource");
+							}
+							[] tc_ac.timeout {
+								setverdict(fail, __SCOPE__ & ": No answer while creating resource");
+							}
+						}	
 						
+						//Check currentByteSize
+						mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))));
+
+						tc_ac.start;
+						alt {
+							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
+								tc_ac.stop;
+								if(v_response.primitive.responsePrimitive.primitiveContent.container.currentByteSize == 8) { //Default content: "AnyValue" (8 bytes length)
+									setverdict(pass, __SCOPE__ & ": CurrentByteSize attribute in content resource is incremented successfully");	
+								}
+								else{
+									setverdict(fail, __SCOPE__ & ": CurrentByteSize attribute in content resource not incremented successfully");
+								}
+							}
+							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
+								tc_ac.stop;
+								setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
+							}
+							[] tc_ac.timeout {
+								setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
+							}
+						}	
+
+						// Postamble
+						f_cse_postamble_deleteResources();
+
+						// Tear down
+						f_cf01Down();
+		
+					}//end f_CSE_DMR_CRE_014
+
 					function f_CSE_DMR_CRE_015(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu {
     				
 						// Local variables
diff --git a/OneM2M_TestControl_IN_profile.ttcn b/OneM2M_TestControl_IN_profile.ttcn
index b1850b8..d7cc468 100644
--- a/OneM2M_TestControl_IN_profile.ttcn
+++ b/OneM2M_TestControl_IN_profile.ttcn
@@ -116,8 +116,12 @@ module OneM2M_TestControl_IN_profile {
 		if(true) {execute (TC_CSE_DMR_CRE_003_CNT());}
 		if(true) {execute (TC_CSE_DMR_CRE_007 ());}
 		if(true) {execute (TC_CSE_DMR_CRE_008 ());}
+		if(true) {execute (TC_CSE_DMR_CRE_009 ());}
+		if(true) {execute (TC_CSE_DMR_CRE_010 ());}
+		if(true) {execute (TC_CSE_DMR_CRE_011 ());}
 		if(true) {execute (TC_CSE_DMR_RET_001_CNT());}
 		if(true) {execute (TC_CSE_DMR_RET_013_CNT());}
+		if(true) {execute (TC_CSE_DMR_CRE_014_CNT_CIN ());}
 		if(true) {execute (TC_CSE_DMR_UPD_001_CNT_LBL());}
 		if(PICS_CNT_LBL) {execute (TC_CSE_DMR_UPD_002_CNT_LBL());}
 		if(PICS_CNT_LBL) {execute (TC_CSE_DMR_UPD_003_CNT_LBL());}
@@ -126,8 +130,10 @@ module OneM2M_TestControl_IN_profile {
 		if(true) {execute (TC_CSE_DMR_UPD_007_CNT_CT());}
 		if(true) {execute (TC_CSE_DMR_UPD_008_CNT_ET());}
 		if(true) {execute (TC_CSE_DMR_UPD_009_CNT_ET());}
+		if(true) {execute (TC_CSE_DMR_UPD_010 ());}
 		if(true) {execute (TC_CSE_DMR_UPD_016_CNT_ET());}
 		if(true) {execute (TC_CSE_DMR_DEL_001_CNT());}
+		if(true) {execute (TC_CSE_DMR_DEL_005 ());}
 		if(true) {execute (TC_CSE_DMR_DEL_006());}
 		if(PICS_ACP_SUPPORT) {execute (TC_CSE_DMR_CRE_012_CNT_LBL());}
 		if(true) {execute (TC_CSE_DMR_UPD_014_CNT_LBL());}
diff --git a/OneM2M_TestControl_MN_profile.ttcn b/OneM2M_TestControl_MN_profile.ttcn
index 89e9997..5c546cb 100644
--- a/OneM2M_TestControl_MN_profile.ttcn
+++ b/OneM2M_TestControl_MN_profile.ttcn
@@ -140,8 +140,12 @@ module OneM2M_TestControl_MN_profile {
 		if(true) {execute (TC_CSE_DMR_CRE_003_CNT());}
 		if(true) {execute (TC_CSE_DMR_CRE_007 ());}
 		if(true) {execute (TC_CSE_DMR_CRE_008 ());}
+		if(true) {execute (TC_CSE_DMR_CRE_009 ());}
+		if(true) {execute (TC_CSE_DMR_CRE_010 ());}
+		if(true) {execute (TC_CSE_DMR_CRE_011 ());}
 		if(true) {execute (TC_CSE_DMR_RET_001_CNT());}
 		if(true) {execute (TC_CSE_DMR_RET_013_CNT());}
+		if(true) {execute (TC_CSE_DMR_CRE_014_CNT_CIN ());}
 		if(true) {execute (TC_CSE_DMR_UPD_001_CNT_LBL());}
 		if(PICS_CNT_LBL) {execute (TC_CSE_DMR_UPD_002_CNT_LBL());}
 		if(PICS_CNT_LBL) {execute (TC_CSE_DMR_UPD_003_CNT_LBL());}
@@ -150,8 +154,10 @@ module OneM2M_TestControl_MN_profile {
 		if(true) {execute (TC_CSE_DMR_UPD_007_CNT_CT());}
 		if(true) {execute (TC_CSE_DMR_UPD_008_CNT_ET());}
 		if(true) {execute (TC_CSE_DMR_UPD_009_CNT_ET());}
+		if(true) {execute (TC_CSE_DMR_UPD_010());}
 		if(true) {execute (TC_CSE_DMR_UPD_016_CNT_ET());}
 		if(true) {execute (TC_CSE_DMR_DEL_001_CNT());}
+		if(true) {execute (TC_CSE_DMR_DEL_005 ());}
 		if(true) {execute (TC_CSE_DMR_DEL_006());}
 		if(PICS_ACP_SUPPORT) {execute (TC_CSE_DMR_CRE_012_CNT_LBL());}
 		if(true) {execute (TC_CSE_DMR_UPD_014_CNT_LBL());}
diff --git a/OneM2M_Testcases_CSE_Release_1.ttcn b/OneM2M_Testcases_CSE_Release_1.ttcn
index 7eafb20..b0ad75e 100644
--- a/OneM2M_Testcases_CSE_Release_1.ttcn
+++ b/OneM2M_Testcases_CSE_Release_1.ttcn
@@ -3475,7 +3475,222 @@ module OneM2M_Testcases_CSE_Release_1 {
 						
 				}// end group g_CSE_DMR_CRE_008			
 
+				group g_CSE_DMR_CRE_009 {
+					
+					/**
+					 * @desc Check that the IUT increaments and then copies the field value of attribute stateTag in parent container resource when contentInstance resource is created as the direct child of the parent container
+					 * 
+					 */
+					testcase TC_CSE_DMR_CRE_009() runs on AeSimu system CseSystem {
+						// Local variables
+						var template RequestPrimitive v_createRequest := m_createContainerBase;
+						var MsgIn v_response;
+						var integer v_aeIndex := -1;
+						var integer v_containerIndex := -1;
+						var integer v_contentInstanceIndex := -1;
+						var template PrimitiveContent v_contentResponse;
+					
+						// Test control
+				
+						// Test component configuration
+						f_cf01Up();
 				
+						// Test adapter configuration
+				
+						// Preamble
+						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
+						
+						v_containerIndex := f_cse_createResource(int3, v_createRequest, v_aeIndex);
+						
+						v_contentInstanceIndex := f_cse_createResource(int4, m_createContentInstanceBase, v_containerIndex);
+					
+						// Test Body
+						mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_containerIndex), f_getOriginator(v_containerIndex))));
+						
+						v_contentResponse.container := mw_contentContainerBase;
+						
+						tc_ac.start;
+						alt {
+							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))) -> value v_response {
+								tc_ac.stop;
+								setverdict(pass, __SCOPE__ & ": Response OK for retrieving");
+								if(v_response.primitive.responsePrimitive.primitiveContent.container.stateTag == vc_resourcesList[v_containerIndex].resource.container.stateTag + 1) {
+									setverdict(pass, __SCOPE__ & ": stateTag attribute increased after creation of contentInstance resource");
+								} else {
+									setverdict(fail, __SCOPE__ & ": stateTag attribute not incremented correctly after creation of contentInstance resource");
+								}
+							}
+							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))) -> value v_response {
+								tc_ac.stop;
+								setverdict(fail, __SCOPE__ & ": Wrong response status code");
+							}
+							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
+								tc_ac.stop;
+								setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements");
+							}
+							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
+								tc_ac.stop;
+								setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
+							}
+							[] tc_ac.timeout {
+								setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
+							}
+						}	
+								
+						// Postamble
+						f_cse_postamble_deleteResources();
+						
+						// Tear down
+						f_cf01Down();
+					    				
+					}//end TC_CSE_DMR_CRE_009
+						
+				}// end group g_CSE_DMR_CRE_009		
+				
+				group g_CSE_DMR_CRE_010 {
+					
+					/**
+					 * @desc Check that the IUT rejects the CREATE Request of a container resource named “la” as a direct child of a container resource 
+					 * 
+					 */
+					testcase TC_CSE_DMR_CRE_010() runs on AeSimu system CseSystem {
+						// Local variables
+						var template RequestPrimitive v_createRequest := m_createContainerBase;
+						var MsgIn v_response;
+						var RequestPrimitive v_request;
+						var integer v_aeIndex := -1;
+						var integer v_containerIndex := -1;
+						
+						// Test control
+				
+						// Test component configuration
+						f_cf01Up();
+				
+						// Test adapter configuration
+				
+						// Preamble
+						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
+						
+						v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex);
+					
+						// Test Body
+						v_createRequest.primitiveContent.container.resourceName := c_resourceShortNameLatest;
+						
+						v_request := f_getCreateRequestPrimitive(int3, v_createRequest, v_containerIndex);
+					
+						mcaPort.send(m_request(v_request));
+						tc_ac.start;
+						alt {
+							[] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) -> value v_response {
+								tc_ac.stop;
+								setverdict(pass, __SCOPE__ & ": Not allowed to create a contentInstance resource named 'la'");
+								
+							}
+							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
+								tc_ac.stop;
+								setverdict(fail, __SCOPE__ & ": Rejected creation of contentInstance named 'la' with wrong ResponseStatusCode");
+							}
+							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
+								tc_ac.stop;
+								setverdict(fail, __SCOPE__ & ": Accepted creation of contentInstance named 'la'");
+								
+							}
+							[] tc_ac.timeout {
+								setverdict(fail, __SCOPE__ & ": No answer while creating resource type 4");
+							}
+						}	
+								
+						f_checkAeSimuStatus();
+    					
+						//Check to see if the resource is NOT present
+						if(f_isResourceNotPresent(v_containerIndex, f_getResourceName(v_request.primitiveContent))){
+						  setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
+						} else {
+						  setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
+						}
+								
+						// Postamble
+						f_cse_postamble_deleteResources();
+						
+						// Tear down
+						f_cf01Down();
+					    				
+					}//end TC_CSE_DMR_CRE_010
+						
+				}// end group g_CSE_DMR_CRE_010	
+				
+				group g_CSE_DMR_CRE_011 {
+					
+					/**
+					 * @desc Check that the IUT rejects the CREATE Request of a container resource named “ol” as a direct child of a container resource 
+					 * 
+					 */
+					testcase TC_CSE_DMR_CRE_011() runs on AeSimu system CseSystem {
+						// Local variables
+						var template RequestPrimitive v_createRequest := m_createContainerBase;
+						var MsgIn v_response;
+						var RequestPrimitive v_request;
+						var integer v_aeIndex := -1;
+						var integer v_containerIndex := -1;
+						
+						// Test control
+				
+						// Test component configuration
+						f_cf01Up();
+				
+						// Test adapter configuration
+				
+						// Preamble
+						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
+						
+						v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex);
+					
+						// Test Body
+						v_createRequest.primitiveContent.container.resourceName := c_resourceShortNameOldest;
+						
+						v_request := f_getCreateRequestPrimitive(int3, v_createRequest, v_containerIndex);
+					
+						mcaPort.send(m_request(v_request));
+						tc_ac.start;
+						alt {
+							[] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) -> value v_response {
+								tc_ac.stop;
+								setverdict(pass, __SCOPE__ & ": Not allowed to create a contentInstance resource named 'ol'");
+								
+							}
+							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
+								tc_ac.stop;
+								setverdict(fail, __SCOPE__ & ": Rejected creation of contentInstance named 'ol' with wrong ResponseStatusCode");
+							}
+							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
+								tc_ac.stop;
+								setverdict(fail, __SCOPE__ & ": Accepted creation of contentInstance named 'ol'");
+								
+							}
+							[] tc_ac.timeout {
+								setverdict(fail, __SCOPE__ & ": No answer while creating resource type 4");
+							}
+						}	
+								
+						f_checkAeSimuStatus();
+    					
+						//Check to see if the resource is NOT present
+						if(f_isResourceNotPresent(v_containerIndex, f_getResourceName(v_request.primitiveContent))){
+						  setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
+						} else {
+						  setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
+						}
+								
+						// Postamble
+						f_cse_postamble_deleteResources();
+						
+						// Tear down
+						f_cf01Down();
+					    				
+					}//end TC_CSE_DMR_CRE_011
+						
+				}// end group g_CSE_DMR_CRE_011
+
 				group g_CSE_DMR_CRE_012 {
 					
 					/**
@@ -3713,6 +3928,28 @@ module OneM2M_Testcases_CSE_Release_1 {
 		
 				}// end group g_CSE_DMR_CRE_013	
 				
+				group g_CSE_DMR_CRE_014 {
+					
+					/**
+					 * @desc Check that the IUT updates the currentByteSize attribute in a <container> parent resource when a new <contentInstance> resource is created. 
+					 * 
+					 */
+					testcase TC_CSE_DMR_CRE_014_CNT_CIN() runs on Tester system CseSystem {
+						// Local variables
+						var template RequestPrimitive v_parentResourceRequest := m_createContainerBase;
+						var template RequestPrimitive v_childResourceRequest := m_createContentInstanceBase;//Default content: "AnyValue" (8 bytes length)
+						var ResponsePrimitive v_responsePrimitive;
+						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
+						const integer c_maxByteSize := 512;	
+						
+						v_parentResourceRequest.primitiveContent.container.maxByteSize := c_maxByteSize;
+						
+						v_ae1.start(f_CSE_DMR_CRE_014(int3, v_parentResourceRequest, int4, v_childResourceRequest));		
+						v_ae1.done;
+						
+					}
+				}
+				
 				
 			}//end group Create
 			
@@ -5361,7 +5598,76 @@ module OneM2M_Testcases_CSE_Release_1 {
 					}
 	
 				} // end g_CSE_DMR_UPD_009	
+				
+				group g_CSE_DMR_UPD_010{
 
+					/**
+					 * @desc Check that the stateTag attribute of a container resource is increased when an update operation has been performed on its child resource
+					 * 
+					 */
+					testcase TC_CSE_DMR_UPD_010() runs on AeSimu system CseSystem {
+						var MsgIn v_response;
+						var integer v_aeIndex := -1;
+						var integer v_containerIndex := -1;
+						var RequestPrimitive v_updateRequest := valueof(m_updateContainerBase);
+						var Labels v_labels_1:= {"VALUE_1"};
+						v_updateRequest.primitiveContent.container.labels := v_labels_1;
+				   
+						// Test control
+
+						// Test component configuration
+						f_cf01Up();
+
+						// Test adapter configuration
+
+						// Preamble
+						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
+		
+						v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 
+		
+						// Test Body
+						if(ispresent(vc_resourcesList[v_containerIndex].resource.container.stateTag)) { 
+		
+							v_updateRequest := f_getUpdateRequestPrimitive(int3, v_containerIndex, v_updateRequest);
+							f_cse_updateResource(v_updateRequest);
+
+							mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_containerIndex), f_getOriginator(v_containerIndex))));
+
+							tc_ac.start;
+							alt {
+								[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
+									tc_ac.stop;
+									if(v_response.primitive.responsePrimitive.primitiveContent.container.stateTag == 1) { //(Create and Delete)
+										setverdict(pass, __SCOPE__ & ": The stateTag attribute is incremented");	
+									}
+									else{
+										setverdict(fail, __SCOPE__ & ": Error the stateTag attribute is not incremented");
+									}
+								}
+								[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
+									tc_ac.stop;
+									setverdict(fail, __SCOPE__ & ": Error while retrieving resource attributes");
+								}
+								[] tc_ac.timeout {
+									setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes");
+								}
+							}	
+				
+						}//end if
+						else{
+							setverdict(fail, __SCOPE__ & ": Error the stateTag attribute is empty");
+						}
+		
+						// Postamble
+						f_cse_postamble_deleteResources();
+
+						// Tear down
+						f_cf01Down();
+			
+					}//end TC_CSE_DMR_UPD_010
+					
+				} // end group g_CSE_DMR_UPD_010
+				
 				group g_CSE_DMR_UPD_011{
 
 					/**
@@ -7061,6 +7367,97 @@ module OneM2M_Testcases_CSE_Release_1 {
                 
                 
 				};//end of group g_CSE_DMR_DEL_002
+
+				group g_CSE_DMR_DEL_005{
+
+					/**
+					 * @desc Check that the stateTag attribute of a container resource is increased when a child resource is deleted
+					 * 
+					 */
+					testcase TC_CSE_DMR_DEL_005() runs on AeSimu system CseSystem {
+						// Local variables
+						var MsgIn v_response;
+						var RequestPrimitive v_request;
+						var integer v_aeIndex := -1;
+						var integer v_resourceIndex := -1;
+						var integer v_childResourceIndex := -1; 
+						const ResourceType c_containerResourceType := int3;          			
+            					   
+						// Test control
+            
+						// Test component configuration
+						f_cf01Up();
+            
+						// Test adapter configuration
+            
+						// Preamble
+						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
+						
+						v_resourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_aeIndex); 
+            			
+						if(ispresent(vc_resourcesList[v_resourceIndex].resource.container.stateTag)) {
+            				
+							v_childResourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_resourceIndex); 
+            				
+							// Test Body
+							mcaPort.send(m_request(m_delete(f_getResourceAddress(v_childResourceIndex), f_getOriginator(v_childResourceIndex))));
+							            	
+							tc_ac.start;
+							alt {
+								[] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) -> value v_response {
+									tc_ac.stop;
+									setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(c_containerResourceType)) & " delete successfully");
+								}
+								[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
+									tc_ac.stop;
+									setverdict(fail, __SCOPE__ & ": Wrong response status code");
+								}
+								[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
+									tc_ac.stop;
+									setverdict(fail, __SCOPE__ & ": Error while deleting resource type " & int2str(enum2int(c_containerResourceType)));
+								}
+								[] tc_ac.timeout {
+									setverdict(fail, __SCOPE__ & ": No answer while deleting resource type " & int2str(enum2int(c_containerResourceType)));
+								}
+							}
+            	
+            	
+            	
+							mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))));
+            
+							tc_ac.start;
+							alt {
+								[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
+									tc_ac.stop;
+									if(v_response.primitive.responsePrimitive.primitiveContent.container.stateTag == 2) { //(Create and Delete)
+										setverdict(pass, __SCOPE__ & ": The stateTag attribute is incremented");	
+									}
+									else{
+										setverdict(fail, __SCOPE__ & ": Error the stateTag attribute is not incremented");
+									}
+								}
+								[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
+									tc_ac.stop;
+									setverdict(fail, __SCOPE__ & ": Error while retrieving resource attributes");
+								}
+								[] tc_ac.timeout {
+									setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes");
+								}
+							}	
+            					
+						}//end if
+						else{
+							setverdict(fail, __SCOPE__ & ": Error the stateTag attribute is empty");
+						}
+            			
+						// Postamble
+						f_cse_postamble_deleteResources();
+            
+						// Tear down
+						f_cf01Down();
+            				
+					}//end f_CSE_DMR_DEL_005
+				} // end group g_CSE_DMR_DEL_005
                 
 				group g_CSE_DMR_DEL_006{
 
diff --git a/OneM2M_Testcases_CSE_Release_2.ttcn b/OneM2M_Testcases_CSE_Release_2.ttcn
index 7d021b0..cc2ea9f 100644
--- a/OneM2M_Testcases_CSE_Release_2.ttcn
+++ b/OneM2M_Testcases_CSE_Release_2.ttcn
@@ -731,222 +731,6 @@ module OneM2M_Testcases_CSE_Release_2 {
 					
 				}// end group g_CSE_DMR_CRE_004
 				
-				group g_CSE_DMR_CRE_009 {
-					
-					/**
-					 * @desc Check that the IUT increaments and then copies the field value of attribute stateTag in parent container resource when contentInstance resource is created as the direct child of the parent container
-					 * 
-					 */
-					testcase TC_CSE_DMR_CRE_009() runs on AeSimu system CseSystem {
-						// Local variables
-						var template RequestPrimitive v_createRequest := m_createContainerBase;
-						var MsgIn v_response;
-						var integer v_aeIndex := -1;
-						var integer v_containerIndex := -1;
-						var integer v_contentInstanceIndex := -1;
-						var template PrimitiveContent v_contentResponse;
-					
-						// Test control
-				
-						// Test component configuration
-						f_cf01Up();
-				
-						// Test adapter configuration
-				
-						// Preamble
-						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
-						
-						v_containerIndex := f_cse_createResource(int3, v_createRequest, v_aeIndex);
-						
-						v_contentInstanceIndex := f_cse_createResource(int4, m_createContentInstanceBase, v_containerIndex);
-					
-						// Test Body
-						mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_containerIndex), f_getOriginator(v_containerIndex))));
-						
-						v_contentResponse.container := mw_contentContainerBase;
-						
-						tc_ac.start;
-						alt {
-							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))) -> value v_response {
-								tc_ac.stop;
-								setverdict(pass, __SCOPE__ & ": Response OK for retrieving");
-								if(v_response.primitive.responsePrimitive.primitiveContent.container.stateTag == vc_resourcesList[v_containerIndex].resource.container.stateTag + 1) {
-									setverdict(pass, __SCOPE__ & ": stateTag attribute increased after creation of contentInstance resource");
-								} else {
-									setverdict(fail, __SCOPE__ & ": stateTag attribute not incremented correctly after creation of contentInstance resource");
-								}
-							}
-							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))) -> value v_response {
-								tc_ac.stop;
-								setverdict(fail, __SCOPE__ & ": Wrong response status code");
-							}
-							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
-								tc_ac.stop;
-								setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements");
-							}
-							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
-								tc_ac.stop;
-								setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
-							}
-							[] tc_ac.timeout {
-								setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
-							}
-						}	
-								
-						// Postamble
-						f_cse_postamble_deleteResources();
-						
-						// Tear down
-						f_cf01Down();
-					    				
-					}//end TC_CSE_DMR_CRE_009
-						
-				}// end group g_CSE_DMR_CRE_009		
-				
-				group g_CSE_DMR_CRE_010 {
-					
-					/**
-					 * @desc Check that the IUT rejects the CREATE Request of a container resource named “la” as a direct child of a container resource 
-					 * 
-					 */
-					testcase TC_CSE_DMR_CRE_010() runs on AeSimu system CseSystem {
-						// Local variables
-						var template RequestPrimitive v_createRequest := m_createContainerBase;
-						var MsgIn v_response;
-						var RequestPrimitive v_request;
-						var integer v_aeIndex := -1;
-						var integer v_containerIndex := -1;
-						
-						// Test control
-				
-						// Test component configuration
-						f_cf01Up();
-				
-						// Test adapter configuration
-				
-						// Preamble
-						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
-						
-						v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex);
-					
-						// Test Body
-						v_createRequest.primitiveContent.container.resourceName := c_resourceShortNameLatest;
-						
-						v_request := f_getCreateRequestPrimitive(int3, v_createRequest, v_containerIndex);
-					
-						mcaPort.send(m_request(v_request));
-						tc_ac.start;
-						alt {
-							[] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) -> value v_response {
-								tc_ac.stop;
-								setverdict(pass, __SCOPE__ & ": Not allowed to create a contentInstance resource named 'la'");
-								
-							}
-							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
-								tc_ac.stop;
-								setverdict(fail, __SCOPE__ & ": Rejected creation of contentInstance named 'la' with wrong ResponseStatusCode");
-							}
-							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
-								tc_ac.stop;
-								setverdict(fail, __SCOPE__ & ": Accepted creation of contentInstance named 'la'");
-								
-							}
-							[] tc_ac.timeout {
-								setverdict(fail, __SCOPE__ & ": No answer while creating resource type 4");
-							}
-						}	
-								
-						f_checkAeSimuStatus();
-    					
-						//Check to see if the resource is NOT present
-						if(f_isResourceNotPresent(v_containerIndex, f_getResourceName(v_request.primitiveContent))){
-						  setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
-						} else {
-						  setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
-						}
-								
-						// Postamble
-						f_cse_postamble_deleteResources();
-						
-						// Tear down
-						f_cf01Down();
-					    				
-					}//end TC_CSE_DMR_CRE_010
-						
-				}// end group g_CSE_DMR_CRE_010	
-				
-				group g_CSE_DMR_CRE_011 {
-					
-					/**
-					 * @desc Check that the IUT rejects the CREATE Request of a container resource named “ol” as a direct child of a container resource 
-					 * 
-					 */
-					testcase TC_CSE_DMR_CRE_011() runs on AeSimu system CseSystem {
-						// Local variables
-						var template RequestPrimitive v_createRequest := m_createContainerBase;
-						var MsgIn v_response;
-						var RequestPrimitive v_request;
-						var integer v_aeIndex := -1;
-						var integer v_containerIndex := -1;
-						
-						// Test control
-				
-						// Test component configuration
-						f_cf01Up();
-				
-						// Test adapter configuration
-				
-						// Preamble
-						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
-						
-						v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex);
-					
-						// Test Body
-						v_createRequest.primitiveContent.container.resourceName := c_resourceShortNameOldest;
-						
-						v_request := f_getCreateRequestPrimitive(int3, v_createRequest, v_containerIndex);
-					
-						mcaPort.send(m_request(v_request));
-						tc_ac.start;
-						alt {
-							[] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) -> value v_response {
-								tc_ac.stop;
-								setverdict(pass, __SCOPE__ & ": Not allowed to create a contentInstance resource named 'ol'");
-								
-							}
-							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
-								tc_ac.stop;
-								setverdict(fail, __SCOPE__ & ": Rejected creation of contentInstance named 'ol' with wrong ResponseStatusCode");
-							}
-							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
-								tc_ac.stop;
-								setverdict(fail, __SCOPE__ & ": Accepted creation of contentInstance named 'ol'");
-								
-							}
-							[] tc_ac.timeout {
-								setverdict(fail, __SCOPE__ & ": No answer while creating resource type 4");
-							}
-						}	
-								
-						f_checkAeSimuStatus();
-    					
-						//Check to see if the resource is NOT present
-						if(f_isResourceNotPresent(v_containerIndex, f_getResourceName(v_request.primitiveContent))){
-						  setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
-						} else {
-						  setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
-						}
-								
-						// Postamble
-						f_cse_postamble_deleteResources();
-						
-						// Tear down
-						f_cf01Down();
-					    				
-					}//end TC_CSE_DMR_CRE_011
-						
-				}// end group g_CSE_DMR_CRE_011
-				
 				group g_CSE_DMR_CRE_012 {
 					
 					/**
@@ -1186,96 +970,6 @@ module OneM2M_Testcases_CSE_Release_2 {
 				
 				}// end group g_CSE_DMR_CRE_012	
 
-				group g_CSE_DMR_CRE_014{
-					
-					/**
-					 * @desc Check that the IUT updates the currentByteSize attribute in a <container> parent resource when a new <contentInstance> resource is created. 
-					 * 
-					 */
-					testcase TC_CSE_DMR_CRE_014() runs on AeSimu system CseSystem {
-						// Local variables
-						var template RequestPrimitive v_createRequest;
-						var MsgIn v_response;
-						var RequestPrimitive v_request;
-						var integer v_aeIndex := -1;
-						var integer v_containerIndex := -1;
-						var integer v_contentInstanceIndex := -1;
-						const integer c_maxByteSize := 512;				   
-						// Test control
-
-						// Test component configuration
-						f_cf01Up();
-
-						// Test adapter configuration
-
-						// Preamble
-						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
-
-						v_createRequest.primitiveContent.container.maxByteSize := c_maxByteSize;
-						
-						v_createRequest := m_createContainerBase;
-				
-						v_containerIndex := f_cse_createResource(int3, v_createRequest, v_aeIndex);
-						
-						
-						v_contentInstanceIndex := f_cse_createResource(int4, v_createRequest, v_containerIndex);	
-
-						// Test Body
-						v_request := f_getCreateRequestPrimitive(int4, m_createContentInstanceBase, v_containerIndex); //Default content: "AnyValue" (8 bytes length)
-	
-						mcaPort.send(m_request(v_request));
-						tc_ac.start;
-						alt {
-							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response {
-								tc_ac.stop;
-								setverdict(pass, __SCOPE__ & ": ContentInstance resource created");
-							}
-							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
-								tc_ac.stop;
-								setverdict(fail, __SCOPE__ & ": Wrong response status code");
-							}
-							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
-								tc_ac.stop;
-								setverdict(fail, __SCOPE__ & ": Error when creating contentInstance resource");
-							}
-							[] tc_ac.timeout {
-								setverdict(fail, __SCOPE__ & ": No answer while creating resource type 4");
-							}
-						}	
-						
-						//Check currentByteSize
-						mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_containerIndex), f_getOriginator(v_containerIndex))));
-
-						tc_ac.start;
-						alt {
-							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
-								tc_ac.stop;
-								if(v_response.primitive.responsePrimitive.primitiveContent.container.currentByteSize == 8) { //Default content: "AnyValue" (8 bytes length)
-									setverdict(pass, __SCOPE__ & ": CurrentByteSize attribute in content resource is incremented successfully");	
-								}
-								else{
-									setverdict(fail, __SCOPE__ & ": CurrentByteSize attribute in content resource not incremented successfully");
-								}
-							}
-							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
-								tc_ac.stop;
-								setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
-							}
-							[] tc_ac.timeout {
-								setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
-							}
-						}	
-
-						// Postamble
-						f_cse_postamble_deleteResources();
-
-						// Tear down
-						f_cf01Down();
-		
-					}//end TC_CSE_DMR_CRE_014
-
-				}// end group g_CSE_DMR_CRE_014		
-
 				group g_CSE_DMR_CRE_015 {
 					
 					/**
@@ -3896,75 +3590,6 @@ module OneM2M_Testcases_CSE_Release_2 {
 					
 				} // end g_CSE_DMR_UPD_008				
 
-				group g_CSE_DMR_UPD_010{
-
-					/**
-					 * @desc Check that the stateTag attribute of a container resource is increased when an update operation has been performed on its child resource
-					 * 
-					 */
-					testcase TC_CSE_DMR_UPD_010() runs on AeSimu system CseSystem {
-						var MsgIn v_response;
-						var integer v_aeIndex := -1;
-						var integer v_containerIndex := -1;
-						var RequestPrimitive v_updateRequest := valueof(m_updateContainerBase);
-						var Labels v_labels_1:= {"VALUE_1"};
-						v_updateRequest.primitiveContent.container.labels := v_labels_1;
-				   
-						// Test control
-
-						// Test component configuration
-						f_cf01Up();
-
-						// Test adapter configuration
-
-						// Preamble
-						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
-		
-						v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 
-		
-						// Test Body
-						if(ispresent(vc_resourcesList[v_containerIndex].resource.container.stateTag)) { 
-		
-							v_updateRequest := f_getUpdateRequestPrimitive(int3, v_containerIndex, v_updateRequest);
-							f_cse_updateResource(v_updateRequest);
-
-							mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_containerIndex), f_getOriginator(v_containerIndex))));
-
-							tc_ac.start;
-							alt {
-								[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
-									tc_ac.stop;
-									if(v_response.primitive.responsePrimitive.primitiveContent.container.stateTag == 1) { //(Create and Delete)
-										setverdict(pass, __SCOPE__ & ": The stateTag attribute is incremented");	
-									}
-									else{
-										setverdict(fail, __SCOPE__ & ": Error the stateTag attribute is not incremented");
-									}
-								}
-								[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
-									tc_ac.stop;
-									setverdict(fail, __SCOPE__ & ": Error while retrieving resource attributes");
-								}
-								[] tc_ac.timeout {
-									setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes");
-								}
-							}	
-				
-						}//end if
-						else{
-							setverdict(fail, __SCOPE__ & ": Error the stateTag attribute is empty");
-						}
-		
-						// Postamble
-						f_cse_postamble_deleteResources();
-
-						// Tear down
-						f_cf01Down();
-			
-					}//end TC_CSE_DMR_UPD_010
-					
-				} // end group g_CSE_DMR_UPD_010
-				
 				group g_CSE_DMR_UPD_014 {
 					
 					/**
@@ -5208,97 +4833,6 @@ module OneM2M_Testcases_CSE_Release_2 {
                 
 				};//end of group g_CSE_DMR_DEL_004
 
-				group g_CSE_DMR_DEL_005{
-
-					/**
-					 * @desc Check that the stateTag attribute of a container resource is increased when a child resource is deleted
-					 * 
-					 */
-					testcase TC_CSE_DMR_DEL_005() runs on AeSimu system CseSystem {
-						// Local variables
-						var MsgIn v_response;
-						var RequestPrimitive v_request;
-						var integer v_aeIndex := -1;
-						var integer v_resourceIndex := -1;
-						var integer v_childResourceIndex := -1; 
-						const ResourceType c_containerResourceType := int3;          			
-            					   
-						// Test control
-            
-						// Test component configuration
-						f_cf01Up();
-            
-						// Test adapter configuration
-            
-						// Preamble
-						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
-						
-						v_resourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_aeIndex); 
-            			
-						if(ispresent(vc_resourcesList[v_resourceIndex].resource.container.stateTag)) {
-            				
-							v_childResourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_resourceIndex); 
-            				
-							// Test Body
-							mcaPort.send(m_request(m_delete(f_getResourceAddress(v_childResourceIndex), f_getOriginator(v_childResourceIndex))));
-							            	
-							tc_ac.start;
-							alt {
-								[] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) -> value v_response {
-									tc_ac.stop;
-									setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(c_containerResourceType)) & " delete successfully");
-								}
-								[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
-									tc_ac.stop;
-									setverdict(fail, __SCOPE__ & ": Wrong response status code");
-								}
-								[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
-									tc_ac.stop;
-									setverdict(fail, __SCOPE__ & ": Error while deleting resource type " & int2str(enum2int(c_containerResourceType)));
-								}
-								[] tc_ac.timeout {
-									setverdict(fail, __SCOPE__ & ": No answer while deleting resource type " & int2str(enum2int(c_containerResourceType)));
-								}
-							}
-            	
-            	
-            	
-							mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))));
-            
-							tc_ac.start;
-							alt {
-								[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
-									tc_ac.stop;
-									if(v_response.primitive.responsePrimitive.primitiveContent.container.stateTag == 2) { //(Create and Delete)
-										setverdict(pass, __SCOPE__ & ": The stateTag attribute is incremented");	
-									}
-									else{
-										setverdict(fail, __SCOPE__ & ": Error the stateTag attribute is not incremented");
-									}
-								}
-								[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
-									tc_ac.stop;
-									setverdict(fail, __SCOPE__ & ": Error while retrieving resource attributes");
-								}
-								[] tc_ac.timeout {
-									setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes");
-								}
-							}	
-            					
-						}//end if
-						else{
-							setverdict(fail, __SCOPE__ & ": Error the stateTag attribute is empty");
-						}
-            			
-						// Postamble
-						f_cse_postamble_deleteResources();
-            
-						// Tear down
-						f_cf01Down();
-            				
-					}//end f_CSE_DMR_DEL_005
-				} // end group g_CSE_DMR_DEL_005
-            	
 				group g_CSE_DMR_DEL_008{
 
 					/**
-- 
GitLab