OneM2M_Testcases.ttcn 798 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
14
15
16
17
18
19
20
 *  @desc       Module containing test cases for oneM2M
 *
 */
module OneM2M_Testcases {

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

99
					testcase TC_CSE_GEN_CRE_001_SPR() 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_spRelative));
						v_ae1.done;
106
					}
107
					
108
					testcase TC_CSE_GEN_CRE_001_ABS() runs on Tester system CseSystem {
109
						// Local variables
110
111
112
113
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
                        
						v_ae1.start(f_CSE_GEN_CRE_001(e_absolute));
						v_ae1.done;
114
115
					}
								
116
					function f_CSE_GEN_CRE_001(in PrimitiveScope p_primitiveScope) runs on AeSimu {
117
118
119
120
121
    				
						// Local variables
						var RequestPrimitive v_request;
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
122
123
						var AddressingMethod v_addressingMethod;
						var PrimitiveScope v_primitiveScope;
124
125
126
127
128
129
130
131
132
133
134
135
136
137
											   
						// Test control
						if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
							setverdict(inconc, __SCOPE__ & ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case");
							stop;
						}
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
138
					
139
140
141
142
						v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 
					
						// Test Body
						//Force usage of Non-Hierarchical addressing method
143
144
						v_addressingMethod := e_nonHierarchical;
						v_primitiveScope := p_primitiveScope;
145
						v_request := f_getCreateRequestPrimitive(int3, m_createContainerBase, v_resourceIndex);
146
						v_request.to_ := f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope);
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
						
						mcaPort.send(m_request(v_request));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Container resource created using non-hierarchical addressing method");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while creating container resource using non-hierarchical addressing method");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while creating resource");
							}
						}	
    								
						// Postamble
						f_cse_postamble_deleteResources();
					
						// Tear down
						f_cf01Down();
    				
					}//end f_CSE_GEN_CRE_001				
175
				
176
177
178
179
				
				} // end of group g_CSE_GEN_CRE_001
				
				group g_CSE_GEN_CRE_002 {
180

181
182
183
184
					/**
					 * @desc Check that the IUT accepts the creation of a  resource using structured resource identifier
					 * 
					 */
185
					testcase TC_CSE_GEN_CRE_002_CSR() runs on Tester system CseSystem {
186
187
						// Local variables
						                        
188
189
190
191
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
                        
						v_ae1.start(f_CSE_GEN_CRE_002(e_cseRelative));
						v_ae1.done;
192
					}
193

194
					testcase TC_CSE_GEN_CRE_002_SPR() runs on Tester system CseSystem {
195
196
						// Local variables
						
197
198
199
200
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
                        
						v_ae1.start(f_CSE_GEN_CRE_002(e_spRelative));
						v_ae1.done;
201
					}
202
					
203
					testcase TC_CSE_GEN_CRE_002_ABS() runs on Tester system CseSystem {
204
205
						// Local variables
							
206
207
208
209
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
                        
						v_ae1.start(f_CSE_GEN_CRE_002(e_absolute));
						v_ae1.done;
210
211
					}
								
212
					function f_CSE_GEN_CRE_002(in PrimitiveScope p_primitiveScope) runs on AeSimu {
213
214
215
216
217
    				
						// Local variables
						var RequestPrimitive v_request;
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
218
219
						var AddressingMethod v_addressingMethod;
						var PrimitiveScope v_primitiveScope;
220
221
222
223
224
225
226
227
228
229
230
231
232
233
											   
						// Test control
						if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
							setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case");
							stop;
						}
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
234
					
235
236
237
238
						v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 
					
						// Test Body
						//Force usage of Non-Hierarchical addressing method
239
240
						v_addressingMethod := e_hierarchical;
						v_primitiveScope := p_primitiveScope;
241
						v_request := f_getCreateRequestPrimitive(int3, m_createContainerBase, v_resourceIndex);
242
243
						v_request.to_ := f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope);
												
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
						mcaPort.send(m_request(v_request));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Container resource created using hierarchical addressing method");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while creating container resource using hierarchical addressing method");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while creating resource");
							}
						}	
    								
						// Postamble
						f_cse_postamble_deleteResources();
					
						// Tear down
						f_cf01Down();
    				
					}//end f_CSE_GEN_CRE_002				
