Commit 3169131046ee4f7b341950f448bb1deb8b1a89b8

Authored by Miguel Angel Reina Ortega
1 parent be4de28e

Hybrid addressing g_CSE_GEN_UPD_004, g_CSE_GEN_RET_004 and g_CSE_GEN_DEL_004 tes…

…t cases groups implemented

Signed-off-by: reinaortega <miguelangel.reinaortega@etsi.org>
... ... @@ -826,7 +826,7 @@ module OneM2M_PermutationFunctions {
826 826 v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex);
827 827  
828 828 // Test Body
829   - //Force usage of Non-Hierarchical addressing method
  829 + //Force usage of Hierarchical addressing method
830 830 v_addressingMethod := e_hierarchical;
831 831 v_primitiveScope := p_primitiveScope;
832 832 v_request := f_getCreateRequestPrimitive(int3, m_createContainerBase, v_resourceIndex);
... ... @@ -860,7 +860,7 @@ module OneM2M_PermutationFunctions {
860 860  
861 861 }//end f_CSE_GEN_CRE_002
862 862  
863   - function f_CSE_GEN_CRE_003(in PrimitiveScope p_primitiveScope) runs on AeSimu {
  863 + function f_CSE_GEN_CRE_004(in PrimitiveScope p_primitiveScope) runs on AeSimu {
864 864  
865 865 // Local variables
866 866 var RequestPrimitive v_request;
... ... @@ -918,7 +918,7 @@ module OneM2M_PermutationFunctions {
918 918 // Tear down
919 919 f_cf01Down();
920 920  
921   - }//end f_CSE_GEN_CRE_003
  921 + }//end f_CSE_GEN_CRE_004
922 922  
923 923  
924 924 } // end of group Create
... ... @@ -1007,7 +1007,7 @@ module OneM2M_PermutationFunctions {
1007 1007 v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex);
1008 1008  
1009 1009 // Test Body
1010   - //Force usage of Non-Hierarchical addressing method
  1010 + //Force usage of Hierarchical addressing method
1011 1011 v_addressingMethod := e_hierarchical;
1012 1012 v_primitiveScope := p_primitiveScope;
1013 1013  
... ... @@ -1038,6 +1038,62 @@ module OneM2M_PermutationFunctions {
1038 1038  
1039 1039 }//end f_CSE_GEN_RET_002
1040 1040  
  1041 + function f_CSE_GEN_RET_004(in PrimitiveScope p_primitiveScope) runs on AeSimu {
  1042 +
  1043 + // Local variables
  1044 + var integer v_aeIndex := -1;
  1045 + var integer v_resourceIndex := -1;
  1046 + var AddressingMethod v_addressingMethod;
  1047 + var PrimitiveScope v_primitiveScope;
  1048 +
  1049 + // Test control
  1050 + if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
  1051 + setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case");
  1052 + stop;
  1053 + }
  1054 +
  1055 + // Test component configuration
  1056 + f_cf01Up();
  1057 +
  1058 + // Test adapter configuration
  1059 +
  1060 + // Preamble
  1061 + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
  1062 +
  1063 + v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex);
  1064 +
  1065 + // Test Body
  1066 + //Force usage of Hybrid Hierarchical addressing method
  1067 + v_addressingMethod := e_hybrid;
  1068 + v_primitiveScope := p_primitiveScope;
  1069 +
  1070 + mcaPort.send(f_getMsgOutPrimitive(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope), f_getOriginator(v_resourceIndex)))));tc_ac.start;
  1071 + alt {
  1072 + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) {
  1073 + tc_ac.stop;
  1074 + setverdict(pass, __SCOPE__ & ": Container resource retrieved using hybrid addressing method");
  1075 + }
  1076 + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
  1077 + tc_ac.stop;
  1078 + setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
  1079 + }
  1080 + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
  1081 + tc_ac.stop;
  1082 + setverdict(fail, __SCOPE__ & ": Error while retrieving container resource using hybrid addressing method");
  1083 + }
  1084 + [] tc_ac.timeout {
  1085 + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
  1086 + }
  1087 + }
  1088 +
  1089 + // Postamble
  1090 + f_cse_postamble_deleteResources();
  1091 +
  1092 + // Tear down
  1093 + f_cf01Down();
  1094 +
  1095 + }//end f_CSE_GEN_RET_004
  1096 +
