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
			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
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
98 99 100
                        
						v_ae1.start(f_CSE_GEN_CRE_001(e_cseRelative));
						v_ae1.done;
101
					}
102

103
					testcase TC_CSE_GEN_CRE_001_SPR() 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_spRelative));
						v_ae1.done;
112
					}
113
					
114
					testcase TC_CSE_GEN_CRE_001_ABS() runs on Tester system CseSystem {
115
						// Local variables
116
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
117 118
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
119 120 121
                        
						v_ae1.start(f_CSE_GEN_CRE_001(e_absolute));
						v_ae1.done;
122
					}				
123 124 125 126
				
				} // end of group g_CSE_GEN_CRE_001
				
				group g_CSE_GEN_CRE_002 {
127

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

143
					testcase TC_CSE_GEN_CRE_002_SPR() 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_spRelative));
						v_ae1.done;
152
					}
153
					
154
					testcase TC_CSE_GEN_CRE_002_ABS() 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_absolute));
						v_ae1.done;
163
					}
164
				
165
				} // end of group g_CSE_GEN_CRE_002
166
				
167 168 169 170 171 172 173 174 175
			} // 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
					 * 
					 */
176
					testcase TC_CSE_GEN_RET_001_CSR() runs on Tester system CseSystem {
177 178
						// Local variables
						                        
179
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
180 181
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
182 183 184
                        
						v_ae1.start(f_CSE_GEN_RET_001(e_cseRelative));
						v_ae1.done;
185
					}
186

187
					testcase TC_CSE_GEN_RET_001_SPR() 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_spRelative));
						v_ae1.done;
196
					}
197
					
198
					testcase TC_CSE_GEN_RET_001_ABS() runs on Tester system CseSystem {
199
						// Local variables
200
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
201 202
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
203 204 205
                        
						v_ae1.start(f_CSE_GEN_RET_001(e_absolute));
						v_ae1.done;
206 207
					}
								
208
				
209 210 211 212 213 214 215 216
				} // 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
					 * 
					 */
217
					testcase TC_CSE_GEN_RET_002_CSR() runs on Tester system CseSystem {
218
						// Local variables
219
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
220 221
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
222 223 224
                        
						v_ae1.start(f_CSE_GEN_RET_002(e_cseRelative));
						v_ae1.done;
225
					}
226

227
					testcase TC_CSE_GEN_RET_002_SPR() runs on Tester system CseSystem {
228 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_spRelative));
						v_ae1.done;
236
					}
237
					
238
					testcase TC_CSE_GEN_RET_002_ABS() 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_absolute));
						v_ae1.done;
247 248
					}
								
249 250 251
				} // end of group g_CSE_GEN_RET_002
				
			} // end of group Retrieve
252
			
253 254
			group Update {
				group g_CSE_GEN_UPD_001 {
255

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

270
					testcase TC_CSE_GEN_UPD_001_SPR() runs on Tester system CseSystem {
271
						// Local variables
272
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
273 274
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
275 276 277
                        
						v_ae1.start(f_CSE_GEN_UPD_001(e_spRelative));
						v_ae1.done;
278
					}
279
					
280
					testcase TC_CSE_GEN_UPD_001_ABS() runs on Tester system CseSystem {
281 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_absolute));
						v_ae1.done;
289 290
					}
								
291 292 293 294 295 296 297 298
				} // 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
					 * 
					 */
299
					testcase TC_CSE_GEN_UPD_002_CSR() runs on Tester system CseSystem {
300 301
						// Local variables
						                        
302
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
303 304
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
305 306 307
                        
						v_ae1.start(f_CSE_GEN_UPD_002(e_cseRelative));
						v_ae1.done;
308 309
					}

310
					testcase TC_CSE_GEN_UPD_002_SPR() 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_spRelative));
						v_ae1.done;
319
					}
320
					
321
					testcase TC_CSE_GEN_UPD_002_ABS() runs on Tester system CseSystem {
322
						// Local variables
323
							
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_absolute));
						v_ae1.done;
330
					}
331 332 333 334
								
				} // end of group g_CSE_GEN_UPD_002
				
			} // end of group Update
335
			
336 337
			group Delete {
				group g_CSE_GEN_DEL_001 {
338

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

354
					testcase TC_CSE_GEN_DEL_001_SPR() 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_spRelative));
						v_ae1.done;
363
					}
364
					
365
					testcase TC_CSE_GEN_DEL_001_ABS() 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_absolute));
						v_ae1.done;
374 375 376 377 378 379 380 381 382 383
					}
								
				} // 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
					 * 
					 */
384
					testcase TC_CSE_GEN_DEL_002_CSR() runs on Tester system CseSystem {
385 386
						// Local variables
						                        
387
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
388 389
						v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
						v_ae1.done;
390 391 392
                        
						v_ae1.start(f_CSE_GEN_DEL_002(e_cseRelative));
						v_ae1.done;
393 394
					}

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

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

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

768
					//Preamble
769 770 771
					vc_remoteCseIndex := f_cse_registrationRemoteCse(mw_createRemoteCSE);
					
					//Test Body
Antonio Castillo Verdugo's avatar