271
272
				
				
273
				} // end of group g_CSE_GEN_CRE_002
274
				
275
276
277
278
279
280
281
282
283
			} // 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
					 * 
					 */
284
					testcase TC_CSE_GEN_RET_001_CSR() runs on Tester system CseSystem {
285
286
						// Local variables
						                        
287
288
289
290
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
                        
						v_ae1.start(f_CSE_GEN_RET_001(e_cseRelative));
						v_ae1.done;
291
					}
292

293
					testcase TC_CSE_GEN_RET_001_SPR() runs on Tester system CseSystem {
294
295
						// Local variables
						
296
297
298
299
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
                        
						v_ae1.start(f_CSE_GEN_RET_001(e_spRelative));
						v_ae1.done;
300
					}
301
					
302
					testcase TC_CSE_GEN_RET_001_ABS() runs on Tester system CseSystem {
303
						// Local variables
304
305
306
307
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
                        
						v_ae1.start(f_CSE_GEN_RET_001(e_absolute));
						v_ae1.done;
308
309
					}
								
310
					function f_CSE_GEN_RET_001(in PrimitiveScope p_primitiveScope) runs on AeSimu {
311
312
313
314
    				
						// Local variables
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
315
316
						var AddressingMethod v_addressingMethod;
						var PrimitiveScope v_primitiveScope;
317
318
319
320
321
322
323
324
325
326
327
328
329
330
											   
						// Test control
						if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
							setverdict(inconc, __SCOPE__ & ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case");
							stop;
						}
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
331
					
332
						v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 
333
					
334
335
						// Test Body
						//Force usage of Non-Hierarchical addressing method
336
337
						v_addressingMethod := e_nonHierarchical;
						v_primitiveScope := p_primitiveScope;
338
						
339
						mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope), f_getOriginator(v_resourceIndex))));
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Container resource retrieved using non-hierarchical addressing method");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while retrieving container resource using non-hierarchical addressing method");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
							}
						}	
    								
						// Postamble
						f_cse_postamble_deleteResources();
361
					
362
363
						// Tear down
						f_cf01Down();
364
    				
365
					}//end f_CSE_GEN_RET_001				
366
367
				
				
368
369
370
371
372
373
374
375
				} // 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
					 * 
					 */
376
					testcase TC_CSE_GEN_RET_002_CSR() runs on Tester system CseSystem {
377
						// Local variables
378
379
380
381
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
                        
						v_ae1.start(f_CSE_GEN_RET_002(e_cseRelative));
						v_ae1.done;
382
					}
383

384
					testcase TC_CSE_GEN_RET_002_SPR() runs on Tester system CseSystem {
385
386
						// Local variables
						
387
388
389
390
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
                        
						v_ae1.start(f_CSE_GEN_RET_002(e_spRelative));
						v_ae1.done;
391
					}
392
					
393
					testcase TC_CSE_GEN_RET_002_ABS() runs on Tester system CseSystem {
394
395
						// Local variables
							
396
397
398
399
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
                        
						v_ae1.start(f_CSE_GEN_RET_002(e_absolute));
						v_ae1.done;
400
401
					}
								
402
					function f_CSE_GEN_RET_002(in PrimitiveScope p_primitiveScope) runs on AeSimu {
403
404
405
406
    				
						// Local variables
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
407
408
						var AddressingMethod v_addressingMethod;
						var PrimitiveScope v_primitiveScope;
409
410
411
412
413
414
415
416
417
418
419
420
421
422
											   
						// Test control
						if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
							setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case");
							stop;
						}
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
423
					
424
425
426
427
						v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 
					
						// Test Body
						//Force usage of Non-Hierarchical addressing method
428
429
						v_addressingMethod := e_hierarchical;
						v_primitiveScope := p_primitiveScope;
430
						