1041 1097 } // end of group Retrieve
1042 1098  
1043 1099 group Update {
... ... @@ -1131,7 +1187,7 @@ module OneM2M_PermutationFunctions {
1131 1187 v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex);
1132 1188  
1133 1189 // Test Body
1134   - //Force usage of Non-Hierarchical addressing method
  1190 + //Force usage of Hierarchical addressing method
1135 1191 v_addressingMethod := e_hierarchical;
1136 1192 v_primitiveScope := p_primitiveScope;
1137 1193  
... ... @@ -1168,6 +1224,69 @@ module OneM2M_PermutationFunctions {
1168 1224  
1169 1225 }//end f_CSE_GEN_UPD_002
1170 1226  
  1227 + function f_CSE_GEN_UPD_004(in PrimitiveScope p_primitiveScope) runs on AeSimu {
  1228 +
  1229 + // Local variables
  1230 + var RequestPrimitive v_updateRequest := valueof(m_updateContainerBase);
  1231 + var integer v_aeIndex := -1;
  1232 + var integer v_resourceIndex := -1;
  1233 + var AddressingMethod v_addressingMethod;
  1234 + var PrimitiveScope v_primitiveScope;
  1235 +
  1236 + // Test control
  1237 + if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
  1238 + setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case");
  1239 + stop;
  1240 + }
  1241 +
  1242 + // Test component configuration
  1243 + f_cf01Up();
  1244 +
  1245 + // Test adapter configuration
  1246 +
  1247 + // Preamble
  1248 + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
  1249 +
  1250 + v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex);
  1251 +
  1252 + // Test Body
  1253 + //Force usage of Hybrid Hierarchical addressing method
  1254 + v_addressingMethod := e_hybrid;
  1255 + v_primitiveScope := p_primitiveScope;
  1256 +
  1257 + v_updateRequest.primitiveContent.container.labels := {"MyLabel"};
  1258 +
  1259 + v_updateRequest := f_getUpdateRequestPrimitive(int3, v_resourceIndex, v_updateRequest);
  1260 + v_updateRequest.to_ := f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope);
  1261 +
  1262 + mcaPort.send(f_getMsgOutPrimitive(m_request(v_updateRequest)));
  1263 + tc_ac.start;
  1264 + alt {
  1265 + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) {
  1266 + tc_ac.stop;
  1267 + setverdict(pass, __SCOPE__ & ": Container resource updated using hierarchical addressing method");
  1268 + }
  1269 + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
  1270 + tc_ac.stop;
  1271 + setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
  1272 + }
  1273 + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
  1274 + tc_ac.stop;
  1275 + setverdict(fail, __SCOPE__ & ": Error while updating container resource using hierarchical addressing method");
  1276 + }
  1277 + [] tc_ac.timeout {
  1278 + setverdict(fail, __SCOPE__ & ": No answer while updating resource");
  1279 + }
  1280 + }
  1281 +
  1282 + // Postamble
  1283 + f_cse_postamble_deleteResources();
  1284 +
  1285 + // Tear down
  1286 + f_cf01Down();
  1287 +
  1288 + }//end f_CSE_GEN_UPD_004
  1289 +
1171 1290 } // end of group Update
1172 1291  
1173 1292 group Delete {
... ... @@ -1258,7 +1377,7 @@ module OneM2M_PermutationFunctions {
1258 1377 v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex);
1259 1378  
1260 1379 // Test Body
1261   - //Force usage of Non-Hierarchical addressing method
  1380 + //Force usage of Hierarchical addressing method
1262 1381 v_addressingMethod := e_hierarchical;
1263 1382 v_primitiveScope := p_primitiveScope;
1264 1383  
... ... @@ -1292,6 +1411,66 @@ module OneM2M_PermutationFunctions {
1292 1411  
1293 1412 }//end f_CSE_GEN_DEL_002
1294 1413  
  1414 + function f_CSE_GEN_DEL_004(in PrimitiveScope p_primitiveScope) runs on AeSimu {
  1415 +
  1416 + // Local variables
  1417 + var RequestPrimitive v_request;
  1418 + var integer v_aeIndex := -1;
  1419 + var integer v_resourceIndex := -1;
  1420 + var AddressingMethod v_addressingMethod;
  1421 + var PrimitiveScope v_primitiveScope;
  1422 +
  1423 + // Test control
  1424 + if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
  1425 + setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case");
  1426 + stop;
  1427 + }
  1428 +
  1429 + // Test component configuration
  1430 + f_cf01Up();
  1431 +
  1432 + // Test adapter configuration
  1433 +
  1434 + // Preamble
  1435 + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
  1436 +
  1437 + v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex);
  1438 +
  1439 + // Test Body
  1440 + //Force usage of Hybrid Hierarchical addressing method
  1441 + v_addressingMethod := e_hybrid;
  1442 + v_primitiveScope := p_primitiveScope;
  1443 +
  1444 + v_request := valueof(m_delete(f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope), f_getOriginator(v_resourceIndex)));
  1445 +
  1446 + mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
  1447 + tc_ac.start;
  1448 + alt {
  1449 + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) {
  1450 + tc_ac.stop;
  1451 + setverdict(pass, __SCOPE__ & ": Container resource deleted using hierarchical addressing method");
  1452 + }
  1453 + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
  1454 + tc_ac.stop;
  1455 + setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
  1456 + }
  1457 + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
  1458 + tc_ac.stop;
  1459 + setverdict(fail, __SCOPE__ & ": Error while deleting container resource using hierarchical addressing method");
  1460 + }
  1461 + [] tc_ac.timeout {
  1462 + setverdict(fail, __SCOPE__ & ": No answer while deleting resource");
  1463 + }
  1464 + }
  1465 +
  1466 + // Postamble
  1467 + f_cse_postamble_deleteResources();
  1468 +
  1469 + // Tear down
  1470 + f_cf01Down();
  1471 +
  1472 + }//end f_CSE_GEN_DEL_004
  1473 +
