OneM2M_Testcases_CSE_Release_1.ttcn 503 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
			testcase TC_DELETE_RESOURCES() runs on AeSimu system CseSystem {
34 35 36
				
				timer t_ac := 5.0;
				var integer i; 
37 38
				var XSD.ID v_resourceAddress;
				var RequestPrimitive v_request;
39 40 41
				map(self:mcaPort, system:mcaPort); 
					
				for (i:=0; i<lengthof(PX_RESOURCES_TO_BE_DELETED); i:= i+1) {  
42 43 44
					
					v_resourceAddress := f_getResourceAddress() & "/" & PX_RESOURCES_TO_BE_DELETED[i]; 
						
45 46
					v_request := valueof(m_delete(v_resourceAddress, PX_SUPER_AE_ID));
					    
47
					mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
48
					
49 50
					t_ac.start;
					alt {
51
						[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
52
							t_ac.stop;
53
							log(__SCOPE__ & ":Resource deleted");
54
							//setverdict(pass);
55
						}
56
						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
57
							t_ac.stop;
58
							log(__SCOPE__ & ":Error while deleting resource");
59
							//setverdict(fail);
60 61 62
						}
						[] mcaPort.receive {
							t_ac.stop;
63
							log(__SCOPE__ & ":Unexpected message received");
64
							//setverdict(inconc);
65 66
						}
						[] t_ac.timeout {
67
							log(__SCOPE__ & ":No answer while deleting resource");
68
							//setverdict(inconc);
69 70 71 72 73 74 75 76
						}	
					}	
				}
			
				unmap(self:mcaPort, system:mcaPort); 
				stop;
			}	
		
77
		}//end group helpingTestCases
78 79 80 81 82
	
	}//end group oneM2M_demos
	
	group CSE {
		
83 84 85 86 87 88 89 90 91
		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
					 * 
					 */
92
					testcase TC_CSE_GEN_CRE_001_CSR() runs on Tester system CseSystem {
93 94
						// Local variables
						                        
95
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
96 97 98
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
						v_ae1.done;
99 100 101
                        
						v_ae1.start(f_CSE_GEN_CRE_001(e_cseRelative));
						v_ae1.done;
102
					}
103

104
					testcase TC_CSE_GEN_CRE_001_SPR() runs on Tester system CseSystem {
105 106
						// Local variables
						
107
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
108 109
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
110 111 112

						v_ae1.start(f_CSE_GEN_CRE_001(e_spRelative));
						v_ae1.done;
113
					}
114
					
115
					testcase TC_CSE_GEN_CRE_001_ABS() runs on Tester system CseSystem {
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_absolute));
						v_ae1.done;
123
					}				
124 125 126 127
				
				} // end of group g_CSE_GEN_CRE_001
				
				group g_CSE_GEN_CRE_002 {
128

129 130 131 132
					/**
					 * @desc Check that the IUT accepts the creation of a  resource using structured resource identifier
					 * 
					 */
133
					testcase TC_CSE_GEN_CRE_002_CSR() runs on Tester system CseSystem {
134 135
						// Local variables
						                        
136
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
137 138
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
139 140 141
                        
						v_ae1.start(f_CSE_GEN_CRE_002(e_cseRelative));
						v_ae1.done;
142
					}
143

144
					testcase TC_CSE_GEN_CRE_002_SPR() runs on Tester system CseSystem {
145 146
						// Local variables
						
147
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
148 149
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
150 151 152
                        
						v_ae1.start(f_CSE_GEN_CRE_002(e_spRelative));
						v_ae1.done;
153
					}
154
					
155
					testcase TC_CSE_GEN_CRE_002_ABS() runs on Tester system CseSystem {
156 157
						// Local variables
							
158
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
159 160
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
161 162 163
                        
						v_ae1.start(f_CSE_GEN_CRE_002(e_absolute));
						v_ae1.done;
164
					}
165
				
166
				} // end of group g_CSE_GEN_CRE_002
167
				
168 169 170 171 172 173 174 175 176
			} // 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
					 * 
					 */
177
					testcase TC_CSE_GEN_RET_001_CSR() runs on Tester system CseSystem {
178 179
						// Local variables
						                        
180
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
181 182
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
183 184 185
                        
						v_ae1.start(f_CSE_GEN_RET_001(e_cseRelative));
						v_ae1.done;
186
					}
187

188
					testcase TC_CSE_GEN_RET_001_SPR() runs on Tester system CseSystem {
189 190
						// Local variables
						
191
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
192 193
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
194 195 196
                        
						v_ae1.start(f_CSE_GEN_RET_001(e_spRelative));
						v_ae1.done;
197
					}
198
					
199
					testcase TC_CSE_GEN_RET_001_ABS() runs on Tester system CseSystem {
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_absolute));
						v_ae1.done;
207 208
					}
								
209
				
210 211 212 213 214 215 216 217
				} // 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
					 * 
					 */
218
					testcase TC_CSE_GEN_RET_002_CSR() runs on Tester system CseSystem {
219
						// Local variables
220
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
221 222
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
223 224 225
                        
						v_ae1.start(f_CSE_GEN_RET_002(e_cseRelative));
						v_ae1.done;
226
					}
