OneM2M_Testcases_CSE_Release_1.ttcn 477 KB
Newer Older
1 2 3 4 5 6 7
/**
 *  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.
 *  
8
 *  @author     oneM2M/ETSI
9 10 11
 *  @desc       Module containing test cases for oneM2M
 *
 */
12
module OneM2M_Testcases_CSE_Release_1 {
13 14 15 16 17 18

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

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

108
					testcase TC_CSE_GEN_CRE_001_SPR() runs on Tester system CseSystem {
109 110
						// Local variables
						
111 112 113 114
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;

						v_ae1.start(f_CSE_GEN_CRE_001(e_spRelative));
						v_ae1.done;
115
					}
116
					
117
					testcase TC_CSE_GEN_CRE_001_ABS() runs on Tester system CseSystem {
118
						// Local variables
119 120 121 122
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
                        
						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 137 138 139
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
                        
						v_ae1.start(f_CSE_GEN_CRE_002(e_cseRelative));
						v_ae1.done;
140
					}
141

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

180
					testcase TC_CSE_GEN_RET_001_SPR() runs on Tester system CseSystem {
181 182
						// Local variables
						
183 184 185 186
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
                        
						v_ae1.start(f_CSE_GEN_RET_001(e_spRelative));
						v_ae1.done;
187
					}
188
					
189
					testcase TC_CSE_GEN_RET_001_ABS() runs on Tester system CseSystem {
190
						// Local variables
191 192 193 194
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
                        
						v_ae1.start(f_CSE_GEN_RET_001(e_absolute));
						v_ae1.done;
195 196
					}
								
197
				
198 199 200 201 202 203 204 205
				} // 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
					 * 
					 */
206
					testcase TC_CSE_GEN_RET_002_CSR() runs on Tester system CseSystem {
207
						// Local variables
208 209 210 211
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
                        
						v_ae1.start(f_CSE_GEN_RET_002(e_cseRelative));
						v_ae1.done;
212
					}
213

214
					testcase TC_CSE_GEN_RET_002_SPR() runs on Tester system CseSystem {
215 216
						// Local variables
						
217 218 219 220
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
                        
						v_ae1.start(f_CSE_GEN_RET_002(e_spRelative));
						v_ae1.done;
221
					}
222
					
223
					testcase TC_CSE_GEN_RET_002_ABS() runs on Tester system CseSystem {
224 225
						// Local variables
							
226 227 228 229
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
                        
						v_ae1.start(f_CSE_GEN_RET_002(e_absolute));
						v_ae1.done;
230 231
					}
								
232 233 234
				} // end of group g_CSE_GEN_RET_002
				
			} // end of group Retrieve
235
			
236 237
			group Update {
				group g_CSE_GEN_UPD_001 {
238

239 240 241 242
					/**
					 * @desc Check that the IUT accepts the update of a <container>  resource using unstructured resource identifier
					 * 
					 */
243
					testcase TC_CSE_GEN_UPD_001_CSR() runs on Tester system CseSystem {
244
						// Local variables
245 246 247 248
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
                        
						v_ae1.start(f_CSE_GEN_UPD_001(e_cseRelative));
						v_ae1.done;
249
					}
250

251
					testcase TC_CSE_GEN_UPD_001_SPR() runs on Tester system CseSystem {
252
						// Local variables
253 254 255 256
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
                        
						v_ae1.start(f_CSE_GEN_UPD_001(e_spRelative));
						v_ae1.done;
257
					}
258
					
259
					testcase TC_CSE_GEN_UPD_001_ABS() runs on Tester system CseSystem {
260 261
						// Local variables
							
262 263 264 265
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
                        
						v_ae1.start(f_CSE_GEN_UPD_001(e_absolute));
						v_ae1.done;
266 267
					}
								
268 269 270 271 272 273 274 275
				} // 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
					 * 
					 */
276
					testcase TC_CSE_GEN_UPD_002_CSR() runs on Tester system CseSystem {
277 278
						// Local variables
						                        
279 280 281 282
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
                        
						v_ae1.start(f_CSE_GEN_UPD_002(e_cseRelative));
						v_ae1.done;
283 284
					}

285
					testcase TC_CSE_GEN_UPD_002_SPR() runs on Tester system CseSystem {
286 287
						// Local variables
						
288
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
289
						
290 291
						v_ae1.start(f_CSE_GEN_UPD_002(e_spRelative));
						v_ae1.done;
292
					}
293
					
294
					testcase TC_CSE_GEN_UPD_002_ABS() runs on Tester system CseSystem {
295
						// Local variables
296
							
297 298 299 300
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
                        
						v_ae1.start(f_CSE_GEN_UPD_002(e_absolute));
						v_ae1.done;
301
					}
302 303 304 305
								
				} // end of group g_CSE_GEN_UPD_002
				
			} // end of group Update
