OneM2M_Testcases_CSE_Release_1.ttcn 500 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
Fix #37  
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
					const  charstring v_cseId := PX_CSE_ID;
					template XSD.AnyURI v_link := pattern "{v_cseId}/S";
695 696
					
					//Test control
697
	                
698
					// Test component configuration
699
					f_cf02UpCseSimuMaster(int1);
700
		  	  	
701
					//Preamble
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
702
					vc_remoteCseIndex := f_cse_registrationRemoteCse(mw_createRemoteCSE);
703 704
		
					//Test Body
705
					vc_ae1.start(f_cse_createResource(int2, m_createAe(PX_APP_ID, -, "S")));
706
					
707
					v_requestPrimitive := mw_createAEAnnc_s_ae_id(PX_CSE_ID & "/S", -, -, v_link);
708
					v_requestPrimitive.primitiveContent.aEAnnc.app_ID := PX_APP_ID;
709
	    									
710 711
					tc_ac.start;
					alt{
712
						[] mccPortIn.receive(mw_request(v_requestPrimitive)) -> value v_request {
713 714
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": AE creation redirected.");
715
							f_cse_sendResponse_cseSimu(v_request);
716
						}
717
						[] mccPortIn.receive(mw_request(mw_createAEAnnc())) -> value v_request {
718
							tc_ac.stop;
719
							setverdict(fail, __SCOPE__ & ": AE creation redirected but wrong parameters");
720
							f_cse_sendResponse_cseSimu(v_request);
721
						}
722 723 724 725
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while creating AE");
						}
					}
726 727
					
					vc_ae1.done;
728
									
729
					// Postamble
730
					f_cse_postamble_deleteResourcesCSE();
731 732
					
					// Tear down
733
					f_cf02DownCseSimuMaster();
734 735
						
				}
736 737 738 739 740
				
				/**
				 * @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 
				 * 
				 */
741 742 743
				testcase TC_CSE_REG_CRE_006() runs on Tester system CseSystem {
					
					var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
744 745
					v_cse1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_CSE1));
					v_cse1.done;
746 747 748 749 750 751 752 753
							
					v_cse1.start(f_CSE_REG_CRE_006());
				  	  	
					v_cse1.done;
				  	  		
				}
						
				function f_CSE_REG_CRE_006() runs on CseSimu {
754

755 756
					var MsgIn v_request;
					var template RequestPrimitive v_requestPrimitive;
757
					var integer v_cseBaseIndex := -1;
758 759
					const  charstring v_cseId := PX_CSE_ID;
					template XSD.AnyURI v_link := pattern "{v_cseId}/?*";
760 761 762 763 764 765 766 767
	
					//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
768
					f_cf02UpCseSimuMaster(int1