AtsMec_FixedAccessInfoAPI_TestCases.ttcn 69.2 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/**
 *    @author   ETSI / STF569
 *    @version  $URL:$
 *              $ID:$
 *    @desc     This module provides the MEC test cases.
 *    @copyright   ETSI Copyright Notification
 *                 No part may be reproduced except as authorized by written permission.
 *                 The copyright and the foregoing restriction extend to reproduction in all media.
 *                 All rights reserved.
 *    @see      ETSI GS MEC 003, ETSI GS MEC 029 V2.1.1
 */
module AtsMec_FixedAccessInformationAPI_TestCases {
  
  // Libcommon
  import from LibCommon_Time all;
  import from LibCommon_VerdictControl all;
  import from LibCommon_Sync all;
  
  // LibHttp
  import from LibItsHttp_TypesAndValues all;
  import from LibItsHttp_Functions all;
  import from LibItsHttp_Templates all;
  import from LibItsHttp_JsonTemplates all;
  import from LibItsHttp_TestSystem all;
  
26
27
28
29
  // LibMec_FixedAccessInformationServiceAPI
  import from FixedAccessInformationServiceAPI_Templates all;
  import from FixedAccessInformationServiceAPI_Pics all;
  import from FixedAccessInformationServiceAPI_Pixits all;
30
31
32
33
34
35
36
37
38
  
  // LibMec
  import from LibMec_Functions all;
  import from LibMec_Pics all;
  import from LibMec_Pixits all;
  
   /*
    *  Fixed Access Information Service (FAIS)
    */
39
  group fixedAccessInfoService {
40
41
42
43
44
    
    /**
     * @desc Check that the IUT responds with the current status of the fixed access information when queried by a MEC Application
     */
    testcase TP_MEC_SRV_FAIS_001_OK() runs on HttpComponent system HttpTestAdapter {
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
      // Local variables
      var HeaderLines v_headers;
      
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
      
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                   m_http_request_get(
                                                      "/" & PICS_ROOT_API & PX_FAI_FA_INFO_URI,
                                                      v_headers
                                                      )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
      
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
                                             mw_http_response_ok(
                                                                 mw_http_message_body_json(
                                                                                           mw_body_json_fai_fa_info(
                                                                                                                    mw_fa_info
                                                                                                                    ))))) {
          tc_ac.stop;
          
          log("*** " & testcasename() & ": PASS: IUT successfully responds with a FaInfo ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
86
        }
87
88
89
90
91
92
93
94
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
      
      // Postamble
      f_cf_01_http_down();
95
96
97
98
99
100
    } // End of testcase TP_MEC_SRV_FAIS_001_OK
    
    /**
     * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
     */
    testcase TP_MEC_SRV_FAIS_001_BR() runs on HttpComponent system HttpTestAdapter {
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
      // Local variables
      var HeaderLines v_headers;
      
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
      
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                   m_http_request_get(
                                                      "/" & PICS_ROOT_API & PX_FAI_FA_INFO_URI & "?interface=1",
                                                      v_headers
                                                      )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
      
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
133
134
135
136
137
138
139
140
141
142
143
                                             mw_http_response_400_bad_request
                                             )) {
          tc_ac.stop;
          
          log("*** " & testcasename() & ": PASS: IUT successfully responds with a ProblemDetails set to 400 Bad Request ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
          }
144
145
146
147
      } // End of 'alt' statement
      
      // Postamble
      f_cf_01_http_down();
148
149
150
151
152
153
154
155
156
157
    } // End of testcase TP_MEC_SRV_FAIS_001_BR
    
    /**
     * @desc Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application
     */
    testcase TP_MEC_SRV_FAIS_001_NF() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var HeaderLines v_headers;
        
      // Test control
158
159
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
160
161
162
163
164
165
        setverdict(inconc);
        stop;
      }
        
      // Test component configuration
      f_cf_01_http_up();
166
      