306
			
307 308
			group Delete {
				group g_CSE_GEN_DEL_001 {
309

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

323
					testcase TC_CSE_GEN_DEL_001_SPR() runs on Tester system CseSystem {
324 325
						// Local variables
						
326 327 328 329
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
                        
						v_ae1.start(f_CSE_GEN_DEL_001(e_spRelative));
						v_ae1.done;
330
					}
331
					
332
					testcase TC_CSE_GEN_DEL_001_ABS() runs on Tester system CseSystem {
333 334
						// Local variables
							
335 336 337 338
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
                        
						v_ae1.start(f_CSE_GEN_DEL_001(e_absolute));
						v_ae1.done;
339 340 341 342 343 344 345 346 347 348
					}
								
				} // 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
					 * 
					 */
349
					testcase TC_CSE_GEN_DEL_002_CSR() runs on Tester system CseSystem {
350 351
						// Local variables
						                        
352 353 354 355
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
                        
						v_ae1.start(f_CSE_GEN_DEL_002(e_cseRelative));
						v_ae1.done;
356 357
					}

358
					testcase TC_CSE_GEN_DEL_002_SPR() runs on Tester system CseSystem {
359
						// Local variables
360
						
361 362 363 364
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
                        
						v_ae1.start(f_CSE_GEN_DEL_002(e_spRelative));
						v_ae1.done;
365
					}
366
					
367
					testcase TC_CSE_GEN_DEL_002_ABS() runs on Tester system CseSystem {
368 369
						// Local variables
							
370 371 372 373
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
                        
						v_ae1.start(f_CSE_GEN_DEL_002(e_absolute));
						v_ae1.done;
374 375 376 377 378 379
					}
								
				} // end of group g_CSE_GEN_DEL_002
				
			} // end of group Delete
		
380
		} // end of group General_Capability
