OneM2M_Testcases_CSE_Release_1.ttcn 504 KB
Newer Older
1 2 3 4 5 6 7 8
/**
 *  Copyright Notification
 *  No part of this document may be reproduced, in an electronic retrieval system or otherwise, except as authorized by written permission.
 *  The copyright and the foregoing restriction extend to reproduction in all media.
 *  © 2016, oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC).
 *  All rights reserved.
 *  
 *  @author     ETSI
9 10
 *  @version    $URL: https://oldforge.etsi.org/svn/oneM2M/branches/Release1/ttcn/OneM2M_Testcases.ttcn $
 *              $Id: OneM2M_Testcases.ttcn 347 2017-08-11 08:48:20Z reinaortega $
11 12 13
 *  @desc       Module containing test cases for oneM2M
 *
 */
14
module OneM2M_Testcases_CSE_Release_1 {
15 16 17 18 19 20

	import from OneM2M_TestSystem all;
	import from OneM2M_Templates all;
	import from OneM2M_Types all;//{type XSD.ID};
	import from OneM2M_TypesAndValues all;
	import from OneM2M_Pixits all;
21
	import from LibCommon_Time all;
22
	import from OneM2M_Pics all;
23
	import from OneM2M_Functions all;
24
	import from OneM2M_PermutationFunctions all;
25 26
	import from XSD all;
	
27
	
28 29 30
	//Demos used for validation purposes
	group oneM2M_demos {
	
31
		group helpingTestCases {//These are not part of the test suite, just for verification purposes
32
			
33 34 35 36 37 38 39 40 41 42 43 44
			testcase TC_DELETE_RESOURCES() runs on Tester system CseSystem {
				// Local variables
				                        
				var AeSimu v_ae1 := AeSimu.create("AE1") alive;
				v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
				v_ae1.done;
	            
				v_ae1.start(f_DELETE_RESOURCES());
				v_ae1.done;
			}
			
			function f_DELETE_RESOURCES() runs on AeSimu system CseSystem {
45 46 47
				
				timer t_ac := 5.0;
				var integer i; 
48 49
				var XSD.ID v_resourceAddress;
				var RequestPrimitive v_request;
50 51 52
				map(self:mcaPort, system:mcaPort); 
					
				for (i:=0; i<lengthof(PX_RESOURCES_TO_BE_DELETED); i:= i+1) {  
53 54 55
					
					v_resourceAddress := f_getResourceAddress() & "/" & PX_RESOURCES_TO_BE_DELETED[i]; 
						
56 57
					v_request := valueof(m_delete(v_resourceAddress, PX_SUPER_AE_ID));
					    
58
					mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
59
					
60 61
					t_ac.start;
					alt {
62
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
63
							t_ac.stop;
64
							log(__SCOPE__ & ":Resource deleted");
65
							//setverdict(pass);
66
						}
67
						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
68
							t_ac.stop;
69
							log(__SCOPE__ & ":Error while deleting resource");
70
							//setverdict(fail);
71 72 73
						}
						[] mcaPort.receive {
							t_ac.stop;
74
							log(__SCOPE__ & ":Unexpected message received");
75
							//setverdict(inconc);
76 77
						}
						[] t_ac.timeout {
78
							log(__SCOPE__ & ":No answer while deleting resource");
79
							//setverdict(inconc);
80 81 82 83 84 85 86 87
						}	
					}	
				}
			
				unmap(self:mcaPort, system:mcaPort); 
				stop;
			}	
		
88
		}//end group helpingTestCases