431
						mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope), f_getOriginator(v_resourceIndex))));tc_ac.start;
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Container resource retrieved using hierarchical addressing method");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while retrieving container resource using hierarchical addressing method");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
							}
						}	
    								
						// Postamble
						f_cse_postamble_deleteResources();
					
						// Tear down
						f_cf01Down();
    				
					}//end f_CSE_GEN_RET_002				
				
				} // end of group g_CSE_GEN_RET_002
				
			} // end of group Retrieve
461
			
462
463
			group Update {
				group g_CSE_GEN_UPD_001 {
464

465
466
467
468
					/**
					 * @desc Check that the IUT accepts the update of a <container>  resource using unstructured resource identifier
					 * 
					 */
469
					testcase TC_CSE_GEN_UPD_001_CSR() runs on Tester system CseSystem {
470
						// Local variables
471
472
473
474
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
                        
						v_ae1.start(f_CSE_GEN_UPD_001(e_cseRelative));
						v_ae1.done;
475
					}
476

477
					testcase TC_CSE_GEN_UPD_001_SPR() runs on Tester system CseSystem {
478
						// Local variables
479
480
481
482
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
                        
						v_ae1.start(f_CSE_GEN_UPD_001(e_spRelative));
						v_ae1.done;
483
					}
484
					
485
					testcase TC_CSE_GEN_UPD_001_ABS() runs on Tester system CseSystem {
486
487
						// Local variables
							
488
489
490
491
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
                        
						v_ae1.start(f_CSE_GEN_UPD_001(e_absolute));
						v_ae1.done;
492
493
					}
								
494
					function f_CSE_GEN_UPD_001(in PrimitiveScope p_primitiveScope) runs on AeSimu {
495
496
497
498
499
    				
						// Local variables
						var RequestPrimitive v_updateRequest := valueof(m_updateContainerBase);
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
500
501
						var AddressingMethod v_addressingMethod;
						var PrimitiveScope v_primitiveScope;
502
503
504
505
506
507
508
509
510
511
512
513
514
515
											   
						// Test control
						if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
							setverdict(inconc, __SCOPE__ & ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case");
							stop;
						}
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
516
					
517
						v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 
518
					
519
520
						// Test Body
						//Force usage of Non-Hierarchical addressing method
521
522
						v_addressingMethod := e_nonHierarchical;
						v_primitiveScope := p_primitiveScope;
523
						
524
525
526
						v_updateRequest.primitiveContent.container.labels := {"MyLabel"};
						
						v_updateRequest := f_getUpdateRequestPrimitive(int3, v_resourceIndex, v_updateRequest);
527
						v_updateRequest.to_ := f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope);
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
						
						mcaPort.send(m_request(v_updateRequest));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Container resource updated using non-hierarchical addressing method");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while updating container resource using non-hierarchical addressing method");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while updating resource");
							}
						}	
    								
						// Postamble
						f_cse_postamble_deleteResources();
551
					
552
553
554
555
						// Tear down
						f_cf01Down();
    				
					}//end f_CSE_GEN_UPD_001				
556
				
557
558
559
560
561
562
563
564
				} // 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
					 * 
					 */
565
					testcase TC_CSE_GEN_UPD_002_CSR() runs on Tester system CseSystem {
566
567
						// Local variables
						                        
568
569
570
571
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
                        
						v_ae1.start(f_CSE_GEN_UPD_002(e_cseRelative));
						v_ae1.done;
572
573
					}

574
					testcase TC_CSE_GEN_UPD_002_SPR() runs on Tester system CseSystem {
575
576
						// Local variables
						
577
578
579
580
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
                        
						v_ae1.start(f_CSE_GEN_UPD_002(e_spRelative));
						v_ae1.done;
581
					}
582
					
583
					testcase TC_CSE_GEN_UPD_002_ABS() runs on Tester system CseSystem {
584
						// Local variables
585
							
586
587
588
589
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
                        
						v_ae1.start(f_CSE_GEN_UPD_002(e_absolute));
						v_ae1.done;
590
					}
591
								