381 382 383 384 385 386
		
		group Registration {
			
			group Create{
				
				/**
387
				 * @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.  
388 389
				 * 
				 */
390
				group g_CSE_REG_CRE_001 {
391
					
392
					testcase TC_CSE_REG_CRE_001_CAE() runs on Tester system CseSystem {
393
					
394 395 396 397 398 399
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
						
						v_ae1.start(f_CSE_REG_CRE_001(PX_ALLOWED_C_AE_IDS[0]));
			  	  		v_ae1.done;
			  	  		
					}
400
					
401 402 403 404 405 406 407 408
					testcase TC_CSE_REG_CRE_001_SAE() runs on Tester system CseSystem {
						
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
						
						v_ae1.start(f_CSE_REG_CRE_001(PX_ALLOWED_S_AE_IDS[0]));
			  	  		v_ae1.done;
			  	  		
					}
409
					
410
				}//end group g_CSE_REG_CRE_001 
411

412
				/**
413
				 * @desc Check that the IUT accepts a create request of <AE> resource with attributes multiplicity equals to 1 and provided preprovisioned AE_ID_STEM of AE-ID-Stem format.
414 415
				 * 
				 */
416 417 418
				group g_CSE_REG_CRE_002 {

					testcase TC_CSE_REG_CRE_002_CAE() runs on Tester system CseSystem {
419
						
420 421 422 423 424 425
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
							
						v_ae1.start(f_CSE_REG_CRE_002(PX_ALLOWED_C_AE_IDS[0]));
				  	  	v_ae1.done;
				  	  		
					}
426
						
427 428 429 430 431 432 433 434 435 436
					testcase TC_CSE_REG_CRE_002_SAE() runs on Tester system CseSystem {
						
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
							
						v_ae1.start(f_CSE_REG_CRE_002(PX_ALLOWED_S_AE_IDS[0]));
				  	  	v_ae1.done;
				  	  		
					}

				}//end group g_CSE_REG_CRE_002 
437 438

				/**
439
				 * @desc Check that the IUT accepts a create request of <AE> resource with attributes multiplicity equals to 1 and provided preprovisioned S-AE-ID-STEM. 
440 441
				 */
				
442 443 444 445 446
				testcase TC_CSE_REG_CRE_003() runs on Tester system CseSystem {
					
					var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
						
					v_cse1.start(f_CSE_REG_CRE_003());
447
			  	  	v_cse1.done;
448 449 450
			  	  		
				}
					
451
				function f_CSE_REG_CRE_003() runs on CseSimu system CseSystem {
452
					
453 454 455
					//Local variables
					var MsgIn v_request;
					var template RequestPrimitive v_requestPrimitive;
456
					
457
					//Test control
458
					
459 460 461
					// Test component configuration
					f_cf02UpCseSimuMaster(int1);
		  	  	
462
					//Preamble
463 464 465
					vc_remoteCseIndex := f_cse_registrationRemoteCse(mw_createRemoteCSE);
		
					//Test Body
466
					vc_ae1.start(f_cse_createResource(int2, m_createAe(PX_TS_AE1.appId, -, PX_ALLOWED_S_AE_IDS[0])));
467
					
468
					v_requestPrimitive := mw_createAEAnnc_s_ae_id(PX_CSE_ID & "/" & PX_ALLOWED_S_AE_IDS[0], -, -, PX_CSE_ID & "/" & PX_ALLOWED_S_AE_IDS[0]);
469 470 471 472 473
											
					tc_ac.start;
					alt{
						[] mccPortIn.receive(mw_request(v_requestPrimitive)) -> value v_request {
							tc_ac.stop;
474
							setverdict(pass, __SCOPE__ & ": AEAnnc creation received.");
475 476 477 478
							f_cse_sendResponse_cseSimu(v_request);
						}
						[] mccPortIn.receive(mw_request(mw_createAEAnnc())) -> value v_request {
							tc_ac.stop;
479 480 481 482 483 484
							setverdict(fail, __SCOPE__ & ": AEAnnc creation received but wrong parameters");
							f_cse_sendResponse_cseSimu(v_request);
						}
						[] mccPortIn.receive(mw_request(?)) -> value v_request {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": Other operation received");
485 486 487 488 489 490 491 492 493 494 495 496 497 498 499
							f_cse_sendResponse_cseSimu(v_request);
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while creating AE");
						}
					}
					
					f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1);
									
					// Postamble
					f_cse_postamble_deleteResourcesCSE();
					
					// Tear down
					f_cf02DownCseSimuMaster();
						
500
				}
501 502 503 504 505
		  	  	
				/**
				 * @desc Check that the IUT rejects an AE registration (allowed App-ID, not allowed C-AE-ID-STEM provided by AE) 
				 * 
				 */
506 507
				testcase TC_CSE_REG_CRE_004() runs on Tester system CseSystem {
					
508
					var AeSimu v_ae1 := AeSimu.create("AE1") alive;
509 510 511 512 513 514 515
						
					v_ae1.start(f_CSE_REG_CRE_004());
			  	  	
					v_ae1.done;
			  	  		
				}
					
516
				function f_CSE_REG_CRE_004() runs on AeSimu system CseSystem {
517
		  	  	
518
					var MsgIn v_response;
519
					var RequestPrimitive v_request;
520 521
					var integer v_cseBaseIndex := -1;
					var ResourceType v_resourceType := int2;
522
					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];
523 524
					
					//Test control
525
	                
526
					// Test component configuration
527
					f_cf01Up();
528
		  	  	
529
					//Preamble
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
530
					//vc_remoteCseIndex := f_cse_registrationRemoteCse(mw_createRemoteCSE);