89 90 91 92 93
	
	}//end group oneM2M_demos
	
	group CSE {
		
94 95 96 97 98 99 100 101 102
		group Generic {
			
			group Create {
				group g_CSE_GEN_CRE_001 {

					/**
					 * @desc Check that the IUT accepts the creation of a  resource using unstructured resource identifier
					 * 
					 */
103
					testcase TC_CSE_GEN_CRE_001_CSR() runs on Tester system CseSystem {
104 105
						// Local variables
						                        
106
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
107 108
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
109 110 111
                        
						v_ae1.start(f_CSE_GEN_CRE_001(e_cseRelative));
						v_ae1.done;
112
					}
113

114
					testcase TC_CSE_GEN_CRE_001_SPR() runs on Tester system CseSystem {
115 116
						// Local variables
						
117
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
118 119
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
120 121 122

						v_ae1.start(f_CSE_GEN_CRE_001(e_spRelative));
						v_ae1.done;
123
					}
124
					
125
					testcase TC_CSE_GEN_CRE_001_ABS() runs on Tester system CseSystem {
126
						// Local variables
127
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
128 129
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
130 131 132
                        
						v_ae1.start(f_CSE_GEN_CRE_001(e_absolute));
						v_ae1.done;
133
					}				
134 135 136 137
				
				} // end of group g_CSE_GEN_CRE_001
				
				group g_CSE_GEN_CRE_002 {
138

139 140 141 142
					/**
					 * @desc Check that the IUT accepts the creation of a  resource using structured resource identifier
					 * 
					 */
143
					testcase TC_CSE_GEN_CRE_002_CSR() runs on Tester system CseSystem {
144 145
						// Local variables
						                        
146
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
147 148
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
149 150 151
                        
						v_ae1.start(f_CSE_GEN_CRE_002(e_cseRelative));
						v_ae1.done;
152
					}
153

154
					testcase TC_CSE_GEN_CRE_002_SPR() runs on Tester system CseSystem {
155 156
						// Local variables
						
157
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
158 159
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
160 161 162
                        
						v_ae1.start(f_CSE_GEN_CRE_002(e_spRelative));
						v_ae1.done;
163
					}
164
					
165
					testcase TC_CSE_GEN_CRE_002_ABS() runs on Tester system CseSystem {
166 167
						// Local variables
							
168
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
169 170
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
171 172 173
                        
						v_ae1.start(f_CSE_GEN_CRE_002(e_absolute));
						v_ae1.done;
174
					}
175
				
176
				} // end of group g_CSE_GEN_CRE_002
177
				
178 179 180 181 182 183 184 185 186
			} // end of group Create
			
			group Retrieve {
				group g_CSE_GEN_RET_001 {

					/**
					 * @desc Check that the IUT accepts the retrieval of a <container>  resource using unstructured resource identifier
					 * 
					 */
187
					testcase TC_CSE_GEN_RET_001_CSR() runs on Tester system CseSystem {
188 189
						// Local variables
						                        
190
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
191 192
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
193 194 195
                        
						v_ae1.start(f_CSE_GEN_RET_001(e_cseRelative));
						v_ae1.done;
196
					}
197

198
					testcase TC_CSE_GEN_RET_001_SPR() runs on Tester system CseSystem {
199 200
						// Local variables
						
201
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
202 203
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
204 205 206
                        
						v_ae1.start(f_CSE_GEN_RET_001(e_spRelative));
						v_ae1.done;
207
					}
208
					
209
					testcase TC_CSE_GEN_RET_001_ABS() runs on Tester system CseSystem {
210
						// Local variables
211
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
212 213
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
214 215 216
                        
						v_ae1.start(f_CSE_GEN_RET_001(e_absolute));
						v_ae1.done;
217 218
					}
								
219
				
220 221 222 223 224 225 226 227
				} // end of group g_CSE_GEN_RET_001
				
				group g_CSE_GEN_RET_002 {

					/**
					 * @desc Check that the IUT accepts the retrieval of a <container>  resource using structured resource identifier
					 * 
					 */
228
					testcase TC_CSE_GEN_RET_002_CSR() runs on Tester system CseSystem {
229
						// Local variables
230
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
231 232
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
233 234 235
                        
						v_ae1.start(f_CSE_GEN_RET_002(e_cseRelative));
						v_ae1.done;
236
					}
237

238
					testcase TC_CSE_GEN_RET_002_SPR() runs on Tester system CseSystem {
239 240
						// Local variables
						
241
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
242 243
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
244 245 246
                        
						v_ae1.start(f_CSE_GEN_RET_002(e_spRelative));
						v_ae1.done;
247
					}
248
					
249
					testcase TC_CSE_GEN_RET_002_ABS() runs on Tester system CseSystem {
250 251
						// Local variables
							
252
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
253 254
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
255 256 257
                        
						v_ae1.start(f_CSE_GEN_RET_002(e_absolute));
						v_ae1.done;
258 259
					}
								
260 261 262
				} // end of group g_CSE_GEN_RET_002
				
			} // end of group Retrieve
263
			
264 265
			group Update {
				group g_CSE_GEN_UPD_001 {
266

267 268 269 270
					/**
					 * @desc Check that the IUT accepts the update of a <container>  resource using unstructured resource identifier
					 * 
					 */
271
					testcase TC_CSE_GEN_UPD_001_CSR() runs on Tester system CseSystem {
272
						// Local variables
273
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
274 275
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
276 277 278
                        
						v_ae1.start(f_CSE_GEN_UPD_001(e_cseRelative));
						v_ae1.done;
279
					}
280

281
					testcase TC_CSE_GEN_UPD_001_SPR() runs on Tester system CseSystem {
282
						// Local variables
283
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
284 285
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
286 287 288
                        
						v_ae1.start(f_CSE_GEN_UPD_001(e_spRelative));
						v_ae1.done;
289
					}
290
					
291
					testcase TC_CSE_GEN_UPD_001_ABS() runs on Tester system CseSystem {
292 293
						// Local variables
							
294
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
295 296
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
297 298 299
                        
						v_ae1.start(f_CSE_GEN_UPD_001(e_absolute));
						v_ae1.done;
300 301
					}
								
302 303 304 305 306 307 308 309
				} // end of group g_CSE_GEN_UPD_001
				
				group g_CSE_GEN_UPD_002 {

					/**
					 * @desc Check that the IUT accepts the update of a <container>  resource using structured resource identifier
					 * 
					 */
310
					testcase TC_CSE_GEN_UPD_002_CSR() runs on Tester system CseSystem {
311 312
						// Local variables
						                        
313
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
314 315
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
316 317 318
                        
						v_ae1.start(f_CSE_GEN_UPD_002(e_cseRelative));
						v_ae1.done;
319 320
					}

321
					testcase TC_CSE_GEN_UPD_002_SPR() runs on Tester system CseSystem {
322 323
						// Local variables
						
324
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
325 326
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
327 328 329
                        
						v_ae1.start(f_CSE_GEN_UPD_002(e_spRelative));
						v_ae1.done;
330
					}
331
					
332
					testcase TC_CSE_GEN_UPD_002_ABS() runs on Tester system CseSystem {
333
						// Local variables
334
							
335
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
336 337
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
338 339 340
                        
						v_ae1.start(f_CSE_GEN_UPD_002(e_absolute));
						v_ae1.done;
341
					}
342 343 344 345
								
				} // end of group g_CSE_GEN_UPD_002
				
			} // end of group Update
346
			
347 348
			group Delete {
				group g_CSE_GEN_DEL_001 {
349

350 351 352 353
					/**
					 * @desc Check that the IUT accepts the deletion of a <container>  resource using unstructured resource identifier
					 *  
					 */
354
					testcase TC_CSE_GEN_DEL_001_CSR() runs on Tester system CseSystem {
355 356
						// Local variables
						                        
357
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
358 359
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
360 361 362
                        
						v_ae1.start(f_CSE_GEN_DEL_001(e_cseRelative));
						v_ae1.done;
363 364
					}

365
					testcase TC_CSE_GEN_DEL_001_SPR() runs on Tester system CseSystem {
366 367
						// Local variables
						
368
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
369 370
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
371 372 373
                        
						v_ae1.start(f_CSE_GEN_DEL_001(e_spRelative));
						v_ae1.done;
374
					}
375
					
376
					testcase TC_CSE_GEN_DEL_001_ABS() runs on Tester system CseSystem {
377 378
						// Local variables
							
379
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
380 381
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
382 383 384
                        
						v_ae1.start(f_CSE_GEN_DEL_001(e_absolute));
						v_ae1.done;
385 386 387 388 389 390 391 392 393 394
					}
								
				} // end of group g_CSE_GEN_DEL_001
				
				group g_CSE_GEN_DEL_002 {

					/**
					 * @desc Check that the IUT accepts the deletion of a <container>  resource using structured resource identifier
					 * 
					 */
395
					testcase TC_CSE_GEN_DEL_002_CSR() runs on Tester system CseSystem {
396 397
						// Local variables
						                        
398
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
399 400
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
401 402 403
                        
						v_ae1.start(f_CSE_GEN_DEL_002(e_cseRelative));
						v_ae1.done;
404 405
					}

406
					testcase TC_CSE_GEN_DEL_002_SPR() runs on Tester system CseSystem {
407
						// Local variables
408
						
409
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
410 411
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
412 413 414
                        
						v_ae1.start(f_CSE_GEN_DEL_002(e_spRelative));
						v_ae1.done;
415
					}
416
					
417
					testcase TC_CSE_GEN_DEL_002_ABS() runs on Tester system CseSystem {
418 419
						// Local variables
							
420
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
421 422
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
423 424 425
                        
						v_ae1.start(f_CSE_GEN_DEL_002(e_absolute));
						v_ae1.done;
426 427 428 429 430 431 432 433 434 435 436 437 438
					}
								
				} // end of group g_CSE_GEN_DEL_002
				
			} // end of group Delete
		
		} // end of group Generic
		
		group Registration {
			
			group Create{
				
				/**
439
				 * @desc Check that the IUT accepts a create request of <AE> resource with attributes multiplicity equals to 1 and provided preprovisioned SP_relative_ AE_ID.  
440 441
				 * 
				 */
442 443 444
				testcase TC_CSE_REG_CRE_001() runs on Tester system CseSystem {
					
					var AeSimu v_ae1 := AeSimu.create("AE1") alive;
445 446
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
447 448 449 450 451 452 453 454
					
					v_ae1.start(f_CSE_REG_CRE_001());
		  	  	
		  	  		v_ae1.done;
		  	  		
				}
				
				function f_CSE_REG_CRE_001() runs on AeSimu {
455
		  	  	
456
					var MsgIn v_response;
457
					var RequestPrimitive v_request;
458 459
					var integer v_cseBaseIndex := -1;
					var ResourceType v_resourceType := int2;
460
					var universal charstring v_action :=  __SCOPE__ & ": Please, make sure that the following AE-ID is allowed to register: " & PX_ALLOWED_C_AE_IDS[0];
461
	                
462 463 464 465 466 467
					//Test control
					if(not(PICS_IN_CSE)) {
						setverdict(inconc, __SCOPE__ & ": IUT shall be IN-CSE to run this test case");
						stop;
					}
	                
468 469
					// Test component configuration
					f_cf01Up();
470 471
	                
					//Preamble
472
					action(v_action);
473
					f_sleepIgnoreDef(PX_TCONFIG_IUT);
474
					
475
					//Test Body
Miguel Angel Reina Ortega's avatar
Miguel Angel Reina Ortega committed
476
					v_request := valueof(m_createAe(PX_APP_ID, omit, PX_CSE_ID & "/" & PX_ALLOWED_C_AE_IDS[0]));	
477
					
478
					v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, -1);
479
					
480
					mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
481
					
482 483
					tc_ac.start;
					alt {
484
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response {
485
							tc_ac.stop;
486 487 488
							f_checkAttributesToBeSaved(int2, v_request, v_response.primitive.responsePrimitive);
							vc_aeAuxIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int2);
							
489
							setverdict(pass, __SCOPE__ & ": AE successfully created.");
490
						}
491
						[] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int2001))) -> value v_response{
492
							tc_ac.stop;
493
							setverdict(fail, __SCOPE__ & ": Error while creating AE with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)));
494 495
						}
						[] tc_ac.timeout {
496
							setverdict(fail, __SCOPE__ & ": No answer while creating AE");
497 498
						}
					}	