227

228
					testcase TC_CSE_GEN_RET_002_SPR() runs on Tester system CseSystem {
229 230
						// Local variables
						
231
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
232 233
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
234 235 236
                        
						v_ae1.start(f_CSE_GEN_RET_002(e_spRelative));
						v_ae1.done;
237
					}
238
					
239
					testcase TC_CSE_GEN_RET_002_ABS() runs on Tester system CseSystem {
240 241
						// Local variables
							
242
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
243 244
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
245 246 247
                        
						v_ae1.start(f_CSE_GEN_RET_002(e_absolute));
						v_ae1.done;
248 249
					}
								
250 251 252
				} // end of group g_CSE_GEN_RET_002
				
			} // end of group Retrieve
253
			
254 255
			group Update {
				group g_CSE_GEN_UPD_001 {
256

257 258 259 260
					/**
					 * @desc Check that the IUT accepts the update of a <container>  resource using unstructured resource identifier
					 * 
					 */
261
					testcase TC_CSE_GEN_UPD_001_CSR() runs on Tester system CseSystem {
262
						// Local variables
263
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
264 265
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
266 267 268
                        
						v_ae1.start(f_CSE_GEN_UPD_001(e_cseRelative));
						v_ae1.done;
269
					}
270

271
					testcase TC_CSE_GEN_UPD_001_SPR() 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_spRelative));
						v_ae1.done;
279
					}
280
					
281
					testcase TC_CSE_GEN_UPD_001_ABS() runs on Tester system CseSystem {
282 283
						// Local variables
							
284
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
285 286
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
287 288 289
                        
						v_ae1.start(f_CSE_GEN_UPD_001(e_absolute));
						v_ae1.done;
290 291
					}
								
292 293 294 295 296 297 298 299
				} // 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
					 * 
					 */
300
					testcase TC_CSE_GEN_UPD_002_CSR() runs on Tester system CseSystem {
301 302
						// Local variables
						                        
303
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
304 305
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
306 307 308
                        
						v_ae1.start(f_CSE_GEN_UPD_002(e_cseRelative));
						v_ae1.done;
309 310
					}

311
					testcase TC_CSE_GEN_UPD_002_SPR() runs on Tester system CseSystem {
312 313
						// Local variables
						
314
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
315 316
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
317 318 319
                        
						v_ae1.start(f_CSE_GEN_UPD_002(e_spRelative));
						v_ae1.done;
320
					}
321
					
322
					testcase TC_CSE_GEN_UPD_002_ABS() runs on Tester system CseSystem {
323
						// Local variables
324
							
325
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
326 327
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
328 329 330
                        
						v_ae1.start(f_CSE_GEN_UPD_002(e_absolute));
						v_ae1.done;
331
					}
332 333 334 335
								
				} // end of group g_CSE_GEN_UPD_002
				
			} // end of group Update
336
			