592
					function f_CSE_GEN_UPD_002(in PrimitiveScope p_primitiveScope) runs on AeSimu {
593
    				
594
595
596
597
						// Local variables
						var RequestPrimitive v_updateRequest := valueof(m_updateContainerBase);
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
598
599
						var AddressingMethod v_addressingMethod;
						var PrimitiveScope v_primitiveScope;
600
601
602
603
604
605
											   
						// Test control
						if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
							setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case");
							stop;
						}
606
    				
607
608
						// Test component configuration
						f_cf01Up();
609
    				
610
						// Test adapter configuration
611
    				
612
613
614
615
616
617
618
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
					
						v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 
					
						// Test Body
						//Force usage of Non-Hierarchical addressing method
619
620
						v_addressingMethod := e_hierarchical;
						v_primitiveScope := p_primitiveScope;
621
622
623
624
						
						v_updateRequest.primitiveContent.container.labels := {"MyLabel"};
						
						v_updateRequest := f_getUpdateRequestPrimitive(int3, v_resourceIndex, v_updateRequest);
625
						v_updateRequest.to_ := f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope);
626
627
628
629
630
631
632
						
						mcaPort.send(m_request(v_updateRequest));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Container resource updated using hierarchical addressing method");
633
							}
634
635
636
637
638
639
640
641
642
643
644
645
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while updating container resource using hierarchical addressing method");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while updating resource");
							}
						}	
646
    								
647
648
						// Postamble
						f_cse_postamble_deleteResources();
649
					
650
651
						// Tear down
						f_cf01Down();
652
    				
653
654
655
656
657
658
					}//end f_CSE_GEN_UPD_002				
				
				
				} // end of group g_CSE_GEN_UPD_002
				
			} // end of group Update
659
			
660
661
			group Delete {
				group g_CSE_GEN_DEL_001 {
662

663
664
665
666
					/**
					 * @desc Check that the IUT accepts the deletion of a <container>  resource using unstructured resource identifier
					 *  
					 */
667
					testcase TC_CSE_GEN_DEL_001_CSR() runs on Tester system CseSystem {
668
669
						// Local variables
						                        
670
671
672
673
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
                        
						v_ae1.start(f_CSE_GEN_DEL_001(e_cseRelative));
						v_ae1.done;
674
675
					}

676
					testcase TC_CSE_GEN_DEL_001_SPR() runs on Tester system CseSystem {
677
678
						// Local variables
						
679
680
681
682
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
                        
						v_ae1.start(f_CSE_GEN_DEL_001(e_spRelative));
						v_ae1.done;
683
					}
684
					
685
					testcase TC_CSE_GEN_DEL_001_ABS() runs on Tester system CseSystem {
686
687
						// Local variables
							
688
689
690
691
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
                        
						v_ae1.start(f_CSE_GEN_DEL_001(e_absolute));
						v_ae1.done;
692
693
					}
								
694
					function f_CSE_GEN_DEL_001(in PrimitiveScope p_primitiveScope) runs on AeSimu {
695
696
697
698
699
    				
						// Local variables
						var RequestPrimitive v_request;
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
700
701
						var AddressingMethod v_addressingMethod;
						var PrimitiveScope v_primitiveScope;
702
703
704
705
706
707
708
709
710
711
712
713
714
715
											   
						// Test control
						if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
							setverdict(inconc, __SCOPE__ & ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case");
							stop;
						}
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
716
					
717
						v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 
718
					
719
720
						// Test Body
						//Force usage of Non-Hierarchical addressing method
721
722
						v_addressingMethod := e_nonHierarchical;
						v_primitiveScope := p_primitiveScope;
723
						
724
						v_request := valueof(m_delete(f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope), f_getOriginator(v_resourceIndex)));
725
												
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
						mcaPort.send(m_request(v_request));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Container resource deleted using non-hierarchical addressing method");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while deleting container resource using non-hierarchical addressing method");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while deleting resource");
							}
						}	
    								
						// Postamble
						f_cse_postamble_deleteResources();
748
					
749
750
751
752
753
754
755
756
757
758
759
760
761
762
						// Tear down
						f_cf01Down();
    				
					}//end f_CSE_GEN_DEL_001				
				
				
				} // 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
					 * 
					 */