499
									
500
					// Postamble
501 502 503 504
					f_cse_postamble_deleteResources();
					
					// Tear down
					f_cf01Down();
505 506
						
				}
507 508
		  	  	
				/**
509
				 * @desc Check that the IUT accepts a create request of <AE> resource with attributes multiplicity equals to 1 and provided preprovisioned AE_ID of AE-ID-Stem format.
510 511
				 * 
				 */
512 513 514
				testcase TC_CSE_REG_CRE_002() runs on Tester system CseSystem {
					
					var AeSimu v_ae1 := AeSimu.create("AE1") alive;
515 516
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
517 518 519 520 521 522 523 524
						
					v_ae1.start(f_CSE_REG_CRE_002());
			  	  	
					v_ae1.done;
			  	  		
				}
					
				function f_CSE_REG_CRE_002() runs on AeSimu {
525
		  	  	
526
					var MsgIn v_response;
527
					var RequestPrimitive v_request;
528 529
					var integer v_cseBaseIndex := -1;
					var ResourceType v_resourceType := int2;
530 531
					
					//Test control
532
	                
533 534
					// Test component configuration
					f_cf01Up();
535
		  	  	
536
					//Preamble
537
					
538
					//Test Body
539
					v_request := valueof(m_createAe(PX_APP_ID, omit, PX_ALLOWED_C_AE_IDS[0]));				
540
	    									
541
					v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, -1);