167
168
169
170
171
172
173
      // Test adapter configuration

      // Preamble
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                   m_http_request_get( 
174
                                                      "/" & PICS_ROOT_API & PX_FAI_FA_INFO_URI & "?interface=999",
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
                                                      v_headers
                                                      )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
      
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
                                             mw_http_response_404_not_found()
                                             )) {
          tc_ac.stop;
          
          log("*** " & testcasename() & ": PASS: IUT successfully responds with a ProblemDetails set to 404 Not Found ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
198
      
199
200
201
202
203
204
205
206
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TP_MEC_SRV_FAIS_001_NF
    
    /**
     * @desc Check that the IUT responds with the current status of the device information when queried by a MEC Application
     */
    testcase TP_MEC_SRV_FAIS_002_OK() runs on HttpComponent system HttpTestAdapter {
207
208
209
210
211
212
213
214
215
216
      // Local variables
      var HeaderLines v_headers;
      
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
      
217
218
219
220
221
222
223
224
225
226
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                     m_http_request_get(
227
                                                        "/" & PICS_ROOT_API & PX_FAI_DEVICE_INFO_URI,
228
229
230
231
232
233
234
235
236
                                                        v_headers
                                                        )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
      
      // Test Body
      tc_ac.start;
      alt {
237
238
239
240
241
242
243
244
245
246
        [] httpPort.receive(
                            mw_http_response(
                                             mw_http_response_ok(
                                                                 mw_http_message_body_json(
                                                                                           mw_body_json_fai_device_info(
                                                                                                                        mw_device_info
                                                                                                                        ))))) {
          tc_ac.stop;
          
          log("*** " & testcasename() & ": PASS: IUT successfully responds with a DeviceInfo ***");
247
248
249
250
251
252
253
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
254
255
256
      
      // Postamble
      f_cf_01_http_down();
257
258
259
260
261
262
    } // End of testcase TP_MEC_SRV_FAIS_002_OK
    
    /**
     * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
     */
    testcase TP_MEC_SRV_FAIS_002_BR() runs on HttpComponent system HttpTestAdapter {
263
264
265
266
267
268
269
270
271
272
      // Local variables
      var HeaderLines v_headers;
      
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
      
273
274
275
276
277
278
279
280
281
282
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                     m_http_request_get(
283
                                                        "/" & PICS_ROOT_API & PX_FAI_DEVICE_INFO_URI & "?device=__any_value__",
284
285
286
287
288
289
290
291
292
293
294
                                                        v_headers
                                                        )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
      
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
295
296
                                             mw_http_response_400_bad_request
                                             )) {
297
298
299
300
301
302
303
304
305
306
307
          
          tc_ac.stop;
          
          log("*** " & testcasename() & ": PASS: IUT successfully responds with 400 Bad Request ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
308
309
310
      
      // Postamble
      f_cf_01_http_down();
311
312
313
314
315
316
317
318
    } // End of testcase TP_MEC_SRV_FAIS_002_BR
    
    /**
     * @desc Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application
     */
    testcase TP_MEC_SRV_FAIS_002_NF() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var HeaderLines v_headers;
319
      
320
      // Test control
321
322
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
323
324
325
        setverdict(inconc);
        stop;
      }
326
      
327
328
329
330
331
332
333
334
335
336
      // Test component configuration
      f_cf_01_http_up();
        
      // Test adapter configuration

      // Preamble
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                   m_http_request_get( 
337
                                                      "/" & PICS_ROOT_API & PX_FAI_DEVICE_INFO_URI & "?gwId=" & oct2char(unichar2oct(PX_NON_EXISTING_FAI_GW_ID[0], "UTF-8")),
338
339
340
341
342
343
344
345
346
347
348
                                                      v_headers
                                                      )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
      
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
349
                                             mw_http_response_404_not_found
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
                                             )) {
          tc_ac.stop;
          
          log("*** " & testcasename() & ": PASS: IUT successfully responds with a ProblemDetails set to 404 Not Found ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
        
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TP_MEC_SRV_FAIS_002_NF

    /**
     * @desc CCheck that the IUT responds with the current status of the cable line information when queried by a MEC Application
     */
    testcase TP_MEC_SRV_FAIS_003_OK() runs on HttpComponent system HttpTestAdapter {
370
371
372
373
374
375
376
377
378
379
      // Local variables
      var HeaderLines v_headers;
      
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
      
380
381
382
383
384
385
386
387
388
389
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                   m_http_request_get(
390
391
392
                                                      "/" & PICS_ROOT_API & PX_FAI_CABLE_LINE_INFO_URI,
                                                      v_headers
                                                      )
393
394
395
396
397
398
399
400
401
402
403
404
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
      
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
                                               mw_http_response_ok(
                                                                   mw_http_message_body_json(
                                                                                             mw_body_json_fai_cable_line_info(
405
406
                                                                                                                              mw_cable_line_info
                                                                                                                              ))))) {
407
408
409
410
411
412
413
414
415
416
417
          
          tc_ac.stop;
          
          log("*** " & testcasename() & ": PASS: IUT successfully responds with a CableLineInfo ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
418
419
420
      
      // Postamble
      f_cf_01_http_down();
421
422
423
424
425
426
    } // End of testcase TP_MEC_SRV_FAIS_003_OK
    
    /**
     * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
     */
    testcase TP_MEC_SRV_FAIS_003_BR() runs on HttpComponent system HttpTestAdapter {
427
428
429
430
431
432
433
434
435
436
      // Local variables
      var HeaderLines v_headers;
      
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
      
437
438
439
440
441
442
443
444
445
446
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                     m_http_request_get(
447
                                                        "/" & PICS_ROOT_API & PX_FAI_CABLE_LINE_INFO_URI & "?cm=__any_value__",
448
449
450
451
452
453
454
455
456
457
458
                                                        v_headers
                                                        )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
      
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
459
460
                                             mw_http_response_400_bad_request
                                             )) {
461
462
463
464
465
466
467
468
469
470
471
          
          tc_ac.stop;
          
          log("*** " & testcasename() & ": PASS: IUT successfully responds with 400 Bad Request ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
472
473
474
      
      // Postamble
      f_cf_01_http_down();
475
476
477
478
479
480
    } // End of testcase TP_MEC_SRV_FAIS_003_BR

    /**
     * @desc Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application
     */
    testcase TP_MEC_SRV_FAIS_003_NF() runs on HttpComponent system HttpTestAdapter {
481
482
483
484
485
486
487
488
489
490
      // Local variables
      var HeaderLines v_headers;
      
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
      
491
492
493
494
495
496
497
498
499
500
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                     m_http_request_get(
501
                                                        "/" & PICS_ROOT_API & PX_FAI_CABLE_LINE_INFO_URI & "?cmId=" & oct2char(unichar2oct(PX_NON_EXISTING_FAI_CM_ID, "UTF-8")),
502
503
504
505
506
507
508
509
510
511
512
                                                        v_headers
                                                        )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
      
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
513
                                             mw_http_response_404_not_found
514
515
516
517
518
519
520
521
522
523
524
                                             )) {
          tc_ac.stop;
          
          log("*** " & testcasename() & ": PASS: IUT successfully responds with 404 Not Found ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
525
526
527
      
      // Postamble
      f_cf_01_http_down();
528
529
530
531
532
533
    } // End of testcase TP_MEC_SRV_FAIS_003_NF
    
    /**
     * @desc Check that the IUT responds with the current status of the optical network information when queried by a MEC Application
     */
    testcase TP_MEC_SRV_FAIS_004_OK() runs on HttpComponent system HttpTestAdapter {
534
535
536
537
538
539
540
541
542
543
      // Local variables
      var HeaderLines v_headers;
      
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
      
544
545
546
547
548
549
550
551
552
553
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                   m_http_request_get( 
554
                                                      "/" & PICS_ROOT_API & PX_FAI_OPTICAL_NW_INFO_URI,
555
556
557
558
559
560
561
562
563
564
565
                                                      v_headers
                                                      )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
      
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
566
                                             mw_http_response_ok(
567
                                                                 mw_http_message_body_json(
568
569
570
                                                                                           mw_body_json_fai_pon_info(
                                                                                                                     mw_pon_info
                                                                                                                     ))))) {
571
572
573
574
575
576
577
578
579
580
          tc_ac.stop;
          
          log("*** " & testcasename() & ": PASS: IUT successfully responds with a PonInfo ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
581
582
583
      
      // Postamble
      f_cf_01_http_down();
584
585
586
587
588
589
    } // End of testcase TP_MEC_SRV_FAIS_004_OK
    
    /**
     * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
     */
    testcase TP_MEC_SRV_FAIS_004_BR() runs on HttpComponent system HttpTestAdapter {
590
591
      // Local variables
      var HeaderLines v_headers;
592
        
593
594
595
596
597
598
599
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
      
600
601
602
603
604
605
606
607
608
609
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                   m_http_request_get( 
610
                                                      "/" & PICS_ROOT_API & PX_FAI_OPTICAL_NW_INFO_URI & "?onu=__any_value__",
611
612
613
614
615
616
617
618
619
620
621
                                                      v_headers
                                                      )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
      
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
622
623
                                             mw_http_response_400_bad_request
                                             )) {
624
625
626
627
628
629
630
631
632
633
634
          
          tc_ac.stop;
          
          log("*** " & testcasename() & ": PASS: IUT successfully responds with a 400 bad request ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
635
636
637
      
      // Postamble
      f_cf_01_http_down();
638
639
640
641
642
643
    } // End of testcase TP_MEC_SRV_FAIS_004_BR

    /**
     * @desc Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application
     */
    testcase TP_MEC_SRV_FAIS_004_NF() runs on HttpComponent system HttpTestAdapter {
644
645
      // Local variables
      var HeaderLines v_headers;
646
        
647
648
649
650
651
652
653
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
      
654
655
656
657
658
659
660
661
662
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
663
664
665
666
                                   m_http_request_get(
                                                      "/" & PICS_ROOT_API & PX_FAI_OPTICAL_NW_INFO_URI & "?onuId=" & oct2char(unichar2oct(PX_NON_EXISTING_FAI_ONU_ID, "UTF-8")),
                                                       v_headers
                                                       )
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
      
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
                                             mw_http_response_404_not_found()
                                             )) {
          tc_ac.stop;
          
          log("*** " & testcasename() & ": PASS: IUT successfully responds with 404 Not Found ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
688
689
690
      
      // Postamble
      f_cf_01_http_down();
691
692
693
694
695
696
    } // End of testcase TP_MEC_SRV_FAIS_004_NF

    /**
     * @desc Check that the IUT responds with the information pertaining to one or more UEs in a particular location when queried by a MEC Application
     */
    testcase TP_MEC_SRV_FAIS_005_OK() runs on HttpComponent system HttpTestAdapter {
697
698
699
700
701
702
703
704
705
706
      // Local variables
      var HeaderLines v_headers;
      
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
      
707
708
709
710
711
712
713
714
715
716
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                   m_http_request_get( 
717
                                                      "/" & PICS_ROOT_API & PX_FAI_SUB_URI,
718
719
720
721
722
723
724
725
726
727
728
                                                      v_headers
                                                      )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
      
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
729
                                             mw_http_response_ok(
730
                                                                 mw_http_message_body_json(
731
732
733
                                                                                           mw_body_json_fai_subscription_link_list(
                                                                                                                                   mw_subscription_link_list
                                                                                                                                   ))))) {
734
735
736
737
738
739
740
741
742
743
          tc_ac.stop;
          
          log("*** " & testcasename() & ": PASS: IUT successfully responds with a SubscriptionLinkList ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
744
745
746
      
      // Postamble
      f_cf_01_http_down();
747
748
749
750
751
752
    } // End of testcase TP_MEC_SRV_FAIS_005_OK
    
    /**
     * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
     */
    testcase TP_MEC_SRV_FAIS_005_BR() runs on HttpComponent system HttpTestAdapter {
753
754
755
756
757
758
759
760
761
762
      // Local variables
      var HeaderLines v_headers;
      
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
      
763
764
765
766
767
768
769
770
771
772
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                   m_http_request_get( 
773
                                                      "/" & PICS_ROOT_API & PX_FAI_SUB_URI & "?subscription=__any_value",
774
775
776
777
778
779
780
781
782
783
784
                                                      v_headers
                                                      )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
      
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
785
786
                                             mw_http_response_400_bad_request
                                             )) {
787
788
789
790
791
792
793
794
795
796
          tc_ac.stop;
          
          log("*** " & testcasename() & ": PASS: IUT successfully responds with a 400 Bad Request ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
797
798
799
      
      // Postamble
      f_cf_01_http_down();
800
801
802
803
804
805
    } // End of testcase TP_MEC_SRV_FAIS_005_BR

    /**
     * @desc Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application
     */
    testcase TP_MEC_SRV_FAIS_005_NF() runs on HttpComponent system HttpTestAdapter {
806
807
808
809
810
811
812
813
814
815
      // Local variables
      var HeaderLines v_headers;
      
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
      
816
817
818
819
820
821
822
823
824
825
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                   m_http_request_get( 
826
                                                      "/" & PICS_ROOT_API & PX_FAI_SUB_URI & "?subscription_type=" & oct2char(unichar2oct(PX_NON_EXISTING_FAI_SUB_ID, "UTF-8")),
827
828
829
830
831
832
833
834
835
836
837
                                                      v_headers
                                                      )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
      
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
838
839
                                             mw_http_response_404_not_found
                                             )) {
840
841
842
843
844
845
846
847
848
849
850
          
          tc_ac.stop;
          
          log("*** " & testcasename() & ": PASS: IUT successfully responds with a 404 Not Found ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
851
852
853
      
      // Postamble
      f_cf_01_http_down();
854
855
856
857
858
859
    } // End of testcase TP_MEC_SRV_UEINFOLOOK_001_NF

    /**
     * @desc Check that the IUT acknowledges the subscription by a MEC Application to notifications on Optical Network Unit alarm events
     */
    testcase TP_MEC_SRV_FAIS_006_OK() runs on HttpComponent system HttpTestAdapter {
860
861
862
863
864
865
866
867
868
869
      // Local variables
      var HeaderLines v_headers;
      
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
      
870
871
872
873
874
875
876
877
878
879
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                   m_http_request_post(
880
                                                       "/" & PICS_ROOT_API & PX_FAI_SUB_URI,
881
882
                                                       v_headers,
                                                       m_http_message_body_json(
883
884
885
886
887
888
                                                                                m_body_json_fai_onu_alarm_subscription_link_list(
                                                                                                                                 m_onu_alarm_subscription(
                                                                                                                                                          PX_ONU_ALARM_SUB_CALLBACK_URI, // callbackReference
                                                                                                                                                          m_filter_criteria_onu_alarm
                                                                                                                                                          )
                                                                                                                                 )
889
890
891
892
893
894
895
896
897
898
899
900
                                                                                )
                                                       )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
      
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
                                             mw_http_response_201_created(
901
902
903
904
905
                                                                          mw_http_message_body_json(
                                                                                                    mw_body_json_fai_onu_alarm_subscription_link_list(
                                                                                                                                                      mw_onu_alarm_subscription(
                                                                                                                                                                                PX_ONU_ALARM_SUB_CALLBACK_URI
                                                                                                                                                                                )))))) {
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
          // TODO how to send this? The TP has the IUT doing this immediately. Do we want this or will it be discarded as part of the test?
               // MEC 029, clause 7.7.3.4
//               the IUT entity sends a vPOST containing
//                  uri indicating value CALLBACK_URL
//                  body containing
//                     OnuAlarmNotification containing
//                        notificationType set to "OnuAlarmSubscription"
//                     ;
//                  ;
//               ;
//               to the MEC_APP entity
          tc_ac.stop;
          
          log("*** " & testcasename() & ": PASS: IUT successfully responds with a OnuAlarmSubscription ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
927
928
929
      
      // Postamble
      f_cf_01_http_down();
930
931
932
933
934
935
    } // End of testcase TP_MEC_SRV_FAIS_006_OK
    
    /**
     * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
     */
    testcase TP_MEC_SRV_FAIS_006_BR() runs on HttpComponent system HttpTestAdapter {
936
937
938
939
940
941
942
943
944
945
      // Local variables
      var HeaderLines v_headers;
      
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
      
946
947
948
949
950
951
952
953
954
955
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                   m_http_request_post(
956
                                                       "/" & PICS_ROOT_API & PX_UE_ZONAL_TRAF_SUB_URI,
957
958
                                                       v_headers,
                                                       m_http_message_body_json(
959
960
961
962
963
964
                                                                                m_body_json_fai_onu_alarm_subscription_link_list(
                                                                                                                                 m_onu_alarm_subscription_bad_request(
                                                                                                                                                                      PX_ONU_ALARM_SUB_CALLBACK_URI, // callbackReference
                                                                                                                                                                      m_filter_criteria_onu_alarm
                                                                                                                                                                      )
                                                                                                                                 )
965
966
967
968
969
970
971
972
973
974
975
                                                                                )
                                                       )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
      
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
976
977
                                             mw_http_response_400_bad_request
                                             )) {
978
979
980
981
982
983
984
985
986
987
          tc_ac.stop;
          
          log("*** " & testcasename() & ": PASS: IUT successfully responds with 400 Bad Request ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
988
989
990
      
      // Postamble
      f_cf_01_http_down();
991
992
993
994
995
996
    } // End of testcase TP_MEC_SRV_FAIS_006_BR
    
    /**
     * @desc Check that the IUT responds with the information on a given subscription when queried by a MEC Application
     */
    testcase TP_MEC_SRV_FAIS_007_OK() runs on HttpComponent system HttpTestAdapter {
997
998
999
1000
1001
1002
1003
1004
1005
1006
      // Local variables
      var HeaderLines v_headers;
      
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
      
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                   m_http_request_get( 
1017
                                                      "/" & PICS_ROOT_API & PX_FAI_SUB_URI & oct2char(unichar2oct(PX_SUBSCRIPTION_ID, "UTF-8")),
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
                                                      v_headers
                                                      )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
      
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
1029
                                             mw_http_response_ok(
1030
                                                                 mw_http_message_body_json(
1031
1032
1033
                                                                                           mw_body_json_fai_onu_alarm_subscription_link_list(
                                                                                                                                             mw_onu_alarm_subscription
                                                                                                                                             ))))) {
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
          tc_ac.stop;
          
          log("*** " & testcasename() & ": PASS: IUT successfully responds with a OnuAlarmSubscription ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
1044
1045
1046
      
      // Postamble
      f_cf_01_http_down();
1047
1048
1049
1050
1051
1052
    } // End of testcase TP_MEC_SRV_FAIS_007_OK
    
    /**
     * @desc Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application
     */
    testcase TP_MEC_SRV_FAIS_007_NF() runs on HttpComponent system HttpTestAdapter {
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
      // Local variables
      var HeaderLines v_headers;
      
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
      
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                   m_http_request_get( 
1073
                                                      "/" & PICS_ROOT_API & PX_FAI_SUB_URI & oct2char(unichar2oct(PX_NON_EXISTENT_SUBSCRIPTION_ID, "UTF-8")),
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
                                                      v_headers
                                                      )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
      
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
1085
1086
                                             mw_http_response_404_not_found
                                             )) {
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
          tc_ac.stop;
          
          log("*** " & testcasename() & ": PASS: IUT successfully responds with a 404 Not Found ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
        
1098
1099
      // Postamble
      f_cf_01_http_down();
1100
1101
1102
1103
1104
1105
    } // End of testcase TP_MEC_SRV_FAIS_007_NF

    /**
     * @desc Check that the IUT updates an existing subscription when commanded by a MEC Application
     */
    testcase TP_MEC_SRV_FAIS_008_OK() runs on HttpComponent system HttpTestAdapter {
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
      // Local variables
      var HeaderLines v_headers;
      
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
      
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      // TODO If-Match header needs to have a PROPER_ETAG
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                   m_http_request_put(
1127
                                                      "/" & PICS_ROOT_API & PX_FAI_SUB_URI & oct2char(unichar2oct(PX_SUBSCRIPTION_ID, "UTF-8")),
1128
1129
                                                       v_headers,
                                                       m_http_message_body_json(
1130
1131
1132
1133
1134
1135
                                                                                m_body_json_fai_onu_alarm_subscription_link_list(
                                                                                                                                 m_onu_alarm_subscription(
                                                                                                                                                          PX_ONU_ALARM_SUB_CALLBACK_URI,
                                                                                                                                                          m_filter_criteria_onu_alarm
                                                                                                                                                          )
                                                                                                                                 )
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
                                                                                )
                                                       )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
      
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
                                             mw_http_response_ok(
                                                                 mw_http_message_body_json(
1149
1150
1151
                                                                                           mw_body_json_fai_onu_alarm_subscription_link_list(
                                                                                                                                             mw_onu_alarm_subscription
                                                                                                                                             ))))) {
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
          tc_ac.stop;
          
          log("*** " & testcasename() & ": PASS: IUT successfully responds with a userTrackingSubscription ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
1162
1163
1164
      
      // Postamble
      f_cf_01_http_down();
1165
1166
1167
1168
1169
1170
    } // End of testcase TP_MEC_SRV_FAIS_008_OK
    
    /**
     * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
     */
    testcase TP_MEC_SRV_FAIS_008_BR() runs on HttpComponent system HttpTestAdapter {
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
      // Local variables
      var HeaderLines v_headers;
      
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
      
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      // TODO If-Match header needs to have a PROPER_ETAG
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                   m_http_request_put(
1192
                                                      "/" & PICS_ROOT_API & PX_FAI_SUB_URI & oct2char(unichar2oct(PX_SUBSCRIPTION_ID, "UTF-8")),
1193
1194
                                                       v_headers,
                                                       m_http_message_body_json(
1195
1196
1197
1198
1199
1200
                                                                                m_body_json_fai_onu_alarm_subscription_link_list(
                                                                                                                                 m_onu_alarm_subscription_bad_request(
                                                                                                                                                                      PX_ONU_ALARM_SUB_CALLBACK_URI,
                                                                                                                                                                      m_filter_criteria_onu_alarm
                                                                                                                                                                      )
                                                                                                                                 )
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
                                                                                )
                                                       )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
      
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
1212
1213
                                             mw_http_response_400_bad_request
                                             )) {
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
          tc_ac.stop;
          
          log("*** " & testcasename() & ": PASS: IUT successfully responds with 400 Bad Request ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
1224
1225
1226
      
      // Postamble
      f_cf_01_http_down();
1227
1228
1229
1230
1231
1232
    } // End of testcase TP_MEC_SRV_FAIS_008_BR
    
    /**
     * @desc Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application
     */
    testcase TP_MEC_SRV_FAIS_008_NF() runs on HttpComponent system HttpTestAdapter {
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
      // Local variables
      var HeaderLines v_headers;
      
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
      
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      // TODO If-Match header needs to have a PROPER_ETAG
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                   m_http_request_put(
1254
                                                      "/" & PICS_ROOT_API & PX_FAI_SUB_URI & oct2char(unichar2oct(PX_NON_EXISTENT_SUBSCRIPTION_ID, "UTF-8")),
1255
1256
                                                       v_headers,
                                                       m_http_message_body_json(
1257
1258
1259
1260
1261
1262
                                                                                m_body_json_fai_onu_alarm_subscription_link_list(
                                                                                                                                 m_onu_alarm_subscription(
                                                                                                                                                          PX_ONU_ALARM_SUB_CALLBACK_URI,
                                                                                                                                                          m_filter_criteria_onu_alarm
                                                                                                                                                          )
                                                                                                                                 )
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
                                                                                )
                                                       )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
      
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
1274
1275
                                             mw_http_response_404_not_found
                                             )) {
1276
1277
          tc_ac.stop;
          
1278
          log("*** " & testcasename() & ": PASS: IUT successfully responds with a HTTP error 404 ***");
1279
1280
1281
1282
1283
1284
1285
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
1286
1287
1288
      
      // Postamble
      f_cf_01_http_down();
1289
1290
1291
1292
1293
1294
    } // End of testcase TP_MEC_SRV_FAIS_008_NF

    /**
     * @desc Check that the IUT responds with an error when a request sent by a MEC Application doesn't comply with a required condition
     */
    testcase TP_MEC_SRV_FAIS_008_PF() runs on HttpComponent system HttpTestAdapter {
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
      // Local variables
      var HeaderLines v_headers;
      
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
      
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      // TODO If-Match header needs to have an INVALID_ETAG
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                   m_http_request_put(
1316
                                                      "/" & PICS_ROOT_API & PX_FAI_SUB_URI & oct2char(unichar2oct(PX_SUBSCRIPTION_ID, "UTF-8")),
1317
1318
                                                       v_headers,
                                                       m_http_message_body_json(
1319
1320
1321
1322
1323
1324
                                                                                m_body_json_fai_onu_alarm_subscription_link_list(
                                                                                                                                 m_onu_alarm_subscription(
                                                                                                                                                          PX_ONU_ALARM_SUB_CALLBACK_URI,
                                                                                                                                                          m_filter_criteria_onu_alarm
                                                                                                                                                          )
                                                                                                                                 )
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
                                                                                )
                                                       )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
      
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
1336
1337
                                             mw_http_response_412_precondition_failed
                                             )) {
1338
          tc_ac.stop;
1339
1340

          log("*** " & testcasename() & ": PASS: IUT successfully responds with a ProblemDetails set to 412 Precondition Failed ***");
1341
1342
1343
1344
1345
1346
1347
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
1348
1349
1350
      
      // Postamble
      f_cf_01_http_down();
1351
1352
1353
1354
1355
1356
    } // End of testcase TP_MEC_SRV_FAIS_008_PF

    /**
     * @desc Check that the IUT acknowledges the cancellation of UE location change notifications when commanded by a MEC Application
     */
    testcase TP_MEC_SRV_FAIS_009_OK() runs on HttpComponent system HttpTestAdapter {
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
      // Local variables
      var HeaderLines v_headers;
      
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
      
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                   m_http_request_delete(
1377
1378
1379
                                                         "/" & PICS_ROOT_API & PX_FAI_SUB_URI & oct2char(unichar2oct(PX_SUBSCRIPTION_ID, "UTF-8")),
                                                         v_headers
                                                         )
1380
1381
1382
1383
1384
1385
1386
1387
1388
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
      
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
1389
1390
                                             mw_http_response_204_no_content
                                             )) {
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
          tc_ac.stop;
          
          log("*** " & testcasename() & ": PASS: IUT successfully responds with no content ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
1401
1402
1403
      
      // Postamble
      f_cf_01_http_down();
1404
1405
1406
1407
1408
1409
    } // End of testcase TP_MEC_SRV_FAIS_009_OK
    
    /**
     * @desc Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application
     */
    testcase TP_MEC_SRV_FAIS_009_NF() runs on HttpComponent system HttpTestAdapter {
1410
1411
      // Local variables
      var HeaderLines v_headers;
1412
        
1413
1414
1415
1416
1417
1418
1419
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
      
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                   m_http_request_delete(
1430
1431
1432
                                                         "/" & PICS_ROOT_API & PX_FAI_SUB_URI & oct2char(unichar2oct(PX_NON_EXISTENT_SUBSCRIPTION_ID, "UTF-8")),
                                                          v_headers
                                                         )
1433
1434
1435
1436
1437
1438
1439
1440
1441
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
      
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
1442
1443
                                             mw_http_response_404_not_found
                                             )) {
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
          tc_ac.stop;
          
          log("*** " & testcasename() & ": PASS: IUT successfully responds with no 404 Not Found ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
1454
1455
1456
      
      // Postamble
      f_cf_01_http_down();
1457
1458
1459
1460
1461
1462
    } // End of testcase TP_MEC_SRV_FAIS_009_NF
    
    /**
     * @desc Check that the IUT sends notification on expiry of Fixed Access Information event subscription to a MEC Application
     */
    testcase TP_MEC_SRV_FAIS_010_OK() runs on HttpComponent system HttpTestAdapter {
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
      // Local variables
      var HeaderLines v_headers;
      
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
      
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                   m_http_request_post(
1483
                                                       "/" & PICS_ROOT_API & PX_FAI_SUB_URI,
1484
1485
                                                       v_headers,
                                                       m_http_message_body_json(
1486
1487
1488
1489
1490
1491
1492
1493
                                                                                m_body_json_fai_onu_alarm_subscription_link_list(
                                                                                                                                 m_onu_alarm_subscription(
                                                                                                                                                          PX_ONU_ALARM_SUB_CALLBACK_URI,
                                                                                                                                                          m_filter_criteria_onu_alarm,
                                                                                                                                                          -,
                                                                                                                                                          m_time_stamp(1577836800)
                                                                                                                                                          )
                                                                                                                                 )
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
                                                                                )
                                                       )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
      
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
                                             mw_http_response_201_created(
                                                                 mw_http_message_body_json(
1507
1508
1509
                                                                                mw_body_json_fai_onu_alarm_subscription_link_list(
                                                                                                                                  mw_onu_alarm_subscription
                                                                                                                                  ))))) {
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
          // TODO Need to check Location header

          // TODO: how to wait for a timeout of (NOW_PLUS_X_SECONDS - guard time)? which guard time value to use?
               // MEC 029, clause 5.2.6.2
//               the IUT entity sends a vPOST containing
//                  uri indicating value CALLBACK_URL
//                  body containing
//                     ExpiryNotification containing
//                        expiryDeadline indicating value NOW_PLUS_X_SECONDS    // TODO: how to set this?
//                     ;
//                  ;
//               ;
//               to the MEC_APP entity
          tc_ac.stop;
          
          log("*** " & testcasename() & ": PASS: IUT successfully responds with a DevInfoSubscription ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
1533
1534
1535
      
      // Postamble
      f_cf_01_http_down();
1536
1537
1538
1539
1540
1541
    } // End of testcase TP_MEC_SRV_FAIS_010_OK
    
    /**
     * @desc Check that the IUT acknowledges the subscription by a MEC Application to notifications on Optical Network Unit alarm events
     */
    testcase TP_MEC_SRV_FAIS_011_OK() runs on HttpComponent system HttpTestAdapter {
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
      // Local variables
      var HeaderLines v_headers;
      
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
      
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
      // Test component configuration
      f_cf_01_http_up();
      
      // Test adapter configuration
      
      // Preamble
      f_init_default_headers_list(-, -, v_headers);
        
// TODO how to generate an event?
//      Initial conditions  with {
//         the IUT entity being_in idle_state and
//         the IUT entity having a subscriptions containing,
//            subscriptionType indicating value "OnuAlarmSubscription"
//            callbackReference indicating value CALLBACK_URL
//         ;
//      }
//
//      // MEC 029, clause 5.2.7
//      Expected behaviour
//         ensure that {
//            when {
//               the IUT entity generates a onu_alarm_event
//            }
//            then {
//               // // MEC 029, clause 5.2.7
//               the IUT entity sends a vPOST containing
//                  Uri set to CALLBACK_URL
//                  body containing
//                     OnuAlarmSubscription containing
//                        notificationType set to "OnuAlarmSubscription"
//                     ;
//                  ;
//               ;
//               to the MEC_APP entity
//            }
//         }

1589
1590
      // Postamble
      f_cf_01_http_down();
1591
1592
    } // End of testcase TP_MEC_SRV_FAIS_011_OK
    
1593
1594
  } // End of group fixedAccessInfoService
  
1595
} // End of module AtsMec_FixedAccessInfoAPI_TestCases 
1596