763
					testcase TC_CSE_GEN_DEL_002_CSR() runs on Tester system CseSystem {
764
765
						// Local variables
						                        
766
767
768
769
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
                        
						v_ae1.start(f_CSE_GEN_DEL_002(e_cseRelative));
						v_ae1.done;
770
771
					}

772
					testcase TC_CSE_GEN_DEL_002_SPR() runs on Tester system CseSystem {
773
						// Local variables
774
						
775
776
777
778
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
                        
						v_ae1.start(f_CSE_GEN_DEL_002(e_spRelative));
						v_ae1.done;
779
					}
780
					
781
					testcase TC_CSE_GEN_DEL_002_ABS() runs on Tester system CseSystem {
782
783
						// Local variables
							
784
785
786
787
						var AeSimu v_ae1 := AeSimu.create("AE1") alive;
                        
						v_ae1.start(f_CSE_GEN_DEL_002(e_absolute));
						v_ae1.done;
788
789
					}
								
790
					function f_CSE_GEN_DEL_002(in PrimitiveScope p_primitiveScope) runs on AeSimu {
791
792
793
794
795
    				
						// Local variables
						var RequestPrimitive v_request;
						var integer v_aeIndex := -1;
						var integer v_resourceIndex := -1;
796
797
						var AddressingMethod v_addressingMethod;
						var PrimitiveScope v_primitiveScope;
798
799
800
801
802
803
804
805
806
807
808
809
810
811
											   
						// Test control
						if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
							setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case");
							stop;
						}
    				
						// Test component configuration
						f_cf01Up();
    				
						// Test adapter configuration
    				
						// Preamble
						v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
812
					
813
						v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); 
814
					
815
816
						// Test Body
						//Force usage of Non-Hierarchical addressing method
817
818
						v_addressingMethod := e_hierarchical;
						v_primitiveScope := p_primitiveScope;
819
						
820
						v_request := valueof(m_delete(f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope), f_getOriginator(v_resourceIndex)));
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
						
						mcaPort.send(m_request(v_request));
						tc_ac.start;
						alt {
							[] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) {
								tc_ac.stop;
								setverdict(pass, __SCOPE__ & ": Container resource deleted using hierarchical addressing method");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
							}
							[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
								tc_ac.stop;
								setverdict(fail, __SCOPE__ & ": Error while deleting container resource using hierarchical addressing method");
							}
							[] tc_ac.timeout {
								setverdict(fail, __SCOPE__ & ": No answer while deleting resource");
							}
						}	
    								
						// Postamble
						f_cse_postamble_deleteResources();
844
					
845
846
						// Tear down
						f_cf01Down();
847
    				
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
					}//end f_CSE_GEN_DEL_002				
				
				
				} // end of group g_CSE_GEN_DEL_002
				
			} // end of group Delete
		
		} // end of group Generic
		
		group Registration {
			
			group Create{
				
				/**
				 * @desc Check that the IUT accepts an AE registration (allowed App-ID, C-AE-ID-STEM not provided by AE)  
				 * 
				 */
865
				testcase TC_CSE_REG_CRE_001() runs on AeSimu system CseSystem {
866
		  	  	
867
					var MsgIn v_response;
868
					var RequestPrimitive v_request;
869
870
871
					var integer v_cseBaseIndex := -1;
					var ResourceType v_resourceType := int2;
	                
872
873
					// Test component configuration
					f_cf01Up();
874
875
	                
					//Preamble
876
					v_cseBaseIndex := f_cse_preamble_createServiceSubscribedProfile({"S*"}); //c_CRUDNDi);
877
878
879
880
					
					//Test Body
					v_request := valueof(m_createAe(PX_APP_ID, omit, omit));	
					
881
					v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, -1);
882
					
883
					mcaPort.send(m_request(v_request));
884
					
885
886
					tc_ac.start;
					alt {
887
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) {
888
							tc_ac.stop;
889
							setverdict(pass, __SCOPE__ & ": AE successfully created.");
890
						}
891
						[] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int2001))) -> value v_response{
892
							tc_ac.stop;
893
							setverdict(fail, __SCOPE__ & ": Error while creating AE with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)));
894
895
						}
						[] tc_ac.timeout {
896
							setverdict(fail, __SCOPE__ & ": No answer while creating AE");
897
898
						}
					}	