542
	
543
					mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
544 545
					tc_ac.start;
					alt {
546
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response{
547
							tc_ac.stop;
548 549 550
							
							f_checkAttributesToBeSaved(int2, v_request, v_response.primitive.responsePrimitive);
							vc_aeAuxIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int2);
551
							setverdict(pass, __SCOPE__ & ": AE successfully created.");
552
						}
553
						[] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int2001))) -> value v_response{
554
							tc_ac.stop;
555
							setverdict(fail, __SCOPE__ & ": Error while creating AE with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)));
556 557
						}
						[] tc_ac.timeout {
558
							setverdict(fail, __SCOPE__ & ": No answer while creating AE");
559 560
						}
					}	
561
									
562
					// Postamble
563 564 565 566
					f_cse_postamble_deleteResources();
					
					// Tear down
					f_cf01Down();
567
						
568
				}
569 570

				/**
571 572 573
				 * @desc Check that the IUT accepts a create request of <AE> resource with attributes multiplicity equals to 1 and provided preprovisioned SP_relative_AE_ID. 
				 */
				
574 575 576
				testcase TC_CSE_REG_CRE_003() runs on Tester system CseSystem {
					
					var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
577
					v_cse1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_CSE1));
578
					v_cse1.done;
579 580 581 582 583 584 585 586
						
					v_cse1.start(f_CSE_REG_CRE_003());
			  	  	
					v_cse1.done;
			  	  		
				}
					
				function f_CSE_REG_CRE_003() runs on CseSimu {
587 588 589 590
					
					var integer v_remoteCseIndex := -1;
					
					//Test Configuration
591
					//f_cf02Up();
592 593 594
					
					//Preamble
					v_remoteCseIndex := f_cse_registrationRemoteCse();
595
					vc_ae1 := AeSimu.create("AE1") alive;
596 597
					vc_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
					vc_ae1.done;
598
					vc_ae1.start(f_cse_preamble_registerAe());
599
					vc_ae1.done;
600
				
601
				}
602 603 604 605 606
		  	  	
				/**
				 * @desc Check that the IUT rejects an AE registration (allowed App-ID, not allowed C-AE-ID-STEM provided by AE) 
				 * 
				 */
607 608
				testcase TC_CSE_REG_CRE_004() runs on Tester system CseSystem {
					
609
					var AeSimu v_ae1 := AeSimu.create("AE1") alive;
610 611
					v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
612 613 614 615 616 617 618 619
						
					v_ae1.start(f_CSE_REG_CRE_004());
			  	  	
					v_ae1.done;
			  	  		
				}
					
				function f_CSE_REG_CRE_004() runs on AeSimu {
620
		  	  	
621
					var MsgIn v_response;
622
					var RequestPrimitive v_request;
623 624
					var integer v_cseBaseIndex := -1;
					var ResourceType v_resourceType := int2;
625
					var universal charstring v_action :=  __SCOPE__ & ": Please, make sure that the following AE-ID is not allowed to register: " & PX_NOT_ALLOWED_C_AE_IDS[0];
626 627
					
					//Test control
628
	                
629
					// Test component configuration
630
					f_cf01Up();
631
		  	  	
632
					//Preamble
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
633
					//vc_remoteCseIndex := f_cse_registrationRemoteCse(mw_createRemoteCSE);
634
					//TODO: create serviceSubscribedProfile, Node, and serviceSubscribedAppRule
635
					//v_cseBaseIndex := f_cse_preamble_createServiceSubscribedProfile({"C*"}); //c_CRUDNDi);
636
					action(v_action);
637
					f_sleepIgnoreDef(PX_TCONFIG_IUT);
638
					
639
					//Test Body	
640
					//v_request := valueof(m_createAe(PX_APP_ID, omit, "C-AE-ID-STEM"));				
641
	    											
642
					v_request := f_getCreateRequestPrimitive(int2, m_createAe(PX_APP_ID, omit, PX_NOT_ALLOWED_C_AE_IDS[0]), -1);
643
			
644
					mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
645 646
					tc_ac.start;
					alt {
647
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int4107))) {
648
							tc_ac.stop;
649
							setverdict(pass, __SCOPE__ & ": AE creation rejected.");
650
						}