531
					//TODO: create serviceSubscribedProfile, Node, and serviceSubscribedAppRule
532
					//v_cseBaseIndex := f_cse_preamble_createServiceSubscribedProfile({"C*"}); //c_CRUDNDi);
533
					action(v_action);
534
					f_sleepIgnoreDef(PX_TCONFIG_IUT);
535
					
536
					//Test Body	
537
					//v_request := valueof(m_createAe(PX_APP_ID, omit, "C-AE-ID-STEM"));				
538
	    											
539
					v_request := f_getCreateRequestPrimitive(int2, m_createAe(PX_TS_AE1.appId, omit, PX_NOT_ALLOWED_C_AE_IDS[0]), -1);
540
			
541
					f_send(e_mca_port, m_request(v_request));
542 543
					tc_ac.start;
					alt {
544
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int4107))) {
545
							tc_ac.stop;
546
							setverdict(pass, __SCOPE__ & ": AE creation rejected.");
547
						}
548
						[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response{
549
							tc_ac.stop;
550
							setverdict(fail, __SCOPE__ & ": Error while creating AE with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)));
551
						}
552 553 554 555 556 557
						[] 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);
						}
558
						[] tc_ac.timeout {
559
							setverdict(fail, __SCOPE__ & ": No answer while creating AE");
560
						}
561
					}
562
									
563
					// Postamble
564
					f_cse_postamble_deleteResources();
565
						
566
					// Tear down
567
					f_cf01Down();
568 569
						
				}
570 571 572 573 574
		  	  	
				/**
				 * @desc Check that the IUT accepts an AE registration (allowed App-ID, S-AE-ID-STEM not provided by AE) 
				 * 
				 */
575 576 577 578 579
				testcase TC_CSE_REG_CRE_005() runs on Tester system CseSystem {
					
					var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
						
					v_cse1.start(f_CSE_REG_CRE_005());
580
			  	  	v_cse1.done;
581 582 583
			  	  		
				}
					
584
				function f_CSE_REG_CRE_005() runs on CseSimu system CseSystem {
585
		  	  	
586
		  	  		//Local variables
587 588
		  	  		var MsgIn v_request;
					var template RequestPrimitive v_requestPrimitive;
589 590
					const  charstring v_cseId := PX_CSE_ID;
					template XSD.AnyURI v_link := pattern "{v_cseId}/S";
591 592
					
					//Test control
593
	                
594
					// Test component configuration
595
					f_cf02UpCseSimuMaster(int1);
596
		  	  	
597
					//Preamble
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
598
					vc_remoteCseIndex := f_cse_registrationRemoteCse(mw_createRemoteCSE);
599 600
		
					//Test Body
601
					vc_ae1.start(f_cse_createResource(int2, m_createAe(PX_TS_AE1.appId, -, "S")));
602
					
603
					v_requestPrimitive := mw_createAEAnnc_s_ae_id(PX_CSE_ID & "/S", -, -, v_link);
604
					v_requestPrimitive.primitiveContent.aEAnnc.app_ID := PX_TS_AE1.appId;
605
	    									
606 607
					tc_ac.start;
					alt{
608
						[] mccPortIn.receive(mw_request(v_requestPrimitive)) -> value v_request {
609 610
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": AE creation redirected.");
611
							f_cse_sendResponse_cseSimu(v_request);
612
						}
613
						[] mccPortIn.receive(mw_request(mw_createAEAnnc())) -> value v_request {
614
							tc_ac.stop;
615
							setverdict(fail, __SCOPE__ & ": AE creation redirected but wrong parameters");
616
							f_cse_sendResponse_cseSimu(v_request);
617
						}
618 619 620 621
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while creating AE");
						}
					}
622 623
					
					vc_ae1.done;
624
									
625
					// Postamble
626
					f_cse_postamble_deleteResourcesCSE();
627 628
					
					// Tear down
629
					f_cf02DownCseSimuMaster();
630 631
						
				}
632 633 634 635 636
				
				/**
				 * @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 
				 * 
				 */