899
									
900
					// Postamble
901
902
903
904
					f_cse_postamble_deleteResources();
					
					// Tear down
					f_cf01Down();
905
906
						
				}
907
908
909
910
911
		  	  	
				/**
				 * @desc Check that the IUT sends a registration CREATE Request with the value of the attribute ATTRIBUTE_NAME  of the AE resource
				 * 
				 */
912
				testcase TC_CSE_REG_CRE_002() runs on AeSimu system CseSystem {
913
		  	  	
914
					var MsgIn v_response;
915
					var RequestPrimitive v_request;
916
917
918
					var integer v_cseBaseIndex := -1;
					var ResourceType v_resourceType := int2;
	                
919
920
					// Test component configuration
					f_cf01Up();
921
922
		  	  	
					//Preambule
923
					
924
925
926
					//Test Body
					v_request := valueof(m_createAe(PX_APP_ID, omit, "C-AE-ID-STEM"));				
	    									
927
					v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, -1);
928
	
929
930
931
					mcaPort.send(m_request(v_request));
					tc_ac.start;
					alt {
932
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) {
933
							tc_ac.stop;
934
							setverdict(pass, __SCOPE__ & ": AE successfully created.");
935
						}
936
						[] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int2001))) -> value v_response{
937
							tc_ac.stop;
938
							setverdict(fail, __SCOPE__ & ": Error while creating AE with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)));
939
940
						}
						[] tc_ac.timeout {
941
							setverdict(fail, __SCOPE__ & ": No answer while creating AE");
942
943
						}
					}	
944
									
945
					// Postamble
946
947
948
949
					f_cse_postamble_deleteResources();
					
					// Tear down
					f_cf01Down();
950
951
						
				}
952
953
954
955
956
		  	  	
				/**
				 * @desc Check that the IUT rejects an AE registration (allowed App-ID, not allowed C-AE-ID-STEM provided by AE) 
				 * 
				 */
957
				testcase TC_CSE_REG_CRE_004() runs on AeSimu system CseSystem {
958
		  	  	
959
					var MsgIn v_response;
960
					var RequestPrimitive v_request;
961
962
963
					var integer v_cseBaseIndex := -1;
					var ResourceType v_resourceType := int2;
	                
964
					// Test component configuration
965
					f_cf01Up();
966
967
		  	  	
					//Preambule
968
969
					//vc_remoteCseIndex := f_cse_registrationRemoteCse(mw_createRemoteCSEBase);
					//TODO: create serviceSubscribedProfile, Node, and serviceSubscribedAppRule
970
					v_cseBaseIndex := f_cse_preamble_createServiceSubscribedProfile({"C*"}); //c_CRUDNDi);
971
					
972
					//Test Body	
973
					//v_request := valueof(m_createAe(PX_APP_ID, omit, "C-AE-ID-STEM"));				
974
	    											
975
					f_cse_createResource(int2, m_createAe(PX_APP_ID, omit, "C"));
976
			
977
978
					tc_ac.start;
					alt {
979
						[] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) {
980
							tc_ac.stop;
981
							setverdict(pass, __SCOPE__ & ": AE creation rejected.");
982
						}
983
						[] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4005))) -> value v_response{
984
							tc_ac.stop;
985
							setverdict(fail, __SCOPE__ & ": Error while creating AE with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)));
986
987
						}
						[] tc_ac.timeout {
988
							setverdict(fail, __SCOPE__ & ": No answer while creating AE");
989
						}
990
					}
991
									
992
					// Postamble
993
					f_cse_postamble_deleteResources();
994
						
995
					// Tear down
996
					f_cf01Down();
997
998
						
				}
999
1000
		  	  	
				/**
For faster browsing, not all history is shown. View entire blame