651
						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response{
652
							tc_ac.stop;
653
							setverdict(fail, __SCOPE__ & ": Error while creating AE with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)));
654
						}
655 656 657 658 659 660
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response{
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error, creating AE with not allowed AE-ID ");
							f_checkAttributesToBeSaved(int2, v_request, v_response.primitive.responsePrimitive);
							vc_aeAuxIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int2);
						}
661
						[] tc_ac.timeout {
662
							setverdict(fail, __SCOPE__ & ": No answer while creating AE");
663
						}
664
					}
665
									
666
					// Postamble
667
					f_cse_postamble_deleteResources();
668
						
669
					// Tear down
670
					f_cf01Down();
671 672
						
				}
673 674 675 676 677
		  	  	
				/**
				 * @desc Check that the IUT accepts an AE registration (allowed App-ID, S-AE-ID-STEM not provided by AE) 
				 * 
				 */
678 679 680
				testcase TC_CSE_REG_CRE_005() runs on Tester system CseSystem {
					
					var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
681 682
					v_cse1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_CSE1));
					v_cse1.done;
683 684
						
					v_cse1.start(f_CSE_REG_CRE_005());
685
			  	  	v_cse1.done;
686 687 688 689
			  	  		
				}
					
				function f_CSE_REG_CRE_005() runs on CseSimu {
690
		  	  	
691 692
		  	  		var MsgIn v_request;
					var template RequestPrimitive v_requestPrimitive;
693 694
					
					//Test control
695
	                
696
					// Test component configuration
697
					f_cf02UpCseSimuMaster();
698
		  	  	
699
					//Preamble
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
700
					vc_remoteCseIndex := f_cse_registrationRemoteCse(mw_createRemoteCSE);
701 702
		
					//Test Body
703
					vc_ae1.start(f_cse_createResource(int2, m_createAe(PX_APP_ID, -, "S")));
704
					
705
					v_requestPrimitive := mw_createAEAnnc_s_ae_id(PX_CSE_ID & "/S", -, -, -);
706
					v_requestPrimitive.primitiveContent.aEAnnc.app_ID := PX_APP_ID;
707
	    									
708 709
					tc_ac.start;
					alt{
710
						[] mccPortIn.receive(mw_request(v_requestPrimitive)) -> value v_request {
711 712
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": AE creation redirected.");
713
							f_cse_sendResponse_cseSimu(v_request);
714
						}
715
						[] mccPortIn.receive(mw_request(mw_createAEAnnc())) -> value v_request {
716
							tc_ac.stop;
717
							setverdict(fail, __SCOPE__ & ": AE creation redirected but wrong parameters");
718
							f_cse_sendResponse_cseSimu(v_request);
719
						}
720
						[] mccPortIn.receive(mw_request(?))-> value v_request {
721 722
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Unexpected message received");
723
							f_cse_sendResponse_cseSimu(v_request);
724 725 726 727 728
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while creating AE");
						}
					}
729 730
					
					vc_ae1.done;
731
									
732
					// Postamble
733
					f_cse_postamble_deleteResourcesCSE();
734 735
					
					// Tear down
736
					f_cf02DownCseSimuMaster();
737 738
						
				}
739 740 741 742 743
				
				/**
				 * @desc Check that the IUT accepts a create request of <AE> resource with attributes multiplicity equals to 1 and provided character ‘S’ in AE_ID_Stem ask for a SP_relative_AE_ID 
				 * 
				 */
744 745 746
				testcase TC_CSE_REG_CRE_006() runs on Tester system CseSystem {
					
					var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
747 748
					v_cse1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_CSE1));
					v_cse1.done;
749 750 751 752 753 754 755 756
							
					v_cse1.start(f_CSE_REG_CRE_006());
				  	  	
					v_cse1.done;
				  	  		
				}
						
				function f_CSE_REG_CRE_006() runs on CseSimu {
757 758 759 760 761 762 763 764 765 766 767 768 769 770

					var RequestPrimitive v_request;
					var integer v_cseBaseIndex := -1;
					var ResourceType v_resourceType := int2;
	
					//Test control
					if(not(PICS_MN_CSE or PICS_ASN_CSE)) {
						setverdict(inconc, __SCOPE__ & ": IUT shall be MN-CSE or ASN-CSE to run this test case");
						stop;
					}
    
					// Test component configuration
					f_cf02UpCseSimuMaster();

771
					//Preamble
772 773 774
					vc_remoteCseIndex := f_cse_registrationRemoteCse(mw_createRemoteCSE);
					
					//Test Body
775
					vc_ae1.start(f_cse_sendCreateRequestPrimitive(int2, m_createAe(PX_APP_ID, omit, "S")));
776 777 778 779 780
					vc_ae1.done;
							
					tc_ac.start;

					alt {
781
						[] mccPortIn.receive(mw_request(mw_createAEAnnc_s_ae_id(PX_CSE_ID, f_getLocalResourceAddress(vc_cSEBaseIndex), -))) {
782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": AE creation redirected.");
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while creating AE");
						}
					}	
					
					// Postamble
					f_cse_postamble_deleteResourcesCSE();
	
					// Tear down
					f_cf02DownCseSimuMaster();
		
				}	// end of TC_CSE_REG_CRE_006
				
				/**
				 * @desc Check that the IUT accepts a create request of <AE> resource with attributes multiplicity equals to 1 and provided character ‘S’ in AE_ID_Stem ask for a SP_relative_AE_ID 
				 * 
				 */