1295 1474 } // end of group Delete
1296 1475  
1297 1476 } // end of group Generic
... ...
... ... @@ -83,56 +83,182 @@ module OneM2M_Testcases_CSE_Release_2 {
83 83  
84 84 group Create {
85 85  
86   - group g_CSE_GEN_CRE_003 {
  86 + group g_CSE_GEN_CRE_004 {
87 87  
88 88 /**
89 89 * @desc Check that the IUT accepts the creation of a <container> resource using structured resource identifier with hybrid addressing.
90 90 *
91 91 */
92   - testcase TC_CSE_GEN_CRE_003_CSR() runs on Tester system CseSystem {
  92 + testcase TC_CSE_GEN_CRE_004_CSR() runs on Tester system CseSystem {
93 93 // Local variables
94 94  
95 95 var AeSimu v_ae1 := AeSimu.create("AE1") alive;
96 96 v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
97 97 v_ae1.done;
98 98  
99   - v_ae1.start(f_CSE_GEN_CRE_003(e_cseRelative));
  99 + v_ae1.start(f_CSE_GEN_CRE_004(e_cseRelative));
100 100 v_ae1.done;
101 101 }
102 102  
103   - testcase TC_CSE_GEN_CRE_003_SPR() runs on Tester system CseSystem {
  103 + testcase TC_CSE_GEN_CRE_004_SPR() runs on Tester system CseSystem {
104 104 // Local variables
105 105  
106 106 var AeSimu v_ae1 := AeSimu.create("AE1") alive;
107 107 v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
108 108 v_ae1.done;
109 109  
110   - v_ae1.start(f_CSE_GEN_CRE_003(e_spRelative));
  110 + v_ae1.start(f_CSE_GEN_CRE_004(e_spRelative));
111 111 v_ae1.done;
112 112 }
113 113  
114   - testcase TC_CSE_GEN_CRE_003_ABS() runs on Tester system CseSystem {
  114 + testcase TC_CSE_GEN_CRE_004_ABS() runs on Tester system CseSystem {
115 115 // Local variables
116 116  
117 117 var AeSimu v_ae1 := AeSimu.create("AE1") alive;
118 118 v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
119 119 v_ae1.done;
120 120  
121   - v_ae1.start(f_CSE_GEN_CRE_003(e_absolute));
  121 + v_ae1.start(f_CSE_GEN_CRE_004(e_absolute));
122 122 v_ae1.done;
123 123 }
124 124  
125   - } // end of group g_CSE_GEN_CRE_003
  125 + } // end of group g_CSE_GEN_CRE_004
126 126  
127 127 } // end of group Create
128 128  
129 129 group Retrieve {
  130 +
  131 + group g_CSE_GEN_RET_004 {
  132 +
  133 + /**
  134 + * @desc Check that the IUT accepts the retrieval of a <container> resource using structured resource identifier with hybrid addressing.
  135 + *
  136 + */
  137 + testcase TC_CSE_GEN_RET_004_CSR() runs on Tester system CseSystem {
  138 + // Local variables
  139 +
  140 + var AeSimu v_ae1 := AeSimu.create("AE1") alive;
  141 + v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
  142 + v_ae1.done;
  143 +
  144 + v_ae1.start(f_CSE_GEN_RET_004(e_cseRelative));
  145 + v_ae1.done;
  146 + }
  147 +
  148 + testcase TC_CSE_GEN_RET_004_SPR() runs on Tester system CseSystem {
  149 + // Local variables
  150 +
  151 + var AeSimu v_ae1 := AeSimu.create("AE1") alive;
  152 + v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
  153 + v_ae1.done;
  154 +
  155 + v_ae1.start(f_CSE_GEN_RET_004(e_spRelative));
  156 + v_ae1.done;
  157 + }
  158 +
  159 + testcase TC_CSE_GEN_RET_004_ABS() runs on Tester system CseSystem {
  160 + // Local variables
  161 +
  162 + var AeSimu v_ae1 := AeSimu.create("AE1") alive;
  163 + v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
  164 + v_ae1.done;
  165 +
  166 + v_ae1.start(f_CSE_GEN_RET_004(e_absolute));
  167 + v_ae1.done;
  168 + }
  169 +
  170 + } // end of group g_CSE_GEN_RET_004
  171 +
130 172 } // end of group Retrieve
131 173  
132 174 group Update {
  175 +
  176 + group g_CSE_GEN_UPD_004 {
  177 +
  178 + /**
  179 + * @desc Check that the IUT accepts the update of a <container> resource using structured resource identifier with hybrid addressing..
  180 + *
  181 + */
  182 + testcase TC_CSE_GEN_UPD_004_CSR() runs on Tester system CseSystem {
  183 + // Local variables
  184 +
  185 + var AeSimu v_ae1 := AeSimu.create("AE1") alive;
  186 + v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
  187 + v_ae1.done;
  188 +
  189 + v_ae1.start(f_CSE_GEN_UPD_004(e_cseRelative));
  190 + v_ae1.done;
  191 + }
  192 +
  193 + testcase TC_CSE_GEN_UPD_004_SPR() runs on Tester system CseSystem {
  194 + // Local variables
  195 +
  196 + var AeSimu v_ae1 := AeSimu.create("AE1") alive;
  197 + v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
  198 + v_ae1.done;
  199 +
  200 + v_ae1.start(f_CSE_GEN_UPD_004(e_spRelative));
  201 + v_ae1.done;
  202 + }
  203 +
  204 + testcase TC_CSE_GEN_UPD_004_ABS() runs on Tester system CseSystem {
  205 + // Local variables
  206 +
  207 + var AeSimu v_ae1 := AeSimu.create("AE1") alive;
  208 + v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
  209 + v_ae1.done;
  210 +
  211 + v_ae1.start(f_CSE_GEN_UPD_004(e_absolute));
  212 + v_ae1.done;
  213 + }
  214 +
  215 + } // end of group g_CSE_GEN_UPD_004
  216 +
133 217 } // end of group Update
134 218  
135 219 group Delete {
  220 +
  221 + group g_CSE_GEN_DEL_004 {
  222 +
  223 + /**
  224 + * @desc Check that the IUT accepts the deletion of a <container> resource using structured resource identifier with hybrid addressing.
  225 + *
  226 + */
  227 + testcase TC_CSE_GEN_DEL_004_CSR() runs on Tester system CseSystem {
  228 + // Local variables
  229 +
  230 + var AeSimu v_ae1 := AeSimu.create("AE1") alive;
  231 + v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
  232 + v_ae1.done;
  233 +
  234 + v_ae1.start(f_CSE_GEN_DEL_004(e_cseRelative));
  235 + v_ae1.done;
  236 + }
  237 +
  238 + testcase TC_CSE_GEN_DEL_004_SPR() runs on Tester system CseSystem {
  239 + // Local variables
  240 +
  241 + var AeSimu v_ae1 := AeSimu.create("AE1") alive;
  242 + v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
  243 + v_ae1.done;
  244 +
  245 + v_ae1.start(f_CSE_GEN_DEL_004(e_spRelative));
  246 + v_ae1.done;
  247 + }
  248 +
  249 + testcase TC_CSE_GEN_DEL_004_ABS() runs on Tester system CseSystem {
  250 + // Local variables
  251 +
  252 + var AeSimu v_ae1 := AeSimu.create("AE1") alive;
  253 + v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
  254 + v_ae1.done;
  255 +
  256 + v_ae1.start(f_CSE_GEN_DEL_004(e_absolute));
  257 + v_ae1.done;
  258 + }
  259 +
  260 + } // end of group g_CSE_GEN_DEL_004
  261 +
136 262 } // end of group Delete
137 263  
138 264 } // end of group Generic
... ...