637 638 639 640 641 642 643 644 645 646
				testcase TC_CSE_REG_CRE_006() runs on Tester system CseSystem {
					
					var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
							
					v_cse1.start(f_CSE_REG_CRE_006());
				  	  	
					v_cse1.done;
				  	  		
				}
						
647
				function f_CSE_REG_CRE_006() runs on CseSimu system CseSystem {
648

649 650
					var MsgIn v_request;
					var template RequestPrimitive v_requestPrimitive;
651
					var integer v_cseBaseIndex := -1;
652 653
					const  charstring v_cseId := PX_CSE_ID;
					template XSD.AnyURI v_link := pattern "{v_cseId}/?*";
654 655 656 657 658 659 660 661
	
					//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
662
					f_cf02UpCseSimuMaster(int1);
663

664
					//Preamble
665 666 667
					vc_remoteCseIndex := f_cse_registrationRemoteCse(mw_createRemoteCSE);
					
					//Test Body
668
					vc_ae1.start(f_cse_createResource(int2, m_createAe(PX_TS_AE1.appId, -, "S")));
669 670 671
					
					v_requestPrimitive := mw_createAEAnnc_s_ae_id(PX_CSE_ID & "/S", -, -, v_link);
					
672 673 674
					tc_ac.start;

					alt {
675
						[] mccPortIn.receive(mw_request(v_requestPrimitive)) -> value v_request {
676 677
							tc_ac.stop;
							setverdict(pass, __SCOPE__ & ": AE creation redirected.");
678 679 680 681 682 683
							f_cse_sendResponse_cseSimu(v_request);
						}
						[] mccPortIn.receive(mw_request(mw_createAEAnnc())) -> value v_request {
							tc_ac.stop;
							setverdict(fail, __SCOPE__ & ": AE creation redirected but wrong parameters");
							f_cse_sendResponse_cseSimu(v_request);
684 685 686 687 688 689
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while creating AE");
						}
					}	
					
690 691
					vc_ae1.done;
					
692 693 694 695 696 697 698 699 700 701 702 703
					// 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 
				 * 
				 */
704 705 706 707 708 709 710 711 712 713
				testcase TC_CSE_REG_CRE_007() runs on Tester system CseSystem {
					
					var AeSimu v_ae1 := AeSimu.create("AE1") alive;
						
					v_ae1.start(f_CSE_REG_CRE_007());
			  	  	
					v_ae1.done;
			  	  		
				}
					
714
				function f_CSE_REG_CRE_007() runs on AeSimu system CseSystem {
715 716

					var MsgIn v_response;
717
					var template RequestPrimitive v_requestPrimitive;
718
					var integer v_aeIndex := -1;
719 720 721
					var integer v_aeAnncIndex := -1;
					const  charstring v_cseId := PX_CSE_ID;
					template XSD.AnyURI v_link := pattern "{v_cseId}/?*";
722 723 724 725 726 727 728 729
					
					//Test control
					if(not(PICS_MN_CSE)) {
						setverdict(inconc, __SCOPE__ & ": IUT shall be MN-CSE to run this test case");
						stop;
					}
					
					// Test component configuration
730
					f_cf02Up(int1);
731
					
732
					//Preamble
733 734
					vc_cse1.start(f_cse_registrationRemoteCse(mw_createRemoteCSE));
					vc_cse1.done;
735
			
736
					v_requestPrimitive := mw_createAEAnnc_s_ae_id(PX_CSE_ID & "/S", -, -, v_link);
737
					
738 739
					vc_cse1.start(f_cse_announcementProcedure_createHandler(v_requestPrimitive));
					
740
					f_send(e_mca_port, m_request(f_getCreateRequestPrimitive(int2, m_createAe(PX_TS_AE1.appId, omit, "S"),-1)));
741 742 743 744
					
					//Test Body
					tc_ac.start;
					alt {
745
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response {
746
							tc_ac.stop;
747
							
748 749 750 751 752
						}
						[] tc_ac.timeout {
							setverdict(fail, __SCOPE__ & ": No answer while creating AE");
						}
					}	
753 754 755 756 757 758 759 760 761 762 763 764 765 766
					
					vc_cse1.done;
					
					v_aeAnncIndex := f_getLatestLocalResource(vc_cse1);
					//continue to test the content
				 	if (ischosen(v_response.primitive.responsePrimitive.primitiveContent.aE)){
						if (v_response.primitive.responsePrimitive.primitiveContent.aE.aE_ID == vc_resourcesList[v_aeAnncIndex].resource.aEAnnc.aE_ID){
							setverdict(pass, __SCOPE__ & ": AE-ID correctly set to AE-ID provided by IN-CSE");
						}else{
							setverdict(fail, __SCOPE__ & ": AE-ID not set correctly");
						}
				  	}else{
						setverdict(fail, __SCOPE__ & ": primitiveContent doesn't exist");
				  	}	
767 768 769 770 771 772 773
					// Postamble
					f_cse_postamble_deleteResources();
					
					// Tear down
					f_cf02Down();

				}	// end of TC_CSE_REG_CRE_007
774

775 776 777 778
				/**
				 * @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 
				 * 
				 */
779 780 781 782 783 784 785 786 787 788
				testcase TC_CSE_REG_CRE_008() runs on Tester system CseSystem {
					
					var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
							
					v_cse1.start(f_CSE_REG_CRE_008());
				  	  	
					v_cse1.done;
				  	  		
				}
						
789
				function f_CSE_REG_CRE_008() runs on CseSimu system CseSystem {
790
		  	  	
791
					var RequestPrimitive v_request;
792
					var template RequestPrimitive v_updateAeAnnc := mw_updateAEAnnc;
793
					var integer v_cseBaseIndex := -1;
794 795 796
					var integer v_aeIndex := -1;
					var integer v_aeIndex_ae1 := -1;
					var integer v_aeAnncIndex := -1;
797
					var ResourceType v_resourceType := int2;
798 799 800 801 802 803
					
					//Test control
					if(not(PICS_MN_CSE)) {
						setverdict(inconc, __SCOPE__ & ": IUT shall be MN-CSE to run this test case");
						stop;
					}
804
	                
805
					// Test component configuration
806
					f_cf02UpCseSimuMaster(int1);
807
		  	  	
808
					//Preamble
Antonio Castillo Verdugo's avatar
Antonio Castillo Verdugo committed
809
					vc_remoteCseIndex := f_cse_registrationRemoteCse(mw_createRemoteCSE);
810
					
811
					vc_ae1.start(f_cse_createResource(int2, m_createAe(PX_TS_AE1.appId, omit, "S")));
812
					
813 814
					v_aeAnncIndex := f_cse_announcementProcedure_createHandler(-, -, -);
					
815
					f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1);
816
					
817 818 819 820 821 822
					v_aeIndex_ae1 := f_getLatestResourceIndex(vc_ae1);
					
					v_aeIndex := f_getLatestResource(vc_ae1);
					
					vc_ae1.start(f_cse_deleteResource(v_aeIndex_ae1));
					
823 824
					v_updateAeAnnc.primitiveContent.aEAnnc.link := "INACTIVE";
					f_cse_announcementProcedure_updateHandler(v_updateAeAnnc, -, v_aeAnncIndex);
825 826
					
					f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1);
827
					
828
					//Test Body
829
					vc_ae1.start(f_cse_createResource(int2, m_createAe(PX_TS_AE1.appId, omit, vc_resourcesList[v_aeIndex].resource.aE.aE_ID)));
830
											
831
					tc_ac.start;
832
	
833
					alt {
834
						[] mccPortIn.receive(mw_request(mw_updateAEAnnc)) -> value vc_request {
835
							tc_ac.stop;
836 837
							setverdict(pass, __SCOPE__ & ": AE Announced UPDATE received");
							f_processUpdateRequestPrimitive(vc_request.primitive.requestPrimitive);
838
							f_send(e_mcc_in_port, m_response(vc_response.primitive.responsePrimitive));
839
						}
840
						[] mccPortIn.receive(mw_request(mw_update)) {
841
							tc_ac.stop;
842
							setverdict(fail, __SCOPE__ & ": Wrong UPDATE request received ");