802 803 804
				testcase TC_CSE_REG_CRE_007() runs on Tester system CseSystem {
					
					var AeSimu v_ae1 := AeSimu.create("AE1") alive;
805 806
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
807 808 809 810 811 812 813 814
						
					v_ae1.start(f_CSE_REG_CRE_007());
			  	  	
					v_ae1.done;
			  	  		
				}
					
				function f_CSE_REG_CRE_007() runs on AeSimu {
815 816 817 818 819 820 821 822 823 824 825 826 827 828

					var MsgIn v_response;
					var RequestPrimitive v_request;
					var integer v_aeIndex := -1;
					
					//Test control
					if(not(PICS_MN_CSE)) {
						setverdict(inconc, __SCOPE__ & ": IUT shall be MN-CSE to run this test case");
						stop;
					}
					
					// Test component configuration
					f_cf02Up();
					
829
					//Preamble
830 831
					vc_cse1.start(f_cse_registrationRemoteCse(mw_createRemoteCSE));
					vc_cse1.done;
832
			
833
					mcaPort.send(f_getMsgOutPrimitive(m_request(f_getCreateRequestPrimitive(int2, m_createAe(PX_APP_ID, omit, "S"),-1))));
834
					
835
					vc_cse1.start(f_cse_announcementProcedure_createHandler());
836 837 838 839 840 841
					vc_cse1.done;
					
					//Test Body
					tc_ac.start;
					
					alt {
842
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response {
843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866
							tc_ac.stop;
							//continue to test the content
							if (ischosen(v_response.primitive.responsePrimitive.primitiveContent.aE)){
								if (v_response.primitive.responsePrimitive.primitiveContent.aE.aE_ID == PX_APP_ID){
									setverdict(pass, __SCOPE__ & ": AE creation success.");
								}else{
									setverdict(fail, __SCOPE__ & ": Error in AE content.");
								}
							}else{
								setverdict(fail, __SCOPE__ & ": primitiveContent doesn't exist");
							}
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while creating AE");
						}
					}	
									
					// Postamble
					f_cse_postamble_deleteResources();
					
					// Tear down
					f_cf02Down();

				}	// end of TC_CSE_REG_CRE_007
867

868 869 870 871
				/**
				 * @desc Check that the IUT accepts an AE re-registration (allowed M2M-SP-assigned AE-ID, S-AE-ID-STEM provided by AE), transfer request to the IN-CSE 
				 * 
				 */
872 873 874
				testcase TC_CSE_REG_CRE_008() runs on Tester system CseSystem {
					
					var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
875 876
					v_cse1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_CSE1));
					v_cse1.done;
877 878 879 880 881 882 883 884
							
					v_cse1.start(f_CSE_REG_CRE_008());
				  	  	
					v_cse1.done;
				  	  		
				}
						
				function f_CSE_REG_CRE_008() runs on CseSimu {
885
		  	  	
886
					var RequestPrimitive v_request;
887 888
					var integer v_cseBaseIndex := -1;
					var ResourceType v_resourceType := int2;
889 890 891 892 893 894
					
					//Test control
					if(not(PICS_MN_CSE)) {
						setverdict(inconc, __SCOPE__ & ": IUT shall be MN-CSE to run this test case");
						stop;
					}
895
	                
896
					// Test component configuration
897
					f_cf02UpCseSimuMaster();
898
		  	  	
899
					//Preamble
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
900
					vc_remoteCseIndex := f_cse_registrationRemoteCse(mw_createRemoteCSE);
901
					vc_ae1.start(f_cse_createResource(int2, m_createAe(PX_APP_ID, omit, "S")));
902
					
903 904
					f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1);
								
905
					
906 907
					//TODO:
					//v_request := valueof(m_delete(f_getResourceAddress(v_aeIndex), f_getOriginator(v_aeIndex)));
908
					//mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
909
					
910
					//Test Body
911
					vc_ae1.start(f_cse_createResource(int2, m_createAe(PX_APP_ID, omit, "S")));
912
											
913
					tc_ac.start;
914
	
915
					alt {
916
						[] mccPortIn.receive(mw_request(mw_createAEAnnc_s_ae_id(f_getResourceAddress(-1,e_hierarchical, e_spRelative) & "/S", "CSE_ID", -))) {
917 918 919
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": AE creation redirected.");
						}
920
						[] mccPortIn.receive(mw_request(mw_createAEAnnc_s_ae_id(f_getResourceAddress(-1,e_hierarchical, e_absolute) & "/S", "CSE_ID", -))) {
921
							tc_ac.stop;
922
							setverdict(pass, __SCOPE__ & ": AE creation redirected.");
923
						}
924
						[] mccPortIn.receive {
925
							tc_ac.stop;
926
							setverdict(fail, __SCOPE__ & ": Error while creating AE");
927 928
						}
						[] tc_ac.timeout {
929
							setverdict(fail, __SCOPE__ & ": No answer while creating AE");
930 931
						}
					}	
932
									
933
					// Postamble
934
					f_cse_postamble_deleteResourcesCSE();
935 936
					
					// Tear down
937
					f_cf02DownCseSimuMaster();
938 939
						
				}
940 941 942 943 944
		  	  	
				/**
				 * @desc Check that the IUT accepts an AE re-registration (allowed M2M-SP-assigned AE-ID, S-AE-ID-STEM provided by AE), communication between MN-CSE and IN-CSE
				 *  
				 */
945 946 947
				testcase TC_CSE_REG_CRE_009() runs on Tester system CseSystem {
					
					var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
948 949
					v_cse1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_CSE1));
					v_cse1.done;
