Commit cfb514cd66903e2730697a57db7c452c791d4bea

Authored by Miguel Angel Reina Ortega
2 parents 38fd5e05 c7dbe726

Merge branch 'master' into oneM2M_Interop06_modifications

Signed-off-by: reinaortega <miguelangel.reinaortega@etsi.org>
... ... @@ -391,6 +391,28 @@ module OneM2M_Functions {
391 391 return v_resourceIndex;
392 392  
393 393 }
  394 +
  395 + /**
  396 + * @desc Getting last local resourceIndex saved in the vc_localResourcesList
  397 + * @param p_tester Given component
  398 + */
  399 + function f_getLatestLocalResourceIndex(in CseSimu p_component) runs on Tester return integer {
  400 + var integer v_resourceIndex;
  401 +
  402 + f_connectInfoPort(p_component);
  403 +
  404 + p_component.start(f_sendLatestLocalResourceIndex());
  405 + alt {
  406 + []infoPort.receive(mw_resourceIndex) -> value v_resourceIndex{
  407 + }
  408 + }
  409 +
  410 + p_component.done;
  411 + f_disconnectInfoPort(p_component);
  412 +
  413 + return v_resourceIndex;
  414 +
  415 + }
394 416  
395 417 /**
396 418 * @desc Getting primitiveContent retrieved in an AeSimu component
... ... @@ -491,6 +513,15 @@ module OneM2M_Functions {
491 513 }
492 514  
493 515 /**
  516 + * @desc Sending of last local resourceIndex saved in the vc_localResourcesList
  517 + */
  518 + function f_sendLatestLocalResourceIndex() runs on CseSimu {
  519 +
  520 + infoPort.send(lengthof(vc_localResourcesList)-1);
  521 +
  522 + }
  523 +
  524 + /**
494 525 * @desc Sending of last primitiveContent retrieved (vc_primitiveContentRetrievedResource) through InfoPort
495 526 */
496 527 function f_sendPrimitiveContentRetrievedResource() runs on AeSimu {
... ... @@ -939,6 +970,54 @@ module OneM2M_Functions {
939 970 }
940 971  
941 972 /**
  973 + * @desc Message exchange for the creation of a resource
  974 + * @param p_resourceType Resource type of the resource to be created
  975 + * @param p_requestPrimitive UPDATE request primitive to be used
  976 + * @param p_resourceIndex Internal resource index which indicates the resource to be updated
  977 + * @verdict
  978 + */
  979 + function f_cse_createResourceHandler(template RequestPrimitive p_request) runs on CseSimu return integer{
  980 +
  981 + var integer v_localResourceIndex := -1;
  982 + var integer v_parentResourceIndex := -1;
  983 + var ResponsePrimitive v_response;
  984 + var PrimitiveContent v_localResource;
  985 +
  986 + //Activate defaults when running on a PTC
  987 + f_cse_activateDefaults_cse1();
  988 +
  989 + tc_ac.start;
  990 + alt {
  991 + [] mccPortIn.receive(mw_request(p_request)) -> value vc_request {
  992 + tc_ac.stop;
  993 + v_parentResourceIndex := f_getResourceIndex(vc_request.primitive.requestPrimitive.to_);
  994 + if(v_parentResourceIndex == -1) {
  995 + log(__SCOPE__&": ERROR: Target resource not found");
  996 + v_response := valueof(m_responsePrimitive(int4004,vc_request.primitive.requestPrimitive.requestIdentifier));
  997 +
  998 + } else {
  999 + v_localResource := f_generateLocalResource(vc_request.primitive.requestPrimitive.primitiveContent, v_parentResourceIndex, vc_request.primitive.requestPrimitive.resourceType);
  1000 + v_localResourceIndex := f_setLocalResource(v_localResource, vc_request.primitive.requestPrimitive.resourceType, v_parentResourceIndex);
  1001 +
  1002 + v_response := valueof(m_responsePrimitive(int2001,vc_request.primitive.requestPrimitive.requestIdentifier));
  1003 + v_response.primitiveContent := vc_localResourcesList[v_localResourceIndex].resource;
  1004 + }
  1005 + v_response.from_ := PX_CSE1_ID;
  1006 + v_response.to_ := vc_request.primitive.requestPrimitive.from_;
  1007 + mccPortIn.send(f_getMsgOutPrimitive(m_response(v_response)));
  1008 + }
  1009 + [] tc_ac.timeout {
  1010 + setverdict(inconc, __SCOPE__&":INFO: No creation for resource received");
  1011 + }
  1012 + }
  1013 +
  1014 + f_checkCseSimuStatus();
  1015 +
  1016 + return v_localResourceIndex;
  1017 +
  1018 + }// end f_cse_createResourceHandler
  1019 +
  1020 + /**
942 1021 * @desc Creation of a local resource
943 1022 * @param p_resourceType Resource type of the resource to be created
944 1023 * @param p_requestPrimitive CREATE request primitive for the resource to be created
... ... @@ -1133,6 +1212,51 @@ module OneM2M_Functions {
1133 1212 }// end f_cse_updateResource
1134 1213  
1135 1214 /**
  1215 + * @desc Message exchange for the update of a resource
  1216 + * @param p_resourceType Resource type of the resource to be created
  1217 + * @param p_requestPrimitive UPDATE request primitive to be used
  1218 + * @param p_resourceIndex Internal resource index which indicates the resource to be updated
  1219 + * @verdict
  1220 + */
  1221 + function f_cse_updateResourceHandler(integer p_resourceIndex, template RequestPrimitive p_request) runs on CseSimu {
  1222 +
  1223 + var integer v_targetResourceIndex := -1;
  1224 + var ResponsePrimitive v_response;
  1225 +
  1226 + //Activate defaults when running on a PTC
  1227 + f_cse_activateDefaults_cse1();
  1228 +
  1229 + tc_ac.start;
  1230 + alt {
  1231 + [] mccPortIn.receive(mw_request(p_request)) -> value vc_request {
  1232 + tc_ac.stop;
  1233 + v_targetResourceIndex := f_getResourceIndex(vc_request.primitive.requestPrimitive.to_);
  1234 + if(v_targetResourceIndex == p_resourceIndex) {
  1235 + setverdict(pass, __SCOPE__&":INFO: Resource updated successfuly");
  1236 + v_response := valueof(m_responsePrimitive(int2004,vc_request.primitive.requestPrimitive.requestIdentifier));
  1237 + v_response.from_ := vc_localResourcesList[vc_cSEBaseIndex].resource.cSEBase.cSE_ID;
  1238 + v_response.to_ := vc_request.primitive.requestPrimitive.from_;
  1239 + f_updateLocalResource(v_targetResourceIndex, vc_request.primitive.requestPrimitive.primitiveContent);
  1240 + v_response.primitiveContent := vc_localResourcesList[v_targetResourceIndex].resource;
  1241 + } else {
  1242 + setverdict(inconc, __SCOPE__&":INFO: Unexpected resource update");
  1243 + log(__SCOPE__&": ERROR: Resource Index not valid");
  1244 + v_response := valueof(m_responsePrimitive(int4004,vc_request.primitive.requestPrimitive.requestIdentifier));
  1245 + v_response.from_ := PX_CSE1_ID;
  1246 + v_response.to_ := vc_request.primitive.requestPrimitive.from_;
  1247 + }
  1248 + mccPortIn.send(f_getMsgOutPrimitive(m_response(v_response)));
  1249 + }
  1250 + [] tc_ac.timeout {
  1251 + setverdict(inconc, __SCOPE__&":INFO: No answer while updating resource");
  1252 + }
  1253 + }
  1254 +
  1255 + f_checkCseSimuStatus();
  1256 +
  1257 + }// end f_cse_updateResourceHandler
  1258 +
  1259 + /**
1136 1260 * @desc Message exchange for the retrieval of a resource
1137 1261 * @param p_resourceIndex Resource index of the resource to be retrieved
1138 1262 * @return PrimitiveContent parameter of the RETRIEVE response
... ... @@ -1457,12 +1581,11 @@ module OneM2M_Functions {
1457 1581 * @return Internal resource index of the created resource
1458 1582 * @verdict
1459 1583 */
1460   - function f_cse_sendUpdateRequestPrimitive(in ResourceType p_resourceType, template RequestPrimitive p_requestUpdatePrimitive := m_update, integer p_parentIndex := -1) runs on AeSimu {
  1584 + function f_cse_sendUpdateRequestPrimitive(in ResourceType p_resourceType, template RequestPrimitive p_requestUpdatePrimitive := m_update, integer p_targetIndex := -1) runs on AeSimu {
1461 1585  
1462 1586 var RequestPrimitive v_request;
1463   - var integer v_resourceIndex := -1;
1464 1587  
1465   - v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_requestUpdatePrimitive);
  1588 + v_request := f_getUpdateRequestPrimitive(p_resourceType, p_targetIndex, p_requestUpdatePrimitive);
1466 1589  
1467 1590 mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
1468 1591  
... ... @@ -1613,7 +1736,7 @@ module OneM2M_Functions {
1613 1736 setverdict(fail, __SCOPE__ & ":ERROR: Notification received but the content doesn't match");
1614 1737 }
1615 1738 //Send response in any case
1616   - v_responsePrimitive := valueof(m_responseNotification(int2001, omit));
  1739 + v_responsePrimitive := valueof(m_responseNotification(int2000, omit));
1617 1740 v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier;
1618 1741 mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
1619 1742 }
... ... @@ -1645,14 +1768,14 @@ module OneM2M_Functions {
1645 1768 [] mcaPortIn.receive(mw_request(mw_notifyResponsePrimitive(p_responsePrimitive))) -> value vc_request {
1646 1769 tc_ac.stop;
1647 1770 setverdict(pass, __SCOPE__ & ":INFO: Notification received with the expected content");
1648   - v_responsePrimitive := valueof(m_responseNotification(int2001, omit));
  1771 + v_responsePrimitive := valueof(m_responseNotification(int2000, omit));
1649 1772 v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier;
1650 1773 mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
1651 1774 }
1652 1775 [] mcaPortIn.receive(mw_request(mw_notifyResponsePrimitive(?))) -> value vc_request {
1653 1776 tc_ac.stop;
1654 1777 setverdict(fail, __SCOPE__ & ":ERROR: Notification received but the content doesn't match");
1655   - v_responsePrimitive := valueof(m_responseNotification(int2001, omit));
  1778 + v_responsePrimitive := valueof(m_responseNotification(int2000, omit));
1656 1779 v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier;
1657 1780 mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
1658 1781 }
... ... @@ -1786,10 +1909,8 @@ module OneM2M_Functions {
1786 1909 * @param p_requestPrimitive Notify request to be used for the notification
1787 1910 * @verdict
1788 1911 */
1789   - function f_cse_notifyProcedure_notify(template (value) RequestPrimitive p_requestPrimitive) runs on CseSimu {
  1912 + function f_cse_notifyProcedure_notify(template RequestPrimitive p_requestPrimitive) runs on CseSimu {
1790 1913 // Local variables
1791   -
1792   - //var RequestPrimitive v_request;
1793 1914 var ResponsePrimitive v_responsePrimitive;
1794 1915 var integer v_resourceIndex := -1;
1795 1916  
... ... @@ -1889,12 +2010,12 @@ module OneM2M_Functions {
1889 2010  
1890 2011 /**
1891 2012 * @desc Handling of announcement of resources
1892   - * @param p_from Expected originator of the request primitive
1893   - * @param p_to Expected receiver of the request primitive
  2013 + * @param p_requestPrimitive Expected announcement primitive
  2014 + * @param p_responseStatusCode Response Status code to be sent as response
  2015 + * @param p_expectedResourceIndex Expected target parent resource of the announcemnet
1894 2016 * @verdict
1895 2017 */
1896   - //TODO To finalize this function
1897   - function f_cse_announcementProcedure_createHandler(template RequestPrimitive p_requestprimitive := ?, in ResponseStatusCode p_responseStatusCode := int2001, template(omit) integer p_expectedResourceIndex := omit) runs on CseSimu {
  2018 + function f_cse_announcementProcedure_createHandler(template RequestPrimitive p_requestprimitive := ?, in ResponseStatusCode p_responseStatusCode := int2001, template(omit) integer p_expectedResourceIndex := omit) runs on CseSimu return integer{
1898 2019 // Local variables
1899 2020 var MsgIn v_request;
1900 2021 var integer v_parentIndex := vc_localRemoteCseIndex;
... ... @@ -1909,39 +2030,53 @@ module OneM2M_Functions {
1909 2030 alt {
1910 2031 [] mccPortIn.receive(mw_request(p_requestprimitive)) -> value v_request {
1911 2032 tc_ac.stop;
1912   - setverdict(pass, __SCOPE__ & ":INFO: Announcement received");
1913   - //TODO Save resource and generate required attributes
1914   - v_announcedResource:= f_generateLocalResource(v_request.primitive.requestPrimitive.primitiveContent, v_parentIndex,v_request.primitive.requestPrimitive.resourceType);
1915   - v_announcedResourceIndex := f_setLocalResource(v_announcedResource, v_request.primitive.requestPrimitive.resourceType, v_parentIndex);
1916   -
1917   - if(isvalue(p_expectedResourceIndex)){
1918   - if(p_expectedResourceIndex == f_getResourceIndex(v_request.primitive.requestPrimitive.to_)){
1919   - setverdict(pass, __SCOPE__ & ":INFO: Announcement Parent Resource Address matched");
1920   - v_responsePrimitive := valueof(m_responsePrimitive(p_responseStatusCode,v_request.primitive.requestPrimitive.requestIdentifier));
1921   - v_responsePrimitive.primitiveContent := vc_localResourcesList[p_expectedResourceIndex].resource;
1922   - } else {
1923   - setverdict(fail, __SCOPE__ & ":ERROR: Announcement Parent Resource Address not matched");
1924   - v_responsePrimitive := valueof(m_responsePrimitive(int4000,v_request.primitive.requestPrimitive.requestIdentifier));
1925   - v_responsePrimitive.primitiveContent := omit;
1926   - }
  2033 + setverdict(pass, __SCOPE__ & ":INFO: Expected Announcement received");
  2034 + v_parentIndex := f_getResourceIndex(v_request.primitive.requestPrimitive.to_);
  2035 + if(v_parentIndex == -1) {
  2036 + log(__SCOPE__&": ERROR: Target resource not found");
  2037 + v_responsePrimitive := valueof(m_responsePrimitive(int4004,v_request.primitive.requestPrimitive.requestIdentifier));
  2038 +
1927 2039 } else {
1928   - v_responsePrimitive := valueof(m_responsePrimitive(p_responseStatusCode,v_request.primitive.requestPrimitive.requestIdentifier));
1929   - if(p_responseStatusCode == int2001) {
1930   - v_responsePrimitive.primitiveContent := vc_localResourcesList[v_announcedResourceIndex].resource;
  2040 + //Save resource and generate required attributes
  2041 + v_announcedResource:= f_generateLocalResource(v_request.primitive.requestPrimitive.primitiveContent, v_parentIndex,v_request.primitive.requestPrimitive.resourceType);
  2042 + v_announcedResourceIndex := f_setLocalResource(v_announcedResource, v_request.primitive.requestPrimitive.resourceType, v_parentIndex);
  2043 +
  2044 + if(isvalue(p_expectedResourceIndex)){
  2045 + if(valueof(p_expectedResourceIndex) == v_parentIndex){
  2046 + setverdict(pass, __SCOPE__ & ":INFO: Announcement Parent Resource Address matched");
  2047 + v_responsePrimitive := valueof(m_responsePrimitive(p_responseStatusCode,v_request.primitive.requestPrimitive.requestIdentifier));
  2048 + v_responsePrimitive.primitiveContent := vc_localResourcesList[v_announcedResourceIndex].resource;
  2049 + } else {
  2050 + setverdict(fail, __SCOPE__ & ":ERROR: Announcement Parent Resource Address not matched");
  2051 + v_responsePrimitive := valueof(m_responsePrimitive(int4000,v_request.primitive.requestPrimitive.requestIdentifier));
  2052 + v_responsePrimitive.primitiveContent := omit;
  2053 + }
1931 2054 } else {
1932   - v_responsePrimitive.primitiveContent := omit;
  2055 + v_responsePrimitive := valueof(m_responsePrimitive(p_responseStatusCode,v_request.primitive.requestPrimitive.requestIdentifier));
  2056 + if(p_responseStatusCode == int2001) {
  2057 + v_responsePrimitive.primitiveContent := vc_localResourcesList[v_announcedResourceIndex].resource;
  2058 + } else {
  2059 + v_responsePrimitive.primitiveContent := omit;
  2060 + }
1933 2061 }
1934 2062 }
1935 2063 v_responsePrimitive.from_ := PX_CSE1_ID;
1936 2064 v_responsePrimitive.to_ := v_request.primitive.requestPrimitive.from_;
1937 2065 mccPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
1938 2066 }
  2067 + [] mccPortIn.receive(mw_request(?)) -> value v_request {
  2068 + setverdict(fail, __SCOPE__ & ":ERROR: Request received with unexpected parameters");
  2069 + v_responsePrimitive := valueof(m_responsePrimitive(int4000,v_request.primitive.requestPrimitive.requestIdentifier));
  2070 + mccPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
  2071 + }
1939 2072 [] tc_ac.timeout {
1940 2073 setverdict(fail, __SCOPE__ & ":ERROR: No announcement received");
1941 2074 }
1942 2075 }
1943 2076  
1944 2077 f_checkCseSimuStatus();
  2078 +
  2079 + return v_announcedResourceIndex;
1945 2080  
1946 2081 } //end f_cse_announcementProcedure_createHandler
1947 2082  
... ... @@ -2160,7 +2295,7 @@ module OneM2M_Functions {
2160 2295  
2161 2296 var MsgIn v_response;
2162 2297 var RequestPrimitive v_request;
2163   - var PrimitiveContent v_remoteCSEResource;
  2298 + var PrimitiveContent v_localRemoteCSEResource;
2164 2299  
2165 2300 //Activate defaults when running on a PTC
2166 2301 f_cse_activateDefaults_cse1();
... ... @@ -2175,8 +2310,8 @@ module OneM2M_Functions {
2175 2310 setverdict(pass, __SCOPE__&":INFO: Resource type remoteCSE created successfuly");
2176 2311 f_checkAttributesToBeSaved(int16, v_request, v_response.primitive.responsePrimitive);
2177 2312 vc_remoteCseIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int16, -1);
2178   - v_remoteCSEResource := f_generateLocalResource(v_response.primitive.responsePrimitive.primitiveContent, vc_cSEBaseIndex, int16);
2179   - vc_localRemoteCseIndex := f_setLocalResource(v_remoteCSEResource, int16, vc_cSEBaseIndex);
  2313 + v_localRemoteCSEResource := f_generateLocalResource(m_primitiveContentRemoteCSE(m_contentCreateRemoteCSE(PX_CSE_NAME,omit,PX_CSE_ID,PX_CSE_ID)),vc_cSEBaseIndex, int16);
  2314 + vc_localRemoteCseIndex := f_setLocalResource(v_localRemoteCSEResource, int16, vc_cSEBaseIndex);
2180 2315 }
2181 2316 [] mccPort.receive(mw_response(mw_responsePrimitiveKO)) {
2182 2317 tc_ac.stop;
... ... @@ -2355,7 +2490,7 @@ module OneM2M_Functions {
2355 2490  
2356 2491 v_myResource.aEAnnc.resourceName := "aEAnnc" & int2str(v_resourceIndex);
2357 2492 v_myResource.aEAnnc.resourceType := p_resourceType;
2358   - v_myResource.aEAnnc.resourceID := f_resourceIdCleaner(v_myResource.aEAnnc.aE_ID);
  2493 + v_myResource.aEAnnc.resourceID := "ae" & int2str(v_resourceIndex);
2359 2494 v_myResource.aEAnnc.parentID := f_getResourceId(vc_localResourcesList[p_parentIndex].resource);
2360 2495 v_myResource.aEAnnc.creationTime := fx_generateTimestamp();
2361 2496 v_myResource.aEAnnc.lastModifiedTime := v_myResource.aEAnnc.creationTime;
... ... @@ -2366,7 +2501,7 @@ module OneM2M_Functions {
2366 2501  
2367 2502 v_myResource.accessControlPolicyAnnc.resourceName := "accessControlPolicyAnnc" & int2str(v_resourceIndex);
2368 2503 v_myResource.accessControlPolicyAnnc.resourceType := p_resourceType;
2369   - v_myResource.accessControlPolicyAnnc.resourceID := f_resourceIdCleaner(v_myResource.accessControlPolicyAnnc.resourceID);
  2504 + v_myResource.accessControlPolicyAnnc.resourceID := "acpA" & int2str(v_resourceIndex);
2370 2505 v_myResource.accessControlPolicyAnnc.parentID := f_getResourceId(vc_localResourcesList[p_parentIndex].resource);
2371 2506 v_myResource.accessControlPolicyAnnc.creationTime := fx_generateTimestamp();
2372 2507 v_myResource.accessControlPolicyAnnc.lastModifiedTime := v_myResource.accessControlPolicyAnnc.creationTime;
... ... @@ -2377,7 +2512,7 @@ module OneM2M_Functions {
2377 2512  
2378 2513 v_myResource.containerAnnc.resourceName := "containerAnnc" & int2str(v_resourceIndex);
2379 2514 v_myResource.containerAnnc.resourceType := p_resourceType;
2380   - v_myResource.containerAnnc.resourceID := f_resourceIdCleaner(v_myResource.containerAnnc.resourceID);
  2515 + v_myResource.containerAnnc.resourceID := "cntA" & int2str(v_resourceIndex);
2381 2516 v_myResource.containerAnnc.parentID := f_getResourceId(vc_localResourcesList[p_parentIndex].resource);
2382 2517 v_myResource.containerAnnc.creationTime := fx_generateTimestamp();
2383 2518 v_myResource.containerAnnc.lastModifiedTime := v_myResource.containerAnnc.creationTime;
... ... @@ -2388,18 +2523,18 @@ module OneM2M_Functions {
2388 2523  
2389 2524 v_myResource.groupAnnc.resourceName := "groupAnnc" & int2str(v_resourceIndex);
2390 2525 v_myResource.groupAnnc.resourceType := p_resourceType;
2391   - v_myResource.groupAnnc.resourceID := f_resourceIdCleaner(v_myResource.groupAnnc.resourceID);
  2526 + v_myResource.groupAnnc.resourceID := "grpA" & int2str(v_resourceIndex);
2392 2527 v_myResource.groupAnnc.parentID := f_getResourceId(vc_localResourcesList[p_parentIndex].resource);
2393 2528 v_myResource.groupAnnc.creationTime := fx_generateTimestamp();
2394 2529 v_myResource.groupAnnc.lastModifiedTime := v_myResource.groupAnnc.creationTime;
2395 2530 }
2396   - } else if (p_resourceType == int10014 and ispresent (p_resource)) { //ContentInstance Annc
  2531 + } else if (p_resourceType == int10004 and ispresent (p_resource)) { //ContentInstance Annc
2397 2532 if(ischosen(p_resource.contentInstanceAnnc)) {
2398 2533 v_myResource.contentInstanceAnnc := valueof(p_resource.contentInstanceAnnc);
2399 2534  
2400 2535 v_myResource.contentInstanceAnnc.resourceName := "contentInstanceAnnc" & int2str(v_resourceIndex);
2401 2536 v_myResource.contentInstanceAnnc.resourceType := p_resourceType;
2402   - v_myResource.contentInstanceAnnc.resourceID := f_resourceIdCleaner(v_myResource.contentInstanceAnnc.resourceID);
  2537 + v_myResource.contentInstanceAnnc.resourceID := "cinA" & int2str(v_resourceIndex);
2403 2538 v_myResource.contentInstanceAnnc.parentID := f_getResourceId(vc_localResourcesList[p_parentIndex].resource);
2404 2539 v_myResource.contentInstanceAnnc.creationTime := fx_generateTimestamp();
2405 2540 v_myResource.contentInstanceAnnc.lastModifiedTime := v_myResource.contentInstanceAnnc.creationTime;
... ... @@ -2465,7 +2600,7 @@ module OneM2M_Functions {
2465 2600 }
2466 2601 v_myResource.contentInstance.stateTag := 0;
2467 2602 v_myResource.contentInstance.contentSize := lengthof(v_myResource.contentInstance.content);
2468   - v_myResource.contentInstance.content := p_resource.contentInstance.content;
  2603 + v_myResource.contentInstance.content := valueof(p_resource.contentInstance.content);
2469 2604 }
2470 2605  
2471 2606 }
... ... @@ -2493,7 +2628,7 @@ module OneM2M_Functions {
2493 2628 vc_localResourcesList[p_localResourceIndex].resource.remoteCSE.labels := p_resource.remoteCSE.labels;
2494 2629 }
2495 2630 if(ispresent(p_resource.remoteCSE.announceTo)) {
2496   - vc_localResourcesList[p_localResourceIndex].resource.remoteCSE.announceTo := p_resource.remoteCSE.announceTo;
  2631 + vc_localResourcesList[p_localResourceIndex].resource.remoteCSE.announceTo := {p_resource.remoteCSE.announceTo[0] & "/" & vc_localResourcesList[vc_localRemoteCseIndex].resource.remoteCSE.resourceID & "Annc"};
2497 2632 }
2498 2633 if(ispresent(p_resource.remoteCSE.announcedAttribute)) {
2499 2634 vc_localResourcesList[p_localResourceIndex].resource.remoteCSE.announcedAttribute := p_resource.remoteCSE.announcedAttribute;
... ... @@ -2738,6 +2873,27 @@ module OneM2M_Functions {
2738 2873 tc_ac.start(10.0);
2739 2874 repeat;
2740 2875 }
  2876 + [] mccPortIn.receive(mw_request(mw_delete())) -> value v_request {
  2877 + tc_ac.stop;
  2878 + log(__SCOPE__&": WARNING: Unexpected DELETE message received");
  2879 +
  2880 + v_localResourceIndex := f_getResourceIndex(v_request.primitive.requestPrimitive.to_);
  2881 + if(v_localResourceIndex == -1)
  2882 + {
  2883 + log(__SCOPE__&": ERROR: Resource Index not valid");
  2884 + v_response := valueof(m_responsePrimitive(int4004,v_request.primitive.requestPrimitive.requestIdentifier));
  2885 + v_response.from_ := PX_CSE1_ID;
  2886 + v_response.to_ := v_request.primitive.requestPrimitive.from_;
  2887 + mccPortIn.send(f_getMsgOutPrimitive(m_response(v_response)));
  2888 + } else {
  2889 + v_response := valueof(m_responsePrimitive(int2002,v_request.primitive.requestPrimitive.requestIdentifier));
  2890 + v_response.from_ := PX_CSE1_ID;
  2891 + v_response.to_ := v_request.primitive.requestPrimitive.from_;
  2892 + mccPortIn.send(f_getMsgOutPrimitive(m_response(v_response)));
  2893 + }
  2894 + tc_ac.start(10.0);
  2895 + repeat;
  2896 + }
2741 2897 [] mccPortIn.receive (mw_request(?)){
2742 2898 log(__SCOPE__&": WARNING: Unexpected message received");
2743 2899 repeat;
... ... @@ -3185,7 +3341,7 @@ module OneM2M_Functions {
3185 3341  
3186 3342 if (p_resourceType == int15) {//pollingChannel
3187 3343 //TODO
3188   - //p_request.from_ := "CnOTALLOWEDAEID";
  3344 +
3189 3345 }
3190 3346  
3191 3347 if (p_resourceType == int23) {//subscription
... ... @@ -3209,6 +3365,9 @@ module OneM2M_Functions {
3209 3365 if(ischosen(p_contentResource.container)) {
3210 3366 return f_resourceIdCleaner(p_contentResource.container.resourceID);
3211 3367 }
  3368 + if(ischosen(p_contentResource.containerAnnc)) {
  3369 + return f_resourceIdCleaner(p_contentResource.containerAnnc.resourceID);
  3370 + }
3212 3371 if(ischosen(p_contentResource.contentInstance)) {
3213 3372 return f_resourceIdCleaner(p_contentResource.contentInstance.resourceID);
3214 3373 }
... ... @@ -3686,6 +3845,79 @@ module OneM2M_Functions {
3686 3845 }
3687 3846  
3688 3847 /**
  3848 + * @desc Set parentID into the resource
  3849 + * @param p_resource Resource to be modified
  3850 + * @param p_parentID ParentID to be set
  3851 + * @return
  3852 + * @verdict
  3853 + */
  3854 + function f_setParentID(PrimitiveContent p_resource, XSD.ID p_parentID) runs on Tester return PrimitiveContent {
  3855 +
  3856 + if (ischosen(p_resource.aE)){
  3857 + p_resource.aE.parentID := p_parentID;
  3858 + }
  3859 + else if (ischosen(p_resource.accessControlPolicy)){
  3860 + p_resource.accessControlPolicy.parentID := p_parentID;
  3861 + }
  3862 + else if (ischosen(p_resource.accessControlPolicyAnnc)){
  3863 + p_resource.accessControlPolicyAnnc.parentID := p_parentID;
  3864 + }
  3865 + else if (ischosen(p_resource.container)){
  3866 + p_resource.container.parentID := p_parentID;
  3867 + }
  3868 + else if (ischosen(p_resource.containerAnnc)){
  3869 + p_resource.containerAnnc.parentID := p_parentID;
  3870 + }
  3871 + else if (ischosen(p_resource.group_)){
  3872 + p_resource.group_.parentID := p_parentID;
  3873 + }
  3874 + else if (ischosen(p_resource.groupAnnc)){
  3875 + p_resource.groupAnnc.parentID := p_parentID;
  3876 + }
  3877 + else if (ischosen(p_resource.serviceSubscribedAppRule)){
  3878 + p_resource.serviceSubscribedAppRule.parentID := p_parentID;
  3879 + }
  3880 + else if (ischosen(p_resource.subscription)){
  3881 + p_resource.subscription.parentID := p_parentID;
  3882 + }
  3883 + else if (ischosen(p_resource.locationPolicy)){
  3884 + p_resource.locationPolicy.parentID := p_parentID;
  3885 + }
  3886 + else if (ischosen(p_resource.delivery)){
  3887 + p_resource.delivery.parentID := p_parentID;
  3888 + }
  3889 + else if (ischosen(p_resource.mgmtCmd)){
  3890 + p_resource.mgmtCmd.parentID := p_parentID;
  3891 + }
  3892 + else if (ischosen(p_resource.node)){
  3893 + p_resource.node.parentID := p_parentID;
  3894 + }
  3895 + else if (ischosen(p_resource.remoteCSE)){
  3896 + p_resource.remoteCSE.parentID := p_parentID;
  3897 + }
  3898 + else if (ischosen(p_resource.remoteCSE)){
  3899 + p_resource.remoteCSE.parentID := p_parentID;
  3900 + }
  3901 + else if (ischosen(p_resource.request)){
  3902 + p_resource.request.parentID := p_parentID;
  3903 + }
  3904 + else if (ischosen(p_resource.statsCollect)){
  3905 + p_resource.statsCollect.parentID := p_parentID;
  3906 + }
  3907 + else if (ischosen(p_resource.statsConfig)){
  3908 + p_resource.statsConfig.parentID := p_parentID;
  3909 + }
  3910 + else if (ischosen(p_resource.timeSeries)){
  3911 + p_resource.timeSeries.parentID := p_parentID;
  3912 + }
  3913 + else if (ischosen(p_resource.timeSeriesAnnc)){
  3914 + p_resource.timeSeriesAnnc.parentID := p_parentID;
  3915 + } else {
  3916 + log( __SCOPE__, ":INFO: Resource not having acpi attribute. Not possible to set acpi")
  3917 + }
  3918 + return valueof(p_resource);
  3919 + }
  3920 + /**
3689 3921 * @desc Retrieve AE_ID for a given AE resource
3690 3922 * @param p_targetResourceIndex Internal resource index of the given resource
3691 3923 * @return AE_ID of the given resource
... ... @@ -3875,13 +4107,13 @@ module OneM2M_Functions {
3875 4107 * @param data Corresponding information for the correct execution of the given action
3876 4108 * @verdict
3877 4109 */
3878   - function f_aeSimu_checkComponentDoneAndGetVerdict(AeSimu p_ae) runs on AeSimu {
  4110 + function f_aeSimu_checkComponentDoneAndGetVerdict(Tester p_component) runs on AeSimu {
3879 4111  
3880 4112 var verdicttype v_verdict := none;
3881 4113  
3882 4114 tc_ac.start(15.0);
3883 4115 alt {
3884   - [] p_ae.done -> value v_verdict {
  4116 + [] p_component.done -> value v_verdict {
3885 4117 tc_ac.stop;
3886 4118 }
3887 4119 [] tc_ac.timeout {
... ... @@ -3920,13 +4152,13 @@ module OneM2M_Functions {
3920 4152 * @param data Corresponding information for the correct execution of the given action
3921 4153 * @verdict
3922 4154 */
3923   - function f_cseSimu_checkComponentDoneAndGetVerdict(AeSimu p_ae) runs on CseSimu {
  4155 + function f_cseSimu_checkComponentDoneAndGetVerdict(Tester p_component) runs on CseSimu {
3924 4156  
3925 4157 var verdicttype v_verdict := none;
3926 4158  
3927 4159 tc_ac.start(15.0);
3928 4160 alt {
3929   - [] p_ae.done -> value v_verdict {
  4161 + [] p_component.done -> value v_verdict {
3930 4162 tc_ac.stop;
3931 4163 }
3932 4164 [] tc_ac.timeout {
... ... @@ -3987,9 +4219,9 @@ module OneM2M_Functions {
3987 4219 * @param MsgOut MsgOut primitive
3988 4220 */
3989 4221  
3990   - function f_getMsgOutPrimitive(MsgOut p_msgOut) runs on Tester return MsgOut {
  4222 + function f_getMsgOutPrimitive(template MsgOut p_msgOut) runs on Tester return MsgOut {
3991 4223 p_msgOut.protocolBinding := vc_protocolBinding;
3992   - return p_msgOut;
  4224 + return valueof(p_msgOut);
3993 4225 }
3994 4226  
3995 4227 function f_sendUtPrimitive(template UtTriggerPrimitive p_utRequest, in universal charstring p_action) runs on Tester {
... ... @@ -4448,6 +4680,23 @@ module OneM2M_Functions {
4448 4680 }
4449 4681 return v_month;
4450 4682  
  4683 + } // end f_getMonth
  4684 +
  4685 + /**
  4686 + * @desc Retrieve Time from a given timestamp
  4687 + * @param p_timestamp Given timestamp
  4688 + * @return Time
  4689 + */
  4690 + function f_getTime(charstring p_timestamp) runs on Tester return integer {
  4691 +
  4692 + var charstring v_time := "";
  4693 + var integer i;
  4694 +
  4695 + for(i := 9; i <= 14; i := i+1){
  4696 + v_time := v_time & p_timestamp[i];
  4697 + }
  4698 + return str2int(v_time);
  4699 +
4451 4700 } // end f_getYear
4452 4701  
4453 4702 /**
... ...
... ... @@ -16,9 +16,8 @@ module OneM2M_Templates {
16 16 import from XSD all;
17 17 import from OneM2M_Types all;
18 18 import from OneM2M_TypesAndValues all;
19   - //import from OneM2M_AdditionalTypes all;
20 19 import from OneM2M_Pixits all;
21   - import from OneM2M_Functions all;
  20 + import from OneM2M_Functions all;
22 21  
23 22  
24 23 /**
... ... @@ -586,7 +585,15 @@ module OneM2M_Templates {
586 585 requestIdentifier := "m_updateRemoteCSEBase",
587 586 primitiveContent := {remoteCSE := m_contentUpdateRemoteCSE}
588 587 }
589   -
  588 +
  589 + /**
  590 + * @desc Reception template for update remoteCSE resource
  591 + */
  592 + template RequestPrimitive mw_updateRemoteCSE(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_update := {
  593 + resourceType := int16,
  594 + primitiveContent:= {remoteCSE := ?}
  595 + };
  596 +
590 597 template (value) RequestPrimitive m_updateAEAnncBase modifies m_update:= {
591 598 requestIdentifier := testcasename() & "-m_updateAEAnnc",
592 599 resourceType := int10002,
... ... @@ -755,12 +762,19 @@ module OneM2M_Templates {
755 762 };
756 763  
757 764 /**
758   - * @desc Reception template for CREATE AEAnnc
  765 + * @desc Reception template for CREATE AEAnnc for registration when AE-ID-Stem starts with S
759 766 */
760   - template RequestPrimitive mw_createAEAnnc(template XSD.ID p_from := ?, template XSD.ID p_to := ?, template AcpType p_accessControlPolicyIds := ?, template XSD.AnyURI p_link := ?) modifies mw_create := {
  767 + template RequestPrimitive mw_createAEAnnc_s_ae_id(template XSD.ID p_from := ?, template XSD.ID p_to := ?, template AcpType p_accessControlPolicyIds := ?, template XSD.AnyURI p_link := ?) modifies mw_create := {
761 768 primitiveContent := {aEAnnc := mw_contentCreateAEAnnc({"Credential-ID:None"}, p_accessControlPolicyIds)}
762 769 };
763 770  
  771 + /**
  772 + * @desc Reception template for CREATE AEAnnc as announced resource
  773 + */
  774 + template RequestPrimitive mw_createAEAnnc(template XSD.ID p_from := ?, template XSD.ID p_to := ?, template AcpType p_accessControlPolicyIds := ?, template XSD.AnyURI p_link := ?) modifies mw_create := {
  775 + primitiveContent := {aEAnnc := mw_contentCreateAEAnnc(-, p_accessControlPolicyIds)}
  776 + };
  777 +
764 778 template (value) RequestPrimitive m_createAe(XSD.ID p_appId, template (omit) AcpType p_accessControlPolicyIds := omit,template (omit) XSD.ID p_from := omit, template (omit) ResourceName p_resourceName := c_aeAuxName, in template (omit) PoaList p_poaList := omit) modifies m_create := {
765 779 from_ := p_from,//PX_AE_ID_STEM,//TODO We should use omit, "s", or "c"
766 780 requestIdentifier := testcasename() & "-m_createAe",
... ... @@ -889,6 +903,13 @@ module OneM2M_Templates {
889 903 };
890 904  
891 905 /**
  906 + * @desc CREATE request primitive for remoteCSE resource with poa
  907 + */
  908 + template (value) RequestPrimitive m_createRemoteCSE_poa(template (omit) AcpType p_accessControlPolicyIds := omit, template (omit) ResourceName p_resourceName := c_defaultRemoteCSEResourceName, in template (omit) XSD.AnyURI p_cSEBase := PX_CSE1_ID, in template (omit) XSD.ID p_cSE_ID := PX_CSE1_ID, in PoaList p_poaList) modifies m_createRemoteCSEBase := {
  909 + primitiveContent := {remoteCSE := m_contentCreateRemoteCSE_poa(p_resourceName, p_accessControlPolicyIds,p_cSEBase, p_cSE_ID, p_poaList)}
  910 + };
  911 +
  912 + /**
892 913 * @desc Reception template for CREATE RemoteCSE
893 914 */
894 915 template RequestPrimitive mw_createRemoteCSE(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
... ... @@ -978,7 +999,7 @@ module OneM2M_Templates {
978 999 * @desc Reception template for CREATE ContentInstanceAnnc
979 1000 */
980 1001 template RequestPrimitive mw_createContentInstanceAnnc(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := {
981   - resourceType := int10014,
  1002 + resourceType := int10004,
982 1003 primitiveContent := {contentInstanceAnnc := ?}
983 1004 };
984 1005  
... ... @@ -1482,36 +1503,13 @@ module OneM2M_Templates {
1482 1503 vendorInformation := omit
1483 1504 };
1484 1505  
1485   - /*
1486   - * @desc Base NOTIFY request primitive For PolingChannel
1487   - */
1488   - template RequestPrimitive m_notify_pch(XSD.ID p_resourceAddress) := {
1489   - operation := int5,
1490   - to_ := p_resourceAddress,
1491   - from_ := "NotInitialized",
1492   - requestIdentifier := testcasename() & "-m_notify" & f_rnd(1, 1000000),
1493   - resourceType := omit,
1494   - primitiveContent := {notification := m_contentNotification_pch},
1495   - roleIDs := omit,
1496   - originatingTimestamp := omit,
1497   - requestExpirationTimestamp := omit,
1498   - resultExpirationTimestamp := omit,
1499   - operationExecutionTime := omit,
1500   - responseType := omit,
1501   - resultPersistence := omit,
1502   - resultContent := omit,
1503   - eventCategory := omit,
1504   - deliveryAggregation := omit,
1505   - groupRequestIdentifier := omit,
1506   - filterCriteria := omit,
1507   - discoveryResultType := omit,
1508   - tokens := omit,
1509   - tokenIDs := omit,
1510   - localTokenIDs := omit,
1511   - tokenRequestIndicator := omit,
1512   - releaseVersionIndicator := "2a",
1513   - vendorInformation := omit
1514   - };
  1506 +
  1507 + /**
  1508 + * @desc Base NOTIFY request primitive
  1509 + */
  1510 + template RequestPrimitive m_notifyNotification(XSD.ID p_resourceAddress, Notification p_notification) modifies m_notify := {
  1511 + primitiveContent := {notification := p_notification}
  1512 + };
1515 1513  
1516 1514 /**
1517 1515 * @desc Base NOTIFY Aggregated request primitive
... ... @@ -1670,7 +1668,7 @@ module OneM2M_Templates {
1670 1668 * @param p_appId App ID
1671 1669 * @param p_nodeLink Node link
1672 1670 */
1673   - template AEAnnc_optional mw_contentCreateAEAnnc (in template Labels p_labels := ?, in template AcpType p_accessControlPolicyIds := ?, template XSD.AnyURI p_link := ?) := {
  1671 + template AEAnnc_optional mw_contentCreateAEAnnc (in template Labels p_labels := *, in template AcpType p_accessControlPolicyIds := ?, template XSD.AnyURI p_link := ?) := {
1674 1672 resourceName := omit,//NA M
1675 1673 resourceType := omit,//NA M
1676 1674 resourceID := omit,//NA M
... ... @@ -1690,8 +1688,8 @@ module OneM2M_Templates {
1690 1688 nodeLink := *,//OA
1691 1689 requestReachability := *,//OA
1692 1690 contentSerialization := *,//OA
1693   - e2eSecInfo := ?, //MA
1694   - supportedReleaseVersions := ?, //MA
  1691 + e2eSecInfo := *, //MA
  1692 + supportedReleaseVersions := *, //MA//TODO It should be mandatory for AEAnnc
1695 1693 choice := omit//NA
1696 1694 };
1697 1695  
... ... @@ -1702,7 +1700,7 @@ module OneM2M_Templates {
1702 1700 * @param p_appId App ID
1703 1701 * @param p_nodeLink Node link
1704 1702 */
1705   - template RemoteCSEAnnc_optional mw_contentCreateRemoteCSEAnnc (in template Labels p_labels := ?, in template AcpType p_accessControlPolicyIds := ?, template XSD.AnyURI p_link := ?) := {
  1703 + template RemoteCSEAnnc_optional mw_contentCreateRemoteCSEAnnc (in template Labels p_labels := *, in template AcpType p_accessControlPolicyIds := ?, template XSD.AnyURI p_link := ?) := {
1706 1704 resourceName := omit,//NA M
1707 1705 resourceType := omit,//NA M
1708 1706 resourceID := omit,//NA M
... ... @@ -1812,7 +1810,7 @@ module OneM2M_Templates {
1812 1810 * @desc Base reception template of primitiveContent for CREATE operation for AccessControlPolicyAnnc resource
1813 1811 * @param p_labels Labels
1814 1812 */
1815   - template AccessControlPolicyAnnc_optional mw_contentCreateAcpAnnc (in template Labels p_labels := ?) := {
  1813 + template AccessControlPolicyAnnc_optional mw_contentCreateAcpAnnc (in template Labels p_labels := *) := {
1816 1814 resourceName := omit,//NA M
1817 1815 resourceType := omit,//NA M
1818 1816 resourceID := omit,//NA M
... ... @@ -2001,7 +1999,7 @@ module OneM2M_Templates {
2001 1999 parentID := omit,//NA M
2002 2000 creationTime := omit,//NA M
2003 2001 lastModifiedTime := omit,//NA M
2004   - labels := ?,//MA
  2002 + labels := *,//MA
2005 2003 accessControlPolicyIDs := ?,//MA
2006 2004 expirationTime := ?,//MA M
2007 2005 link := ?,
... ... @@ -2078,7 +2076,7 @@ module OneM2M_Templates {
2078 2076 parentID := omit,//NA M
2079 2077 creationTime := omit,//NA M
2080 2078 lastModifiedTime := omit,//NA M
2081   - labels := ?,//MA
  2079 + labels := *,//MA
2082 2080 accessControlPolicyIDs := ?,//MA
2083 2081 expirationTime := ?,//MA M
2084 2082 link := ?,
... ... @@ -2178,7 +2176,7 @@ module OneM2M_Templates {
2178 2176 parentID := omit,//NA M
2179 2177 creationTime := omit,//NA M
2180 2178 lastModifiedTime := omit,//NA M
2181   - labels := ?,//MA
  2179 + labels := *,//MA
2182 2180 expirationTime := ?,//MA M
2183 2181 link := ?,
2184 2182 scheduleElement := * //OA
... ... @@ -2337,7 +2335,7 @@ module OneM2M_Templates {
2337 2335 parentID := omit,//NA M
2338 2336 creationTime := omit,//NA M
2339 2337 lastModifiedTime := omit,//NA M
2340   - labels := ?,//MA
  2338 + labels := *,//MA
2341 2339 expirationTime := omit,//O NA
2342 2340 link := omit, //O NA
2343 2341 stateTag := *,// OA
... ... @@ -2469,6 +2467,37 @@ module OneM2M_Templates {
2469 2467 };
2470 2468  
2471 2469 /**
  2470 + * @desc PrimitiveContent for CREATE operation for RemoteCSE resource with poa
  2471 + * @param p_name Resource name
  2472 + */
  2473 + template (value) RemoteCSE_optional m_contentCreateRemoteCSE_poa (in template (omit) XSD.String p_name := c_defaultRemoteCSEResourceName, in template (omit) AcpType p_accessControlPolicyIds, in template (omit) XSD.AnyURI p_cSEBase := PX_CSE1_ID, in template (omit) XSD.ID p_cSE_ID := PX_CSE1_ID, in PoaList p_poaList):= {
  2474 + resourceName := p_name,//O
  2475 + resourceType := omit,//NP
  2476 + resourceID := omit,//NP
  2477 + parentID := omit,//NP
  2478 + creationTime := omit,//NP
  2479 + lastModifiedTime := omit,//NP
  2480 + labels := omit,//O
  2481 + accessControlPolicyIDs := p_accessControlPolicyIds,//O
  2482 + expirationTime := omit,//O
  2483 + dynamicAuthorizationConsultationIDs := omit,
  2484 + announceTo := omit,//O
  2485 + announcedAttribute := omit,//O
  2486 + cseType := omit,//O
  2487 + pointOfAccess := p_poaList,//O
  2488 + cSEBase := valueof(p_cSEBase),//M
  2489 + cSE_ID := valueof(p_cSE_ID),//M
  2490 + m2M_Ext_ID := omit,//O
  2491 + trigger_Recipient_ID := omit,//O
  2492 + requestReachability := true,//M
  2493 + nodeLink := omit,//O
  2494 + triggerReferenceNumber := omit,//O
  2495 + e2eSecInfo := omit,//O
  2496 + supportedReleaseVersions := {"2a"}, //M
  2497 + choice := omit//O
  2498 + };
  2499 +
  2500 + /**
2472 2501 * @desc Base reception template of primitiveContent for CREATE operation for ContainerAnnc resource
2473 2502 */
2474 2503 template ContainerAnnc_optional mw_contentCreateContainerAnncBase := {
... ... @@ -2478,7 +2507,7 @@ module OneM2M_Templates {
2478 2507 parentID := omit,//NA M
2479 2508 creationTime := omit,//NA M
2480 2509 lastModifiedTime := omit,//NA M
2481   - labels := ?,//MA M
  2510 + labels := *,//MA M
2482 2511 accessControlPolicyIDs := ?,//MA
2483 2512 expirationTime := ?,//MA M
2484 2513 link := ?, //M
... ... @@ -2552,7 +2581,7 @@ module OneM2M_Templates {
2552 2581 parentID := omit,//NA M
2553 2582 creationTime := omit,//NA M
2554 2583 lastModifiedTime := omit,//NA M
2555   - labels := ?,//MA
  2584 + labels := *,//MA
2556 2585 accessControlPolicyIDs := ?,//MA
2557 2586 expirationTime := ?,//MA M
2558 2587 link := ?,
... ... @@ -2801,7 +2830,7 @@ module OneM2M_Templates {
2801 2830 parentID := omit,//NA M
2802 2831 creationTime := omit,//NA M
2803 2832 lastModifiedTime := omit,//NA M
2804   - labels := ?,//MA
  2833 + labels := *,//MA
2805 2834 accessControlPolicyIDs := ?,//MA
2806 2835 expirationTime := ?,//MA M
2807 2836 link := omit, //O NA
... ... @@ -2832,7 +2861,7 @@ module OneM2M_Templates {
2832 2861 parentID := omit,//NA M
2833 2862 creationTime := omit,//NA M
2834 2863 lastModifiedTime := omit,//NA M
2835   - labels := ?,//MA
  2864 + labels := *,//MA
2836 2865 expirationTime := omit,//NA M
2837 2866 link := omit, //O NA
2838 2867 dataGenerationTime := *,//M OA
... ... @@ -4390,18 +4419,9 @@ module OneM2M_Templates {
4390 4419 iPEDiscoveryRequest := omit
4391 4420 };
4392 4421  
4393   -
4394   - template Notification m_contentNotification_pch := {
4395   - notificationEvent:= omit,
  4422 + template Notification m_contentNotification_subscriptionVerification(XSD.ID p_creator) modifies m_contentNotification_allOmit:= {
4396 4423 verificationRequest := true,
4397   - subscriptionDeletion := omit,
4398   - subscriptionReference := omit,
4399   - creator :="AE_ID",
4400   - notificationForwardingURI := omit,
4401   - notificationTarget := omit,
4402   - targetRemovalRequest := omit,
4403   - targetRemovalAllowance := omit,
4404   - iPEDiscoveryRequest := omit
  4424 + creator := p_creator
4405 4425 };
4406 4426  
4407 4427 template Notification mw_contentNotification_any := {
... ...
... ... @@ -394,7 +394,8 @@ module OneM2M_PermutationFunctions {
394 394  
395 395 f_cf03Up();
396 396  
397   - //Send Trigger Mesf_generateLocalResource := f_ae_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), vc_cSEBaseIndex, int3);
  397 + //Send Trigger Message
  398 + v_localResource := f_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), vc_cSEBaseIndex, int3);
398 399 v_auxInteger := f_setLocalResource(v_localResource, int3, vc_cSEBaseIndex);
399 400 v_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(v_auxInteger, e_hierarchical, p_primitiveScope);
400 401 f_sendUtPrimitive(v_utRequest,v_action);
... ... @@ -501,7 +502,8 @@ module OneM2M_PermutationFunctions {
501 502 //Test component configuration
502 503 f_cf03Up();
503 504  
504   - //send triggeringf_generateLocalResourcelocalResource := f_ae_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), vc_cSEBaseIndex, int3);
  505 + //send triggering message
  506 + v_localResource := f_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), vc_cSEBaseIndex, int3);
505 507 v_containerIndex := f_setLocalResource(v_localResource, int3, vc_cSEBaseIndex);
506 508 p_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(v_containerIndex, -, -);
507 509 p_request.to_ := p_utRequest.requestPrimitive.to_;
... ... @@ -599,7 +601,8 @@ module OneM2M_PermutationFunctions {
599 601  
600 602 //Preamble
601 603  
602   - //Send Trf_generateLocalResourcelResource := f_ae_generateLocalResource(valueof(m_primitiveContentAe(m_contentCreateAe(omit, omit, omit, omit))), vc_cSEBaseIndex, int2);
  604 + //Send Triggering message
  605 + v_localResource := f_generateLocalResource(valueof(m_primitiveContentAe(m_contentCreateAe(omit, omit, omit, omit))), vc_cSEBaseIndex, int2);
603 606 v_resourceIndex := f_setLocalResource(v_localResource, int2, vc_cSEBaseIndex);
604 607 p_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(v_resourceIndex);
605 608 f_sendUtPrimitive(p_utRequest,p_action);
... ... @@ -640,7 +643,8 @@ module OneM2M_PermutationFunctions {
640 643 //Test component configuration
641 644 f_cf03Up();
642 645  
643   - //send triggering f_generateLocalResourceocalResource := f_ae_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), vc_cSEBaseIndex, int3);
  646 + //send triggering message
  647 + v_localResource := f_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), vc_cSEBaseIndex, int3);
644 648 v_resourceIndex := f_setLocalResource(v_localResource, int3, vc_cSEBaseIndex);
645 649 p_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(v_resourceIndex);
646 650 f_sendUtPrimitive(p_utRequest,p_action);
... ... @@ -690,7 +694,8 @@ module OneM2M_PermutationFunctions {
690 694 //Test component configuration
691 695 f_cf03Up();
692 696  
693   - //send triggerinf_generateLocalResource_localResource := f_ae_generateLocalResource(valueof(p_primitiveContent), vc_cSEBaseIndex, p_resourceType);
  697 + //send triggering message
  698 + v_localResource := f_generateLocalResource(valueof(p_primitiveContent), vc_cSEBaseIndex, p_resourceType);
694 699 v_resourceIndex := f_setLocalResource(v_localResource, p_resourceType, vc_cSEBaseIndex);
695 700 v_utRequest := m_utRetrieve(f_getLocalResourceAddress(v_resourceIndex));
696 701 f_sendUtPrimitive(v_utRequest,p_action);
... ... @@ -2950,7 +2955,7 @@ module OneM2M_PermutationFunctions {
2950 2955 // Preamble
2951 2956  
2952 2957 if (PX_MN_CSE) {
2953   - vc_cse1.start(f_cse_registrationRemoteCse(m_createRemoteCSEBase));
  2958 + vc_cse1.start(f_cse_registrationRemoteCse(mw_createRemoteCSEBase));
2954 2959 }else if (PX_IN_CSE) {
2955 2960 vc_cse1.start(f_cse_registerRemoteCse(m_createRemoteCSEBase));
2956 2961 }
... ... @@ -5200,7 +5205,7 @@ module OneM2M_PermutationFunctions {
5200 5205 var template RequestPrimitive v_create := m_createAe(PX_APP_ID, omit, omit);
5201 5206 v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
5202 5207 v_ae1.done;
5203   - v_create.primitiveContent.aE.announceTo := {PX_CSE_ID};
  5208 + v_create.primitiveContent.aE.announceTo := {PX_CSE1_ID};
5204 5209  
5205 5210 //Test control
5206 5211  
... ... @@ -5268,7 +5273,7 @@ module OneM2M_PermutationFunctions {
5268 5273 v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
5269 5274 v_ae1.done;
5270 5275  
5271   - v_create.primitiveContent.aE.announceTo := {PX_CSE_ID};
  5276 + v_create.primitiveContent.aE.announceTo := {PX_CSE1_ID};
5272 5277  
5273 5278 //Test control
5274 5279  
... ... @@ -7106,26 +7111,30 @@ module OneM2M_PermutationFunctions {
7106 7111 // Test adapter configuration
7107 7112  
7108 7113 //Register the CSE
7109   - vc_cse1.start(f_cse_registerRemoteCse(m_createRemoteCSEBase));
  7114 + vc_cse1.start(f_cse_registerRemoteCse(m_createRemoteCSE_poa(-, -, -, -, {f_getAnnouncementTargetPoA()})));
7110 7115 vc_cse1.done;
7111 7116  
  7117 + f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1);
  7118 +
7112 7119 //Preamble
7113 7120 vc_cse1.start(f_cse_announcementProcedure_createHandler(mw_createAEAnnc(-, -, -)));
7114 7121 v_aeIndex := f_cse_createResource(int2,v_create);
7115 7122 vc_cse1.done;
7116 7123  
  7124 + f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1);
  7125 +
7117 7126 // Test Body
7118 7127 if (ispresent (p_requestUpdatePrimitive)) {
7119 7128 v_resourceIndex := f_cse_createResource(p_resourceType,p_requestCreatePrimitive);
7120 7129 v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_requestUpdatePrimitive);
7121 7130 v_responsePrimitive.responseStatusCode := int2004;
7122 7131 } else {
7123   - v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestCreatePrimitive, v_parentIndex);
  7132 + v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestCreatePrimitive, v_aeIndex);
7124 7133 v_responsePrimitive.responseStatusCode := int2001;
7125 7134 }
7126 7135  
7127 7136 //Retrieve the parent resource index
7128   - v_AEAnncResourceIndex := f_getLatestResourceIndex(vc_cse1);
  7137 + v_AEAnncResourceIndex := f_getLatestLocalResourceIndex(vc_cse1);
7129 7138 vc_cse1.start(f_cse_announcementProcedure_createHandler(p_createRequestAnnc, -, v_AEAnncResourceIndex));
7130 7139 mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
7131 7140  
... ... @@ -7143,6 +7152,8 @@ module OneM2M_PermutationFunctions {
7143 7152 setverdict(fail, __SCOPE__, ": No answer while updating resource type " & int2str(enum2int(p_resourceType)));
7144 7153 }
7145 7154 }
  7155 +
  7156 + f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1);
7146 7157  
7147 7158 // Postamble
7148 7159 f_cse_postamble_deleteResources();
... ... @@ -7163,21 +7174,23 @@ module OneM2M_PermutationFunctions {
7163 7174 var integer v_resourceIndex;
7164 7175 var ResponsePrimitive v_responsePrimitive;
7165 7176 var template RequestPrimitive v_create := m_createAe(PX_APP_ID, omit, omit);
7166   - v_create.primitiveContent.aE.announceTo := {PX_CSE_ID};
  7177 + v_create.primitiveContent.aE.announceTo := {PX_CSE1_ID};
7167 7178 //Test control
7168 7179  
7169 7180 //Test component configuration
7170 7181 f_cf02Up();
7171 7182  
7172 7183 //Register the CSE
7173   - vc_cse1.start(f_cse_registerRemoteCse(m_createRemoteCSEBase));
7174   - vc_cse1.done;
  7184 + vc_cse1.start(f_cse_registerRemoteCse(m_createRemoteCSE_poa(-, -, -, -, {f_getAnnouncementTargetPoA()})));
  7185 +
  7186 + f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1);
7175 7187  
7176 7188 //Preamble
7177 7189 vc_cse1.start(f_cse_announcementProcedure_createHandler(mw_createAEAnnc(-, -, -)));
7178 7190 v_aeIndex := f_cse_createResource(int2,v_create);
7179   - vc_cse1.done;
7180   -
  7191 +
  7192 + f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1);
  7193 +
7181 7194 vc_cse1.start(f_cse_announcementProcedure_createHandler(p_createRequestAnnc));
7182 7195 f_cse_createResource(p_resourceType, p_requestCreatePrimitive, v_aeIndex);
7183 7196 vc_cse1.done;
... ... @@ -7189,39 +7202,89 @@ module OneM2M_PermutationFunctions {
7189 7202 f_cf02Down();
7190 7203 } //end f_CSE_ANNC_CRE_001
7191 7204  
7192   - function f_CSE_ANNC_CRE_002(ResourceType p_resourceType, template RequestPrimitive p_createRequestAnnc, in template RequestPrimitive p_requestUpdatePrimitive := omit) runs on CseSimu {
  7205 + function f_CSE_ANNC_CRE_002(ResourceType p_resourceType, template RequestPrimitive p_createRequest, in template RequestPrimitive p_updateRequest := omit, in template RequestPrimitive p_createRequestAnnc) runs on CseSimu {
7193 7206 // Local variables
7194   - var AeSimu v_ae1 := AeSimu.create("AE1") alive;
7195 7207 var MsgIn v_response;
7196   - var RequestPrimitive v_request;
7197   - var integer v_parentIndex := -1;
  7208 + var MsgIn v_request;
  7209 + var PrimitiveContent v_announcedResource;
7198 7210 var integer v_aeIndex := -1;
7199 7211 var integer v_resourceIndex;
  7212 + var integer v_localResourceIndex := -1;
7200 7213 var integer v_remoteCSEAnncIndex := -1;
7201 7214 var ResponsePrimitive v_responsePrimitive;
7202   - var template RequestPrimitive v_create := m_createAe(PX_APP_ID, omit, omit);
7203   - v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
7204   - v_ae1.done;
7205   -
7206   - //TODO var template RequestPrimitive v_remoteCSEAnnc := mw_createAccessControlPolicyAnnc;
7207   -
  7215 +
7208 7216 // Test control
7209 7217  
7210 7218 // Test component configuration
7211 7219 f_cf02UpCseSimuMaster();
7212 7220  
7213 7221 // Test adapter configuration
7214   -
  7222 +
  7223 + //Register the CSE
  7224 + f_cse_registrationRemoteCse(mw_createRemoteCSEBase);
  7225 +
7215 7226 //Preamble
7216   - v_ae1.start(f_cse_createResource(int2,v_create));
7217   - v_ae1.done;
  7227 + vc_ae1.start(f_cse_preamble_registerAe());
  7228 + f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1);
  7229 +
  7230 + v_aeIndex := f_getLatestResourceIndex(vc_ae1);
  7231 +
  7232 + vc_ae1.start(f_cse_createResource(p_resourceType, p_createRequest, v_aeIndex));
  7233 + f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1);
  7234 +
  7235 + v_resourceIndex := f_getLatestResourceIndex(vc_ae1);
7218 7236  
7219 7237 // Test Body
7220   - v_ae1.start(f_cse_sendUpdateRequestPrimitive(p_resourceType, p_requestUpdatePrimitive));
7221   - v_ae1.done;
  7238 + vc_ae1.start(f_cse_sendUpdateRequestPrimitive(p_resourceType, p_updateRequest, v_resourceIndex));
  7239 + vc_ae1.done;
  7240 +
  7241 + tc_ac.start;
  7242 + alt {
  7243 + [] mccPortIn.receive(mw_request(mw_updateRemoteCSE(PX_CSE_ID))) -> value v_request {
  7244 + tc_ac.stop;
  7245 + setverdict(pass, __SCOPE__ & ":INFO: RemoteCSE UPDATE received");
  7246 +
  7247 + v_localResourceIndex := f_getResourceIndex(v_request.primitive.requestPrimitive.to_);
  7248 + if(v_localResourceIndex == -1)
  7249 + {
  7250 + log(__SCOPE__&": ERROR: Resource Index not valid, target not found");
  7251 + v_responsePrimitive := valueof(m_responsePrimitive(int4004,v_request.primitive.requestPrimitive.requestIdentifier));
  7252 + } else {
  7253 + v_responsePrimitive := valueof(m_responsePrimitive(int2004,v_request.primitive.requestPrimitive.requestIdentifier));
  7254 + f_updateLocalResource(v_localResourceIndex, v_request.primitive.requestPrimitive.primitiveContent);
  7255 + v_responsePrimitive.primitiveContent := vc_localResourcesList[v_localResourceIndex].resource;
  7256 + }
  7257 + v_responsePrimitive.from_ := PX_CSE1_ID;
  7258 + v_responsePrimitive.to_ := v_request.primitive.requestPrimitive.from_;
  7259 + mccPortIn.send(f_getMsgOutPrimitive(m_response(valueof(v_responsePrimitive))));
  7260 + }
  7261 + [] tc_ac.timeout {
  7262 + setverdict(fail, __SCOPE__ & ":ERROR: No announcement received");
  7263 + }
  7264 + }
  7265 +
  7266 + f_checkCseSimuStatus();
  7267 +
  7268 + tc_ac.start;
  7269 + alt {
  7270 + [] mccPortIn.receive(mw_request(p_createRequestAnnc)) -> value v_request {
  7271 + tc_ac.stop;
  7272 + setverdict(pass, __SCOPE__ & ":INFO: Resource Announced CREATE received");
  7273 +
  7274 + //Simulate that resourceAnnc is created on CSE2
  7275 + v_announcedResource:= f_generateLocalResource(v_request.primitive.requestPrimitive.primitiveContent, -1,v_request.primitive.requestPrimitive.resourceType);
  7276 + //Set parentID correctly to remoteCSEAnnc-ID
  7277 + v_announcedResource := f_setParentID(v_announcedResource, f_resourceIdCleaner(vc_localResourcesList[v_localResourceIndex].resource.remoteCSE.announceTo[0]));
  7278 +
  7279 + v_responsePrimitive := valueof(m_responsePrimitive(int2001,v_request.primitive.requestPrimitive.requestIdentifier));
  7280 + v_responsePrimitive.primitiveContent := v_announcedResource;
  7281 + mccPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
  7282 + }
  7283 + [] tc_ac.timeout {
  7284 + setverdict(fail, __SCOPE__ & ":ERROR: No announcement received");
  7285 + }
  7286 + }
7222 7287  
7223   - f_cse_announcementProcedure_createHandler(p_createRequestAnnc);
7224   -
7225 7288 // Postamble
7226 7289 f_cse_postamble_deleteResourcesCSE();
7227 7290  
... ... @@ -7238,9 +7301,9 @@ module OneM2M_PermutationFunctions {
7238 7301 var integer v_parentIndex := -1;
7239 7302 var integer v_aeIndex := -1;
7240 7303 var integer v_resourceIndex;
7241   - var integer v_CntAnncResourceIndex;
7242   - var template RequestPrimitive v_create := m_createAe(PX_APP_ID, omit, omit);
7243   - v_create.primitiveContent.container.announceTo := {PX_CSE1_ID};
  7304 + var integer v_containerAnncResourceIndex;
  7305 + var template RequestPrimitive v_createContainer := m_createContainerBase;
  7306 + v_createContainer.primitiveContent.container.announceTo := {PX_CSE1_ID};
7244 7307  
7245 7308  
7246 7309 // Test control
... ... @@ -7251,19 +7314,21 @@ module OneM2M_PermutationFunctions {
7251 7314 // Test adapter configuration
7252 7315  
7253 7316 //Register the CSE
7254   - vc_cse1.start(f_cse_registerRemoteCse(m_createRemoteCSEBase));
7255   - vc_cse1.done;
  7317 + vc_cse1.start(f_cse_registerRemoteCse(m_createRemoteCSE_poa(-, -, -, -, {f_getAnnouncementTargetPoA()})));
  7318 +
  7319 + f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1);
7256 7320  
7257 7321 //Preamble
  7322 + v_aeIndex := f_cse_preamble_registerAe();
7258 7323 vc_cse1.start(f_cse_announcementProcedure_createHandler(mw_createContainerAnncBase(-, -)));
7259   - v_aeIndex := f_cse_createResource(int2,v_create);
7260   - vc_cse1.done;
  7324 + v_resourceIndex := f_cse_createResource(int3,v_createContainer, v_aeIndex);
  7325 + f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1);
7261 7326  
7262 7327 // Test Body
7263   - //Retrieve the parent resource index
7264   - v_CntAnncResourceIndex := f_getLatestResourceIndex(vc_cse1);
7265   - v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestCreatePrimitive, v_parentIndex);
7266   - vc_cse1.start(f_cse_announcementProcedure_createHandler(p_createRequestAnnc,int4000, v_CntAnncResourceIndex));
  7328 + //Retrieve the parent resource index where contentInstanceAnnc must be created
  7329 + v_containerAnncResourceIndex := f_getLatestLocalResourceIndex(vc_cse1);
  7330 + v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestCreatePrimitive, v_resourceIndex);
  7331 + vc_cse1.start(f_cse_announcementProcedure_createHandler(p_createRequestAnnc,int4000, v_containerAnncResourceIndex));
7267 7332 mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
7268 7333  
7269 7334 tc_ac.start;
... ... @@ -7272,7 +7337,9 @@ module OneM2M_PermutationFunctions {
7272 7337 tc_ac.stop;
7273 7338 setverdict(pass, __SCOPE__, ": Resource " & int2str(enum2int(p_resourceType)) & " created successfully");
7274 7339 if(ispresent(v_response.primitive.responsePrimitive.primitiveContent.contentInstance.announceTo)) {
7275   - setverdict(fail, __SCOPE__, ": Resource " & int2str(enum2int(p_resourceType)) & " contains the attribute announceTo");
  7340 + if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.contentInstance.announceTo) != 0) {
  7341 + setverdict(fail, __SCOPE__, ": Resource " & int2str(enum2int(p_resourceType)) & " contains the attribute announceTo");
  7342 + }
7276 7343 }
7277 7344 }
7278 7345 [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response {
... ... @@ -7296,55 +7363,37 @@ module OneM2M_PermutationFunctions {
7296 7363  
7297 7364 function f_CSE_ANNC_CRE_004_CseSimu(ResourceType p_resourceType, template RequestPrimitive p_createRequestAnnc, in template RequestPrimitive p_requestCreatePrimitive := omit) runs on CseSimu {
7298 7365 // Local variables
7299   - var AeSimu v_ae1 := AeSimu.create("AE1") alive;
7300 7366 var MsgIn v_request;
7301   - var integer v_parentIndex := -1;
7302 7367 var integer v_aeIndex := -1;
7303 7368 var integer v_resourceIndex;
7304 7369 var integer v_aEAnncIndex := -1;
7305 7370 var ResponsePrimitive v_responsePrimitive;
7306 7371 var template RequestPrimitive v_create := m_createAe(PX_APP_ID, omit, omit);
7307   - v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
7308   - v_ae1.done;
7309   - v_create.primitiveContent.aE.announceTo := {PX_CSE_ID};
  7372 +
  7373 + v_create.primitiveContent.aE.announceTo := {PX_CSE1_ID};
7310 7374  
7311 7375 // Test control
7312 7376  
7313 7377 // Test component configuration
7314 7378 f_cf02UpCseSimuMaster();
7315   -
  7379 +
7316 7380 // Test adapter configuration
7317 7381 // Register the CSE
7318   - f_cse_registerRemoteCse(m_createRemoteCSEBase);
  7382 + f_cse_registerRemoteCse(m_createRemoteCSE_poa(-, -, -, -, {f_getAnnouncementTargetPoA()}));
7319 7383  
7320 7384 //Preamble
7321   - v_ae1.start(f_cse_createResource(int2,v_create));
7322   - f_cse_announcementProcedure_createHandler(mw_createAEAnnc(-, -, -));
7323   - v_ae1.done;
  7385 + vc_ae1.start(f_cse_createResource(int2,v_create));
  7386 + v_aEAnncIndex := f_cse_announcementProcedure_createHandler(mw_createAEAnnc(-, -, -));
  7387 + f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1);
  7388 +
  7389 + v_aeIndex := f_getLatestResourceIndex(vc_ae1);
7324 7390  
7325 7391 // Test Body
7326   - v_ae1.start(f_cse_sendCreateRequestPrimitive(p_resourceType,p_requestCreatePrimitive, v_parentIndex));
  7392 + vc_ae1.start(f_cse_createResource(p_resourceType,p_requestCreatePrimitive, v_aeIndex));
7327 7393  
7328   - tc_ac.start;
7329   - alt {
7330   - [] mccPortIn.receive(mw_request(p_createRequestAnnc)) -> value v_request {
7331   - tc_ac.stop;
7332   - setverdict(pass, __SCOPE__ & ":INFO: CREATE REQUEST received");
7333   -
7334   - if(match(v_request.primitive.requestPrimitive.to_, f_getLocalResourceAddress(v_aEAnncIndex, e_hierarchical, e_spRelative)) or
7335   - match(v_request.primitive.requestPrimitive.to_, f_getLocalResourceAddress(v_aEAnncIndex, e_nonHierarchical, e_spRelative))) {
7336   - setverdict(pass, __SCOPE__ & ":matching ANNC_PARENT_RESOURCE_ADDRESS");
7337   - } else {
7338   - setverdict(fail, __SCOPE__ & ":mis-matching ANNC_PARENT_RESOURCE_ADDRESS");
7339   - }
7340   -
7341   - }
7342   - [] tc_ac.timeout {
7343   - setverdict(fail, __SCOPE__ & ":ERROR: No CREATE REQUEST received");
7344   - }
7345   - }
  7394 + f_cse_announcementProcedure_createHandler(p_createRequestAnnc, -, v_aEAnncIndex);
7346 7395  
7347   - v_ae1.done;
  7396 + vc_ae1.done;
7348 7397  
7349 7398 // Postamble
7350 7399 f_cse_postamble_deleteResourcesCSE();
... ... @@ -7356,18 +7405,16 @@ module OneM2M_PermutationFunctions {
7356 7405  
7357 7406 function f_CSE_ANNC_CRE_005_CseSimu(ResourceType p_resourceType, template RequestPrimitive p_createRequestAnnc, in template RequestPrimitive p_requestCreatePrimitive := omit) runs on CseSimu {
7358 7407 // Local variables
7359   - var AeSimu v_ae1 := AeSimu.create("AE1") alive;
7360 7408 var MsgIn v_request;
7361 7409 var integer v_parentIndex := -1;
7362 7410 var integer v_aeIndex := -1;
7363   - var integer v_resourceIndex;
  7411 + var integer v_resourceAnncIndex := -1;
7364 7412 var integer v_aEAnncIndex := -1;
7365 7413 var ResponsePrimitive v_responsePrimitive;
  7414 + var PrimitiveContent v_announcedResource;
7366 7415 var template RequestPrimitive v_create := m_createAe(PX_APP_ID, omit, omit);
7367   - v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
7368   - v_ae1.done;
7369   - v_create.primitiveContent.container.announceTo := {PX_CSE1_ID};
7370   -
  7416 + var template RequestPrimitive v_createContainer := m_createContainerBase;
  7417 +
7371 7418 // Test control
7372 7419  
7373 7420 // Test component configuration
... ... @@ -7375,36 +7422,71 @@ module OneM2M_PermutationFunctions {
7375 7422  
7376 7423 // Test adapter configuration
7377 7424 // Register the CSE
7378   - f_cse_registerRemoteCse(m_createRemoteCSEBase);
7379   -
  7425 + vc_remoteCseIndex := f_cse_registrationRemoteCse(mw_createRemoteCSEBase);
  7426 +
  7427 + f_checkCseSimuStatus();
  7428 +
7380 7429 //Preamble
7381   - v_ae1.start(f_cse_createResource(int2,v_create));
7382   - f_cse_announcementProcedure_createHandler(mw_createRemoteCSEAnnc(-, -, -));
7383   - v_ae1.done;
7384   -
  7430 + vc_ae1.start(f_cse_createResource(int2,v_create));
  7431 + f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1);
  7432 +
  7433 + v_aeIndex := f_getLatestResourceIndex(vc_ae1);
  7434 +
  7435 + v_createContainer.primitiveContent.container.announceTo := {"/CSE2_ID"};
  7436 + v_createContainer.primitiveContent.container.resourceName := "TriggerAnnounceIUT";
  7437 + vc_ae1.start(f_cse_createResource(int3,v_createContainer, v_aeIndex));
  7438 +
  7439 + //IUT shall announce itself by updating announceTo attribute of its remoteCSE on its registrar (CSE1)
  7440 + f_cse_updateResourceHandler(vc_localRemoteCseIndex, mw_updateRemoteCSE);
  7441 +
  7442 + tc_ac.start;
  7443 + alt {
  7444 + [] mccPortIn.receive(mw_request(mw_createContainerAnncBase(PX_CSE_ID, vc_localResourcesList[vc_localRemoteCseIndex].resource.remoteCSE.announceTo[0] ))) -> value v_request {
  7445 + tc_ac.stop;
  7446 + setverdict(pass, __SCOPE__ & ":INFO: Resource Announced CREATE received");
  7447 +
  7448 + //Simulate that resourceAnnc is created on CSE2
  7449 + v_announcedResource:= f_generateLocalResource(v_request.primitive.requestPrimitive.primitiveContent, -1,v_request.primitive.requestPrimitive.resourceType);
  7450 + //Set parentID correctly to remoteCSEAnnc-ID
  7451 + v_announcedResource := f_setParentID(v_announcedResource, f_resourceIdCleaner(vc_localResourcesList[vc_localRemoteCseIndex].resource.remoteCSE.announceTo[0]));
  7452 +
  7453 + v_responsePrimitive := valueof(m_responsePrimitive(int2001,v_request.primitive.requestPrimitive.requestIdentifier));
  7454 + v_responsePrimitive.primitiveContent := v_announcedResource;
  7455 + mccPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
  7456 + }
  7457 + [] tc_ac.timeout {
  7458 + setverdict(fail, __SCOPE__ & ":ERROR: No announcement received");
  7459 + }
  7460 + }
  7461 +
  7462 + f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1);
  7463 +
7385 7464 // Test Body
7386   - v_ae1.start(f_cse_sendCreateRequestPrimitive(p_resourceType,p_requestCreatePrimitive, v_parentIndex));
7387   -
  7465 + vc_ae1.start(f_cse_createResource(p_resourceType,p_requestCreatePrimitive, v_aeIndex));
  7466 +
  7467 + //IUT shall then create the announced resource on its remoteCSEAnnc as indicated in the announceTo attribute returned by its registrar (CSE1)
  7468 + p_createRequestAnnc.to_ := vc_localResourcesList[vc_localRemoteCseIndex].resource.remoteCSE.announceTo[0];
7388 7469 tc_ac.start;
7389 7470 alt {
7390 7471 [] mccPortIn.receive(mw_request(p_createRequestAnnc)) -> value v_request {
7391 7472 tc_ac.stop;
7392   - setverdict(pass, __SCOPE__ & ":INFO: CREATE REQUEST received");
7393   -
7394   - if(match(v_request.primitive.requestPrimitive.to_, f_getLocalResourceAddress(v_aEAnncIndex, e_hierarchical, e_spRelative)) or
7395   - match(v_request.primitive.requestPrimitive.to_, f_getLocalResourceAddress(v_aEAnncIndex, e_nonHierarchical, e_spRelative))) {
7396   - setverdict(pass, __SCOPE__ & ":matching ANNC_PARENT_RESOURCE_ADDRESS");
7397   - } else {
7398   - setverdict(fail, __SCOPE__ & ":mis-matching ANNC_PARENT_RESOURCE_ADDRESS");
7399   - }
7400   -
  7473 + setverdict(pass, __SCOPE__ & ":INFO: Resource Announced CREATE received");
  7474 +
  7475 + //Simulate that resourceAnnc is created on CSE2
  7476 + v_announcedResource:= f_generateLocalResource(v_request.primitive.requestPrimitive.primitiveContent, -1,v_request.primitive.requestPrimitive.resourceType);
  7477 + //Set parentID correctly to remoteCSEAnnc-ID
  7478 + v_announcedResource := f_setParentID(v_announcedResource, f_resourceIdCleaner(vc_localResourcesList[vc_localRemoteCseIndex].resource.remoteCSE.announceTo[0]));
  7479 +
  7480 + v_responsePrimitive := valueof(m_responsePrimitive(int2001,v_request.primitive.requestPrimitive.requestIdentifier));
  7481 + v_responsePrimitive.primitiveContent := v_announcedResource;
  7482 + mccPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
7401 7483 }
7402 7484 [] tc_ac.timeout {
7403   - setverdict(fail, __SCOPE__ & ":ERROR: No CREATE REQUEST received");
  7485 + setverdict(fail, __SCOPE__ & ":ERROR: No announcement received");
7404 7486 }
7405 7487 }
7406 7488  
7407   - v_ae1.done;
  7489 + vc_ae1.done;
7408 7490  
7409 7491 // Postamble
7410 7492 f_cse_postamble_deleteResourcesCSE();
... ... @@ -7416,7 +7498,6 @@ module OneM2M_PermutationFunctions {
7416 7498  
7417 7499 function f_CSE_ANNC_CRE_006_CseSimu(ResourceType p_resourceType, template RequestPrimitive p_createRequestAnnc, in template RequestPrimitive p_requestCreatePrimitive := omit) runs on CseSimu {
7418 7500 // Local variables
7419   - var AeSimu v_ae1 := AeSimu.create("AE1") alive;
7420 7501 var MsgIn v_request;
7421 7502 var integer v_parentIndex := -1;
7422 7503 var integer v_aeIndex := -1;
... ... @@ -7424,10 +7505,7 @@ module OneM2M_PermutationFunctions {
7424 7505 var integer v_aEAnncIndex := -1;
7425 7506 var ResponsePrimitive v_responsePrimitive;
7426 7507 var template RequestPrimitive v_create := m_createAe(PX_APP_ID, omit, omit);
7427   - v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
7428   - v_ae1.done;
7429   - v_create.primitiveContent.container.announceTo := {PX_CSE1_ID};
7430   -
  7508 +
7431 7509 // Test control
7432 7510  
7433 7511 // Test component configuration
... ... @@ -7435,35 +7513,20 @@ module OneM2M_PermutationFunctions {
7435 7513  
7436 7514 // Test adapter configuration
7437 7515 // Register the CSE
7438   - f_cse_registerRemoteCse(m_createRemoteCSEBase);
7439   -
  7516 + vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSE_poa(-, -, -, -, {f_getAnnouncementTargetPoA()}));
  7517 +
7440 7518 //Preamble
7441   - v_ae1.start(f_cse_createResource(int2,v_create));
7442   - v_ae1.done;
  7519 + vc_ae1.start(f_cse_createResource(int2,v_create));
  7520 + f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1);
  7521 +
  7522 + v_aeIndex := f_getLatestResourceIndex(vc_ae1);
7443 7523  
7444 7524 // Test Body
7445   - v_ae1.start(f_cse_sendCreateRequestPrimitive(p_resourceType,p_requestCreatePrimitive, v_parentIndex));
7446   -
7447   - tc_ac.start;
7448   - alt {
7449   - [] mccPortIn.receive(mw_request(p_createRequestAnnc)) -> value v_request {
7450   - tc_ac.stop;
7451   - setverdict(pass, __SCOPE__ & ":INFO: CREATE REQUEST received");
  7525 + vc_ae1.start(f_cse_createResource(p_resourceType,p_requestCreatePrimitive, v_aeIndex));
7452 7526  
7453   - if(match(v_request.primitive.requestPrimitive.to_, f_getLocalResourceAddress(v_aEAnncIndex, e_hierarchical, e_spRelative)) or
7454   - match(v_request.primitive.requestPrimitive.to_, f_getLocalResourceAddress(v_aEAnncIndex, e_nonHierarchical, e_spRelative))) {
7455   - setverdict(pass, __SCOPE__ & ":matching ANNC_PARENT_RESOURCE_ADDRESS");
7456   - } else {
7457   - setverdict(fail, __SCOPE__ & ":mis-matching ANNC_PARENT_RESOURCE_ADDRESS");
7458   - }
7459   -
7460   - }
7461   - [] tc_ac.timeout {
7462   - setverdict(fail, __SCOPE__ & ":ERROR: No CREATE REQUEST received");
7463   - }
7464   - }
7465   -
7466   - v_ae1.done;
  7527 + f_cse_announcementProcedure_createHandler(p_createRequestAnnc, -, vc_localRemoteCseIndex);
  7528 +
  7529 + vc_ae1.done;
7467 7530  
7468 7531 // Postamble
7469 7532 f_cse_postamble_deleteResourcesCSE();
... ... @@ -7475,64 +7538,91 @@ module OneM2M_PermutationFunctions {
7475 7538  
7476 7539 function f_CSE_ANNC_CRE_007_CseSimu(ResourceType p_resourceType, template RequestPrimitive p_createRequestAnnc, in template RequestPrimitive p_requestCreatePrimitive := omit) runs on CseSimu {
7477 7540 // Local variables
7478   - var AeSimu v_ae1 := AeSimu.create("AE1") alive;
7479 7541 var MsgIn v_request;
7480 7542 var integer v_parentIndex := -1;
7481 7543 var integer v_aeIndex := -1;
7482 7544 var integer v_resourceIndex;
7483 7545 var integer v_aEAnncIndex := -1;
7484 7546 var ResponsePrimitive v_responsePrimitive;
  7547 + var PrimitiveContent v_announcedResource;
7485 7548 var template RequestPrimitive v_create := m_createAe(PX_APP_ID, omit, omit);
7486   - v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
7487   - v_ae1.done;
7488   - v_create.primitiveContent.container.announceTo := {PX_CSE1_ID};
7489   -
  7549 + var template RequestPrimitive v_createContainer := m_createContainerBase;
  7550 +
7490 7551 // Test control
7491   -
7492 7552 // Test component configuration
7493   - f_cf02UpCseSimuMaster();
7494   -
7495   - v_ae1.start(f_cse_createResource(int2,v_create));
7496   - v_ae1.done;
  7553 + f_cf02UpCseSimuMaster();
7497 7554  
7498   - // Test Body
7499   - v_ae1.start(f_cse_sendCreateRequestPrimitive(p_resourceType,p_requestCreatePrimitive, v_parentIndex));
  7555 + // Test adapter configuration
  7556 + // Register the CSE
  7557 + vc_remoteCseIndex := f_cse_registrationRemoteCse(mw_createRemoteCSEBase);
  7558 +
  7559 + f_checkCseSimuStatus();
  7560 +
  7561 + //Preamble
  7562 + vc_ae1.start(f_cse_createResource(int2,v_create));
  7563 + f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1);
  7564 +
  7565 + v_aeIndex := f_getLatestResourceIndex(vc_ae1);
  7566 +
  7567 + v_createContainer.primitiveContent.container.announceTo := {"/CSE2_ID"};
  7568 + v_createContainer.primitiveContent.container.resourceName := "TriggerAnnounceIUT";
  7569 + vc_ae1.start(f_cse_createResource(int3,v_createContainer, v_aeIndex));
  7570 +
  7571 + //IUT shall announce itself by updating announceTo attribute of its remoteCSE on its registrar (CSE1)
  7572 + f_cse_updateResourceHandler(vc_localRemoteCseIndex, mw_updateRemoteCSE);
7500 7573  
7501 7574 tc_ac.start;
7502 7575 alt {
7503   - [] mccPortIn.receive(mw_request(mw_createRemoteCSEAnnc(-, -, -))) -> value v_request {
  7576 + [] mccPortIn.receive(mw_request(mw_createContainerAnncBase(PX_CSE_ID, vc_localResourcesList[vc_localRemoteCseIndex].resource.remoteCSE.announceTo[0] ))) -> value v_request {
7504 7577 tc_ac.stop;
7505   - setverdict(pass, __SCOPE__ & ":INFO: CREATE REQUEST for remoteCSEAnnc received");
  7578 + setverdict(pass, __SCOPE__ & ":INFO: Resource Announced CREATE received");
  7579 +
  7580 + //Simulate that resourceAnnc is created on CSE2
  7581 + v_announcedResource:= f_generateLocalResource(v_request.primitive.requestPrimitive.primitiveContent, -1,v_request.primitive.requestPrimitive.resourceType);
  7582 + //Set parentID correctly to remoteCSEAnnc-ID
  7583 + v_announcedResource := f_setParentID(v_announcedResource, f_resourceIdCleaner(vc_localResourcesList[vc_localRemoteCseIndex].resource.remoteCSE.announceTo[0]));
  7584 +
  7585 + v_responsePrimitive := valueof(m_responsePrimitive(int2001,v_request.primitive.requestPrimitive.requestIdentifier));
  7586 + v_responsePrimitive.primitiveContent := v_announcedResource;
  7587 + mccPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
7506 7588 }
7507 7589 [] tc_ac.timeout {
7508   - setverdict(fail, __SCOPE__ & ":ERROR: No CREATE REQUEST received");
  7590 + setverdict(fail, __SCOPE__ & ":ERROR: No announcement received");
7509 7591 }
7510 7592 }
7511   -
  7593 +
  7594 + f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1);
  7595 +
  7596 + // Test Body
  7597 + vc_ae1.start(f_cse_createResource(p_resourceType,p_requestCreatePrimitive, v_aeIndex));
  7598 +
  7599 + //IUT shall then create the announced resource on its remoteCSEAnnc as indicated in the announceTo attribute returned by its registrar (CSE1)
  7600 + p_createRequestAnnc.to_ := vc_localResourcesList[vc_localRemoteCseIndex].resource.remoteCSE.announceTo[0];
7512 7601 tc_ac.start;
7513 7602 alt {
7514 7603 [] mccPortIn.receive(mw_request(p_createRequestAnnc)) -> value v_request {
7515 7604 tc_ac.stop;
7516   - setverdict(pass, __SCOPE__ & ":INFO: CREATE REQUEST received");
7517   -
7518   - if(match(v_request.primitive.requestPrimitive.to_, f_getLocalResourceAddress(v_aEAnncIndex, e_hierarchical, e_spRelative)) or
7519   - match(v_request.primitive.requestPrimitive.to_, f_getLocalResourceAddress(v_aEAnncIndex, e_nonHierarchical, e_spRelative))) {
7520   - setverdict(pass, __SCOPE__ & ":matching ANNC_PARENT_RESOURCE_ADDRESS");
7521   - } else {
7522   - setverdict(fail, __SCOPE__ & ":mis-matching ANNC_PARENT_RESOURCE_ADDRESS");
7523   - }
7524   -
  7605 + setverdict(pass, __SCOPE__ & ":INFO: Resource Announced CREATE received");
  7606 +
  7607 + //Simulate that resourceAnnc is created on CSE2
  7608 + v_announcedResource:= f_generateLocalResource(v_request.primitive.requestPrimitive.primitiveContent, -1,v_request.primitive.requestPrimitive.resourceType);
  7609 + //Set parentID correctly to remoteCSEAnnc-ID
  7610 + v_announcedResource := f_setParentID(v_announcedResource, f_resourceIdCleaner(vc_localResourcesList[vc_localRemoteCseIndex].resource.remoteCSE.announceTo[0]));
  7611 +
  7612 + v_responsePrimitive := valueof(m_responsePrimitive(int2001,v_request.primitive.requestPrimitive.requestIdentifier));
  7613 + v_responsePrimitive.primitiveContent := v_announcedResource;
  7614 + mccPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
7525 7615 }
7526 7616 [] tc_ac.timeout {
7527   - setverdict(fail, __SCOPE__ & ":ERROR: No CREATE REQUEST received");
  7617 + setverdict(fail, __SCOPE__ & ":ERROR: No announcement received");
7528 7618 }
7529 7619 }
7530 7620  
7531   - v_ae1.done;
  7621 + vc_ae1.done;
7532 7622  
7533 7623 // Postamble
7534 7624 f_cse_postamble_deleteResourcesCSE();
7535   -
  7625 +
7536 7626 // Tear down
7537 7627 f_cf02DownCseSimuMaster();
7538 7628  
... ... @@ -7540,17 +7630,12 @@ module OneM2M_PermutationFunctions {
7540 7630  
7541 7631 function f_CSE_ANNC_CRE_008_CseSimu(ResourceType p_resourceType, template RequestPrimitive p_createRequestAnnc, in template RequestPrimitive p_requestCreatePrimitive := omit) runs on CseSimu {
7542 7632 // Local variables
7543   - var AeSimu v_ae1 := AeSimu.create("AE1") alive;
7544 7633 var MsgIn v_request;
7545   - var integer v_parentIndex := -1;
7546 7634 var integer v_aeIndex := -1;
7547   - var integer v_resourceIndex;
7548 7635 var integer v_aEAnncIndex := -1;
7549 7636 var ResponsePrimitive v_responsePrimitive;
7550 7637 var template RequestPrimitive v_create := m_createAe(PX_APP_ID, omit, omit);
7551   - v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
7552   - v_ae1.done;
7553   - v_create.primitiveContent.container.announceTo := {PX_CSE1_ID};
  7638 + v_create.primitiveContent.aE.announceTo := {PX_CSE1_ID};
7554 7639  
7555 7640 // Test control
7556 7641  
... ... @@ -7559,35 +7644,21 @@ module OneM2M_PermutationFunctions {
7559 7644  
7560 7645 //Test adapter configuration
7561 7646 // Register the CSE
7562   - f_cse_registerRemoteCse(mw_createRemoteCSE);
7563   -
7564   - v_ae1.start(f_cse_createResource(int2,v_create));
7565   - f_cse_announcementProcedure_createHandler(mw_createAEAnnc(-, -, -));
7566   - v_ae1.done;
  7647 + vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSE_poa(-, -, -, -, {f_getAnnouncementTargetPoA()}));
  7648 +
  7649 + f_checkCseSimuStatus();
  7650 +
  7651 + vc_ae1.start(f_cse_createResource(int2,v_create));
  7652 + v_aEAnncIndex := f_cse_announcementProcedure_createHandler(mw_createAEAnnc(-, -, -));
  7653 + f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1);
  7654 +
  7655 + v_aeIndex := f_getLatestResourceIndex(vc_ae1);
7567 7656  
7568 7657 // Test Body
7569   - v_ae1.start(f_cse_sendCreateRequestPrimitive(p_resourceType,p_requestCreatePrimitive, v_parentIndex));
7570   -
7571   - tc_ac.start;
7572   - alt {
7573   - [] mccPortIn.receive(mw_request(p_createRequestAnnc)) -> value v_request {
7574   - tc_ac.stop;
7575   - setverdict(pass, __SCOPE__ & ":INFO: CREATE REQUEST received");
7576   -
7577   - if(match(v_request.primitive.requestPrimitive.to_, f_getLocalResourceAddress(v_aEAnncIndex, e_hierarchical, e_spRelative)) or
7578   - match(v_request.primitive.requestPrimitive.to_, f_getLocalResourceAddress(v_aEAnncIndex, e_nonHierarchical, e_spRelative))) {
7579   - setverdict(pass, __SCOPE__ & ":matching ANNC_PARENT_RESOURCE_ADDRESS");
7580   - } else {
7581   - setverdict(fail, __SCOPE__ & ":mis-matching ANNC_PARENT_RESOURCE_ADDRESS");
7582   - }
7583   -
7584   - }
7585   - [] tc_ac.timeout {
7586   - setverdict(fail, __SCOPE__ & ":ERROR: No CREATE REQUEST received");
7587   - }
7588   - }
7589   -
7590   - v_ae1.done;
  7658 + vc_ae1.start(f_cse_createResource(p_resourceType,p_requestCreatePrimitive, v_aeIndex));
  7659 + f_cse_announcementProcedure_createHandler(p_createRequestAnnc, -, v_aEAnncIndex);
  7660 + vc_ae1.done;
  7661 +
7591 7662 // Postamble
7592 7663 f_cse_postamble_deleteResourcesCSE();
7593 7664  
... ... @@ -7598,7 +7669,6 @@ module OneM2M_PermutationFunctions {
7598 7669  
7599 7670 function f_CSE_ANNC_CRE_009_CseSimu(ResourceType p_resourceType, template RequestPrimitive p_createRequestAnnc, in template RequestPrimitive p_requestCreatePrimitive := omit) runs on CseSimu {
7600 7671 // Local variables
7601   - var AeSimu v_ae1 := AeSimu.create("AE1") alive;
7602 7672 var MsgIn v_request;
7603 7673 var integer v_parentIndex := -1;
7604 7674 var integer v_aeIndex := -1;
... ... @@ -7606,9 +7676,7 @@ module OneM2M_PermutationFunctions {
7606 7676 var integer v_aEAnncIndex := -1;
7607 7677 var ResponsePrimitive v_responsePrimitive;
7608 7678 var template RequestPrimitive v_create := m_createAe(PX_APP_ID, omit, omit);
7609   - v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
7610   - v_ae1.done;
7611   - v_create.primitiveContent.container.announceTo := {PX_CSE1_ID};
  7679 + v_create.primitiveContent.aE.announceTo := {PX_CSE1_ID};
7612 7680  
7613 7681 // Test control
7614 7682  
... ... @@ -7617,35 +7685,19 @@ module OneM2M_PermutationFunctions {
7617 7685  
7618 7686 //Test adapter configuration
7619 7687 // Register the CSE
7620   - f_cse_registerRemoteCse(mw_createRemoteCSE);
7621   -
7622   - v_ae1.start(f_cse_createResource(int2,v_create));
7623   - f_cse_announcementProcedure_createHandler(mw_createAEAnnc(-, -, -));
7624   - v_ae1.done;
  7688 + vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSE_poa(-, -, -, -, {f_getAnnouncementTargetPoA()}));
  7689 +
  7690 + f_checkCseSimuStatus();
  7691 + vc_ae1.start(f_cse_createResource(int2,v_create));
  7692 + v_aEAnncIndex := f_cse_announcementProcedure_createHandler(mw_createAEAnnc(-, -, -));
  7693 + f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1);
  7694 +
  7695 + v_aeIndex := f_getLatestResourceIndex(vc_ae1);
7625 7696  
7626 7697 // Test Body
7627   - v_ae1.start(f_cse_sendCreateRequestPrimitive(p_resourceType,p_requestCreatePrimitive, v_parentIndex));
7628   -
7629   - tc_ac.start;
7630   - alt {
7631   - [] mccPortIn.receive(mw_request(p_createRequestAnnc)) -> value v_request {
7632   - tc_ac.stop;
7633   - setverdict(pass, __SCOPE__ & ":INFO: CREATE REQUEST received");
7634   -
7635   - if(match(v_request.primitive.requestPrimitive.to_, f_getLocalResourceAddress(v_aEAnncIndex, e_hierarchical, e_spRelative)) or
7636   - match(v_request.primitive.requestPrimitive.to_, f_getLocalResourceAddress(v_aEAnncIndex, e_nonHierarchical, e_spRelative))) {
7637   - setverdict(pass, __SCOPE__ & ":matching ANNC_PARENT_RESOURCE_ADDRESS");
7638   - } else {
7639   - setverdict(fail, __SCOPE__ & ":mis-matching ANNC_PARENT_RESOURCE_ADDRESS");
7640   - }
7641   -
7642   - }
7643   - [] tc_ac.timeout {
7644   - setverdict(fail, __SCOPE__ & ":ERROR: No CREATE REQUEST received");
7645   - }
7646   - }
7647