337 338
			group Delete {
				group g_CSE_GEN_DEL_001 {
339

340 341 342 343
					/**
					 * @desc Check that the IUT accepts the deletion of a <container>  resource using unstructured resource identifier
					 *  
					 */
344
					testcase TC_CSE_GEN_DEL_001_CSR() runs on Tester system CseSystem {
345 346
						// Local variables
						                        
347
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
348 349
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
350 351 352
                        
						v_ae1.start(f_CSE_GEN_DEL_001(e_cseRelative));
						v_ae1.done;
353 354
					}

355
					testcase TC_CSE_GEN_DEL_001_SPR() runs on Tester system CseSystem {
356 357
						// Local variables
						
358
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
359 360
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
361 362 363
                        
						v_ae1.start(f_CSE_GEN_DEL_001(e_spRelative));
						v_ae1.done;
364
					}
365
					
366
					testcase TC_CSE_GEN_DEL_001_ABS() runs on Tester system CseSystem {
367 368
						// Local variables
							
369
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
370 371
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
372 373 374
                        
						v_ae1.start(f_CSE_GEN_DEL_001(e_absolute));
						v_ae1.done;
375 376 377 378 379 380 381 382 383 384
					}
								
				} // 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
					 * 
					 */
385
					testcase TC_CSE_GEN_DEL_002_CSR() runs on Tester system CseSystem {
386 387
						// Local variables
						                        
388
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
389 390
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
391 392 393
                        
						v_ae1.start(f_CSE_GEN_DEL_002(e_cseRelative));
						v_ae1.done;
394 395
					}

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

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

					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();

767
					//Preamble
768 769 770
					vc_remoteCseIndex := f_cse_registrationRemoteCse(mw_createRemoteCSE);
					
					//Test Body
771
					vc_ae1.start(f_cse_sendCreateRequestPrimitive(int2, m_createAe(PX_APP_ID, omit, "S")));
772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797
					vc_ae1.done;
							
					tc_ac.start;

					alt {
						[] mccPortIn.receive(mw_request(mw_createAEAnnc(PX_CSE_ID, f_getLocalResourceAddress(vc_cSEBaseIndex), -, "S"))) {
							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 
				 * 
				 */
798 799 800
				testcase TC_CSE_REG_CRE_007() runs on Tester system CseSystem {
					
					var AeSimu v_ae1 := AeSimu.create("AE1") alive;
801 802
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
803 804 805 806 807 808 809 810
						
					v_ae1.start(f_CSE_REG_CRE_007());
			  	  	
					v_ae1.done;
			  	  		
				}
					
				function f_CSE_REG_CRE_007() runs on AeSimu {
811 812 813 814 815 816 817 818 819 820 821 822 823 824

					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();
					
825
					//Preamble
826 827
					vc_cse1.start(f_cse_registrationRemoteCse(mw_createRemoteCSE));
					vc_cse1.done;
828
			
829
					mcaPort.send(f_getMsgOutPrimitive(m_request(f_getCreateRequestPrimitive(int2, m_createAe(PX_APP_ID, omit, "S"),-1))));
830
					
831
					vc_cse1.start(f_cse_announcementProcedure_createHandler());
832 833 834 835 836 837
					vc_cse1.done;
					
					//Test Body
					tc_ac.start;
					
					alt {
838
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response {
839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862
							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
863

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


1017 1018 1019 1020
				/**
				 * @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
				 * 
				 */
1021 1022 1023
				testcase TC_CSE_REG_CRE_010() runs on Tester system CseSystem {
					
					var AeSimu v_ae1 := AeSimu.create("AE1") alive;
1024 1025
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
1026 1027 1028 1029 1030 1031 1032 1033
						
					v_ae1.start(f_CSE_REG_CRE_010());
			  	  	
					v_ae1.done;
			  	  		
				}
					
				function f_CSE_REG_CRE_010() runs on AeSimu {
1034 1035
		  	  	
					var MsgIn v_response;
1036
					var RequestPrimitive v_request;
1037
					var integer v_aeIndex := -1;
1038 1039 1040 1041 1042 1043
					
					//Test control
					if(not(PICS_MN_CSE)) {
						setverdict(inconc, __SCOPE__ & ": IUT shall be MN-CSE to run this test case");
						stop;
					}
1044 1045 1046 1047
	                
					// Test component configuration
					f_cf02Up();
		  	  	
1048
					//Preamble
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
1049
					vc_cse1.start(f_cse_registrationRemoteCse(mw_createRemoteCSE));
1050
					vc_cse1.done;
1051
					
1052
					v_aeIndex := f_cse_createResource(int2, m_createAe(PX_APP_ID, omit, PX_ALLOWED_S_AE_IDS[0]));
1053
					
1054
					vc_cse1.start(f_cse_announcementProcedure_createHandler());
1055
					vc_cse1.done;
1056
					
1057
					//TODO Deregister
1058 1059
					//f_cse_deleteResource(v_aeIndex);
					v_request := valueof(m_delete(f_getResourceAddress(v_aeIndex), f_getOriginator(v_aeIndex)));
1060
					mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
1061
					
1062
					//Test Body
1063 1064
					f_cse_createResource(int2, m_createAe(PX_APP_ID, omit, f_getResourceId(vc_resourcesList[v_aeIndex].resource)));
					
1065
					vc_cse1.start(f_cse_announcementProcedure_createHandler(mw_createAEAnnc(PX_CSE_ID, -, -, -)));
1066
					vc_cse1.done;
1067
					
1068 1069 1070
					tc_ac.start;
	
					alt {
1071
						[] mcaPortIn.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response {
1072 1073
							tc_ac.stop;
							//continue to test the content
1074 1075 1076 1077 1078 1079 1080 1081 1082
							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");
							}
1083
						}
1084
						[] mcaPortIn.receive {
1085 1086
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Error while creating AE");
1087
						}
1088 1089
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while creating AE");
1090
						}
1091 1092 1093 1094
					}	
									
					// Postamble
					f_cse_postamble_deleteResources();
1095
					
1096 1097
					// Tear down
					f_cf02Down();
1098
						
1099
				}; //end TC_CSE_REG_CRE_010
1100

1101 1102 1103 1104
				/**
				 * @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’.  
				 * 
				 */
1105 1106 1107
				testcase TC_CSE_REG_CRE_011() runs on Tester system CseSystem {
					
					var AeSimu v_ae1 := AeSimu.create("AE1") alive;
1108 1109
					v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
1110 1111 1112 1113 1114 1115 1116 1117
						
					v_ae1.start(f_CSE_REG_CRE_011());
			  	  	
					v_ae1.done;
			  	  		
				}
					
				function f_CSE_REG_CRE_011() runs on AeSimu {
1118 1119 1120 1121 1122

					var MsgIn v_response;
					var RequestPrimitive v_request;
					var integer v_cseBaseIndex := -1;
					var ResourceType v_resourceType := int2;
1123 1124
					
					//Test control
1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136
    
    
					// 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);
	
1137
					mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
1138 1139 1140 1141 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
	
					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();
		
				}
1170

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

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