950 951 952 953 954 955 956 957
							
					v_cse1.start(f_CSE_REG_CRE_009());
				  	  	
					v_cse1.done;
				  	  		
				}
						
				function f_CSE_REG_CRE_009() runs on CseSimu {
958
		  	  	
959
					var MsgIn v_response;
960
					var RequestPrimitive v_request;
961 962
					var integer v_aeAnncIndex := -1;
					var ResourceType v_resourceType := int2;
963 964 965
					
					//Test control
					if(not(PICS_IN_CSE)) {
966
						setverdict(inconc, __SCOPE__ & ": IUT shall be IN-CSE to run this test case");
967 968
						stop;
					}
969
	                
970
					// Test component configuration
971
					f_cf04Up();
972
		  	  	
973
					//Preamble
974 975 976
					
					vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSEBase);
									
977
					//Create AEAnnc				
978
					v_aeAnncIndex := f_cse_announcementProcedure_announceResource(int2, m_createAEAnnc(-, PX_CSE1_ID & "/" & "S", PX_APP_ID, PX_CSE1_ID & "/" & "S"));
979 980 981 982 983 984
					
					//Update AEAnnc to simulate deregistration of AE
					v_request := f_getUpdateRequestPrimitive(f_getAnnouncedResourceType(int2),v_aeAnncIndex, valueof(m_updateAEAnncBase));//TODO 
					//v_request.primitiveContent.aEAnnc.link := "";//TODO To fix when base specs are fixed
					
					f_cse_updateAnnouncedResource(v_request);
985
					
986
					//Test Body
987
					v_request := valueof(m_updateAEAnncBase);			
988
	    									
989
					v_request := f_getUpdateRequestPrimitive(f_getAnnouncedResourceType(int2),v_aeAnncIndex, v_request);//TODO 
990
					v_request.primitiveContent.aEAnnc.labels := {"Credential-ID:None"};
991
		  	  		
992
					mccPort.send(f_getMsgOutPrimitive(m_request(v_request)));
993
					tc_ac.start;
994
	
995
					alt {
996
						[] mccPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response {
997
							tc_ac.stop;
998 999
							setverdict(pass, __SCOPE__ & ": AE creation redirected.");
							//continue to test the content
1000
						}
1001
						[] mccPort.receive {
1002
							tc_ac.stop;
1003
							setverdict(fail, __SCOPE__ & ": Error while creating AE");
1004 1005
						}
						[] tc_ac.timeout {
1006
							setverdict(fail, __SCOPE__ & ": No answer while creating AE");
1007 1008
						}
					}	
1009 1010 1011
									
					//v_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex);	
									
1012
					// Postamble
1013
					f_cse_postamble_deleteResourcesCSE();
1014 1015
					
					// Tear down
1016
					f_cf04Down();
1017
						
1018
				}
1019 1020


1021 1022 1023 1024
				/**
				 * @desc Check that the IUT accepts an AE re-registration (allowed M2M-SP-assigned AE-ID, S-AE-ID-STEM provided by AE), transfer response to the AE
				 * 
				 */
1025 1026 1027
				testcase TC_CSE_REG_CRE_010() runs on Tester system CseSystem {
					
					var AeSimu v_ae1 := AeSimu.create("AE1") alive;
1028 1029
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
1030 1031 1032 1033 1034 1035 1036 1037
						
					v_ae1.start(f_CSE_REG_CRE_010());
			  	  	
					v_ae1.done;
			  	  		
				}
					
				function f_CSE_REG_CRE_010() runs on AeSimu {
1038 1039
		  	  	
					var MsgIn v_response;
1040
					var RequestPrimitive v_request;
1041
					var integer v_aeIndex := -1;
1042 1043 1044 1045 1046 1047
					
					//Test control
					if(not(PICS_MN_CSE)) {
						setverdict(inconc, __SCOPE__ & ": IUT shall be MN-CSE to run this test case");
						stop;
					}
1048 1049 1050 1051
	                
					// Test component configuration
					f_cf02Up();
		  	  	
1052
					//Preamble
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
1053
					vc_cse1.start(f_cse_registrationRemoteCse(mw_createRemoteCSE));
1054
					vc_cse1.done;
1055
					
1056
					v_aeIndex := f_cse_createResource(int2, m_createAe(PX_APP_ID, omit, PX_ALLOWED_S_AE_IDS[0]));
1057
					
1058
					vc_cse1.start(f_cse_announcementProcedure_createHandler());
1059
					vc_cse1.done;
1060
					
1061
					//TODO Deregister
1062 1063
					//f_cse_deleteResource(v_aeIndex);
					v_request := valueof(m_delete(f_getResourceAddress(v_aeIndex), f_getOriginator(v_aeIndex)));
1064
					mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
1065
					
1066
					//Test Body
1067 1068
					f_cse_createResource(int2, m_createAe(PX_APP_ID, omit, f_getResourceId(vc_resourcesList[v_aeIndex].resource)));
					
1069
					vc_cse1.start(f_cse_announcementProcedure_createHandler(mw_createAEAnnc_s_ae_id(PX_CSE_ID, -, -, -)));
1070
					vc_cse1.done;
1071

1072 1073 1074
					tc_ac.start;
	
					alt {
1075
						[] mcaPortIn.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response {
1076 1077
							tc_ac.stop;
							//continue to test the content
1078 1079 1080 1081 1082 1083 1084 1085 1086
							if (ischosen(v_response.primitive.responsePrimitive.primitiveContent.aE)){
								if (v_response.primitive.responsePrimitive.primitiveContent.aE.app_ID == PX_APP_ID){
									setverdict(pass, __SCOPE__ & ": AE creation success.");
								}else{
									setverdict(fail, __SCOPE__ & ": Error in AE content.");
								}
							}else{
								setverdict(fail, __SCOPE__ & ": primitiveContent doesn't exist");
							}
1087
						}
1088
						[] mcaPortIn.receive {
1089 1090
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error while creating AE");
1091
						}
1092 1093
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while creating AE");
1094
						}
1095 1096 1097 1098
					}	
									
					// Postamble
					f_cse_postamble_deleteResources();
1099
					
1100 1101
					// Tear down
					f_cf02Down();
1102
						
1103
				}; //end TC_CSE_REG_CRE_010
1104

1105 1106 1107 1108
				/**
				 * @desc Check that the IUT accepts a create request of <AE> resource with attributes multiplicity equals to 1 and asking an CSE relative AE_ID by indicating AE_ID_Stem with character ‘C’.  
				 * 
				 */
1109 1110 1111
				testcase TC_CSE_REG_CRE_011() runs on Tester system CseSystem {
					
					var AeSimu v_ae1 := AeSimu.create("AE1") alive;
1112 1113
					v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
1114 1115 1116 1117 1118 1119 1120 1121
						
					v_ae1.start(f_CSE_REG_CRE_011());
			  	  	
					v_ae1.done;
			  	  		
				}
					
				function f_CSE_REG_CRE_011() runs on AeSimu {
1122 1123 1124 1125 1126

					var MsgIn v_response;
					var RequestPrimitive v_request;
					var integer v_cseBaseIndex := -1;
					var ResourceType v_resourceType := int2;
1127 1128
					
					//Test control
1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140
    
    
					// Test component configuration
					f_cf01Up();
    
					//Preamble

					//Test Body
					v_request := valueof(m_createAe(PX_APP_ID, omit, "C"));	
	
					v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, -1);
	
1141
					mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173
	
					tc_ac.start;
					alt {
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response {
							tc_ac.stop;
							f_checkAttributesToBeSaved(int2, v_request, v_response.primitive.responsePrimitive);
							vc_aeAuxIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int2);
							setverdict(pass, __SCOPE__ & ": AE successfully created.");
							
							if(v_response.primitive.responsePrimitive.primitiveContent.aE.resourceID[0] == "C"){
								setverdict(pass, __SCOPE__ & "Resource ID set correctly.");
							} else {
								setverdict(fail, __SCOPE__ & "Resource ID not set correctly.");
							}
							
							}
						[] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int2001))) -> value v_response{
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error while creating AE with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)));
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while creating AE");
						}
					}	
					
					// Postamble
					f_cse_postamble_deleteResources();
	
					// Tear down
					f_cf01Down();
		
				}
1174

1175 1176 1177 1178
				/**
				  * @desc Check that the IUT accepts an AE registration with the optional attribute OPTIONAL_ATTRIBUTE provided   
				  * 
				 */
1179
				group g_CSE_REG_CRE_012 {
1180
					
1181 1182
					testcase TC_CSE_REG_CRE_012_AE_LBL() runs on Tester system CseSystem {
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
1183
						var template RequestPrimitive v_create := m_createAe(PX_APP_ID, omit, PX_AE1_ID_STEM);
1184 1185
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
1186
						v_create.primitiveContent.aE.labels := {"labels"};
1187
						v_ae1.start(f_CSE_REG_CRE_012(v_create));
1188
						v_ae1.done;
1189 1190
					}
					
1191 1192
					testcase TC_CSE_REG_CRE_012_AE_APN() runs on Tester system CseSystem {
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
1193
						var template RequestPrimitive v_create := m_createAe(PX_APP_ID, omit, PX_AE1_ID_STEM);
1194 1195
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
1196 1197
						
						v_create.primitiveContent.aE.appName := "AeAppName";
1198
						v_ae1.start(f_CSE_REG_CRE_012(v_create));
1199
						v_ae1.done;
1200 1201
					}
					
1202 1203
					testcase TC_CSE_REG_CRE_012_AE_POA() runs on Tester system CseSystem {
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
1204
						var template RequestPrimitive v_create := m_createAe(PX_APP_ID, omit, PX_AE1_ID_STEM);
1205 1206
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
1207
						v_create.primitiveContent.aE.pointOfAccess := {PX_AE1_ADDRESS};
1208
						v_ae1.start(f_CSE_REG_CRE_012(v_create));
1209
						v_ae1.done;
1210 1211 1212
					}
					
				}
1213

1214
				group g_CSE_REG_CRE_013 {
1215 1216 1217 1218 1219
					
					/**
					 * @desc Check that the IUT accepts a create request of <remoteCSE> resource with OPTIONAL_ATTRIBUTE. 
					 * 
					 */
1220
					testcase TC_CSE_REG_CRE_013_LBL() runs on Tester system CseSystem {
1221
						// Local variables
1222
						var template RequestPrimitive v_createRequest := m_createRemoteCSEBase;	
1223
						const AttributeAux c_optionalAttribute := {"labels", omit};
1224
						var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
1225 1226
						v_cse1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_CSE1));
						v_cse1.done;
1227
                        						
1228
						v_createRequest.primitiveContent.remoteCSE.labels := {"MyLabel"};
1229
						
1230
						v_cse1.start(f_CSE_REG_CRE_013(v_createRequest, c_optionalAttribute));