AtsMec_RadioNodeLocationAPI_TestCases.ttcn 89 KB
Newer Older
Yann Garcia's avatar
Yann Garcia committed
1
2
3
4
5
6
7
8
9
/**
 *    @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.
10
 *    @see      ETSI GS MEC 003, ETSI GS MEC 013 V2.1.1
Yann Garcia's avatar
Yann Garcia committed
11
12
 */
module AtsMec_RadioNodeLocationAPI_TestCases {
13

Yann Garcia's avatar
Yann Garcia committed
14
15
16
17
  // Libcommon
  import from LibCommon_Time all;
  import from LibCommon_VerdictControl all;
  import from LibCommon_Sync all;
18

Yann Garcia's avatar
Yann Garcia committed
19
20
21
22
23
24
25
  // 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;
  
YannGarcia's avatar
YannGarcia committed
26
  // LibMec/LocationAPI
Yann Garcia's avatar
Yann Garcia committed
27
28
29
30
  import from LocationAPI_TypesAndValues all;
  import from LocationAPI_Templates all;
  import from LocationAPI_Pics all;
  import from LocationAPI_Pixits all;
31

Yann Garcia's avatar
Yann Garcia committed
32
33
34
35
  // LibMec
  import from LibMec_Functions all;
  import from LibMec_Pics all;
  import from LibMec_Pixits all;
36
37
38
39
40
41
42
43


   /*
    * Radio Node Location Lookup (RLOCLOOK)
    */

  group radioNodeLocationLookup {

Yann Garcia's avatar
Yann Garcia committed
44
45
46
47
    /**
     * @desc Check that the IUT responds with the list of radio nodes currently associated with the MEC host and the location of each radio node when queried by a MEC Application
     * @see https://forge.etsi.org/gitlab/mec/gs013-location-api/blob/master/LocationAPI.yaml#/definitions/AccessPointList
     */
48
    testcase TC_MEC_SRV_RLOCLOOK_001_OK() runs on HttpComponent system HttpTestAdapter {
Yann Garcia's avatar
Yann Garcia committed
49
50
51
        // Local variables
        var HeaderLines v_headers;
        var HttpMessage v_response;
52

Yann Garcia's avatar
Yann Garcia committed
53
        // Test control
54
55
        if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_LOCATION_API_SUPPORTED)) {
            log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_LOCATION_API_SUPPORTED required for executing the TC ***");
Yann Garcia's avatar
Yann Garcia committed
56
57
58
            setverdict(inconc);
            stop;
        }
59

Yann Garcia's avatar
Yann Garcia committed
60
61
        // Test component configuration
        f_cf_01_http_up();
62

Yann Garcia's avatar
Yann Garcia committed
63
        // Test adapter configuration
64

Yann Garcia's avatar
Yann Garcia committed
65
66
67
68
69
        // Preamble
        f_init_default_headers_list(-, -, v_headers);
        httpPort.send(
                      m_http_request(
                                     m_http_request_get(
YannGarcia's avatar
YannGarcia committed
70
                                                        PX_ME_APP_Q_ZONE_ID_URI & "/" & oct2char(unichar2oct(PX_ZONE_ID, "UTF-8")) & "/accessPoints",
Yann Garcia's avatar
Yann Garcia committed
71
72
73
74
75
                                                        v_headers
                                                        )
                                     )
                      );
        f_selfOrClientSyncAndVerdict(c_prDone, e_success);
76

Yann Garcia's avatar
Yann Garcia committed
77
78
79
80
81
82
83
84
85
86
87
        // Test Body
        tc_ac.start;
        alt {
          [] httpPort.receive(
                              mw_http_response(
                                               mw_http_response_ok(
                                                                   mw_http_message_body_json(
                                                                                             mw_body_json_access_point_list(
                                                                                                                            mw_access_point_list(
                                                                                                                                                 PX_ZONE_ID
                                                                                                                                                 )))))) -> value v_response {
YannGarcia's avatar
YannGarcia committed
88
            tc_ac.stop;
89

Yann Garcia's avatar
Yann Garcia committed
90
91
92
93
94
95
96
97
            log("*** " & testcasename() & ": PASS: IUT successfully responds with an AccessPoint list containing a ZoneId ***");
            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
98

Yann Garcia's avatar
Yann Garcia committed
99
100
        // Postamble
        f_cf_01_http_down();
101
    } // End of testcase TC_MEC_SRV_RLOCLOOK_001_OK
102

YannGarcia's avatar
YannGarcia committed
103
104
105
    /**
     * @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
     */
106
    testcase TC_MEC_SRV_RLOCLOOK_001_NF() runs on HttpComponent system HttpTestAdapter {
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
      // Local variables
      var HeaderLines v_headers;

      // Test control
        if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_LOCATION_API_SUPPORTED)) {
            log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_LOCATION_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(
127
                                                      "/" & PICS_ROOT_API & PX_ME_APP_Q_ZONE_ID_URI & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_ZONE_ID, "UTF-8")) & "/accessPoints",
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
                                                      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

      // Postamble
      f_cf_01_http_down();
154
    } // End of testcase TC_MEC_SRV_RLOCLOOK_001_NF
155
156
157
158
159
160
161
162
163

  } // End of group radioNodeLocationLookup



   /*
    * UE Area Subscribe (UEAREASUB)
    */
  group ueAreaSubscribe {
164
    
165
166
167
    /**
     * @desc Check that the IUT acknowledges the UE area change subscription request when commanded by a MEC Application and notifies it when the UE enters the specified circle
     */
168
169
170
171
    testcase TC_MEC_SRV_UEAREASUB_001_OK() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var HeaderLines v_headers;
      var HttpMessage v_response;
172

173
174
175
176
177
178
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_LOCATION_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_LOCATION_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
179
180
181
182
183
184
185
186
187
188
189

      // 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(
190
                                                       "/" & PICS_ROOT_API & oct2char(unichar2oct(PX_UE_AREA_SUB_URI, "UTF-8")),
191
192
                                                       v_headers,
                                                       m_http_message_body_json(
193
194
195
196
197
198
199
                                                                                m_body_json_circle_notification_subscription(
                                                                                                                             m_circle_notification_subscription(
                                                                                                                                                                PX_CLIENT_ID, //clientCorrelator
                                                                                                                                                                PX_AREA_SUB_CALLBACK_URI, // callbackReference
                                                                                                                                                                PX_IP_ADDRESS // address
                                                                                                                                                                )
                                                                                                                             )
200
201
                                                                                )
                                                       )
202
                                  )
203
204
205
206
207
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);

      // Test Body
      tc_ac.start;
208
      alt { 
209
210
211
        [] httpPort.receive(
                            mw_http_response(
                                             mw_http_response_201_created(
212
213
214
215
216
217
218
                                                                          mw_http_message_body_json(
                                                                                                    mw_body_json_circle_notification_subscription(
                                                                                                                                                  mw_circle_notification_subscription(
                                                                                                                                                                                      PX_CLIENT_ID, //clientCorrelator
                                                                                                                                                                                      PX_AREA_SUB_CALLBACK_URI, // callbackReference
                                                                                                                                                                                      PX_IP_ADDRESS // address
                                                                                                                                                                                      )))))) -> value v_response {
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
          // TODO how to send this when the UE enters the area? The TP has the IUT doing this immediately. Do we want this or will it be discarded as part of the test?
//               // MEC 013, clause 7.3.11.3
//               the IUT entity sends a vPOST containing,
//                  uri indicating value CALLBACK_URL
//                  body containing
//                     subscriptionNotification containing
//                        terminalLocation containing
//                           address set to IP_ADDRESS
//                        ;
//                     ;
//                  ;
//               ;
//               to the MEC_APP entity
          tc_ac.stop;

          log("*** " & testcasename() & ": PASS: IUT successfully responds with a circleNotificationSubscription ***");
          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

243
244
245
246
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TC_MEC_SRV_UEAREASUB_001_OK
    
247
248
249
    /**
     * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
     */
250
251
252
    testcase TC_MEC_SRV_UEAREASUB_001_BR() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var HeaderLines v_headers;
253

254
255
256
257
258
259
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_LOCATION_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_LOCATION_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
260
261
262
263
264
265
266
267
268
269
270

      // 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(
271
                                                       "/" & PICS_ROOT_API & oct2char(unichar2oct(PX_UE_AREA_SUB_URI, "UTF-8")),
272
273
                                                       v_headers,
                                                       m_http_message_body_json(
274
275
276
                                                                                m_body_json_circle_notification_subscription(
                                                                                                                             m_circle_notification_subscription(
                                                                                                                                                                PX_CLIENT_ID, //clientCorrelator
277
278
            // TODO the TP uses a wrong field name to trigger an error response. Do we create a new data structure just for this or
            // change the test to use another trigger (e.g.: invalid IP address)?
279
280
281
282
                                                                                                                                                                PX_AREA_SUB_CALLBACK_URI, // callbackReference
                                                                                                                                                                PX_IP_ADDRESS // address
                                                                                                                                                                )
                                                                                                                             )
283
284
285
286
287
288
289
290
291
292
293
                                                                                )
                                                       )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);

      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
294
295
                                             mw_http_response_400_bad_request
                                             )) {
296
297
298
299
300
301
302
303
304
305
306
          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

307
308
309
310
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TC_MEC_SRV_UEAREASUB_001_BR
    
311
312
313
    /**
     * @desc Check that the IUT acknowledges the cancellation of UE area change notifications when commanded by a MEC Application
     */
314
315
316
    testcase TC_MEC_SRV_UEAREASUB_002_OK() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var HeaderLines v_headers;
317

318
319
320
321
322
323
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_LOCATION_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_LOCATION_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
324
325
326
327
328
329
330
331
332
333
334

      // 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(
335
336
337
                                                         "/" & PICS_ROOT_API & oct2char(unichar2oct(PX_UE_AREA_SUB_URI, "UTF-8")) & oct2char(unichar2oct(PX_SUBSCRIPTION_ID, "UTF-8")),
                                                         v_headers
                                                         )
338
339
340
341
342
343
344
345
346
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);

      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
347
348
                                             mw_http_response_204_no_content
                                             )) {
349
350
351
352
353
354
355
356
357
358
359
360

          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

361
362
363
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TC_MEC_SRV_UEAREASUB_002_OK
364
365
366
367

    /**
     * @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
     */
368
369
370
    testcase TC_MEC_SRV_UEAREASUB_002_NF() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var HeaderLines v_headers;
371

372
373
374
375
376
377
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_LOCATION_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_LOCATION_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
378
379
380
381
382
383
384
385
386
387
388

      // 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(
389
390
391
                                                         "/" & PICS_ROOT_API & oct2char(unichar2oct(PX_UE_AREA_SUB_URI, "UTF-8")) & oct2char(unichar2oct(PX_NON_EXISTENT_SUBSCRIPTION_ID, "UTF-8")),
                                                         v_headers
                                                         )
392
393
394
395
396
397
398
399
400
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);

      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
401
                                             mw_http_response_404_not_found
402
403
404
405
406
407
408
409
410
411
412
413
                                             )) {
          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

414
415
416
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TC_MEC_SRV_UEAREASUB_002_NF
417
418
419
420
421
422
423
424
425
426
427

  } // End of group ueAreaSubscribe

   /*
    * UE Distance Lookup (UEDISTLOOK)
    */
  group ueDistanceLookup {

    /**
     * @desc Check that the IUT responds with the distance to a UE when queried by a MEC Application
     */
428
    testcase TC_MEC_SRV_UEDISTLOOK_001_OK() runs on HttpComponent system HttpTestAdapter {
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
        // Local variables
        var HeaderLines v_headers;

        // Test control
        if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_LOCATION_API_SUPPORTED)) {
            log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_LOCATION_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(
449
                                                      "/" & PICS_ROOT_API & PX_UE_LOC_QRY_URI & "?address=" & oct2char(unichar2oct(PX_IP_ADDRESS, "UTF-8")) & "&latitude=" & fx_float2str(PX_UE_COORD_LAT) & "&longitude=" & fx_float2str(PX_UE_COORD_LONG),
450
451
452
453
454
455
456
457
458
459
460
                                                      v_headers
                                                      )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);

      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
461
                                             mw_http_response_ok(
462
                                                                 mw_http_message_body_json(
463
464
465
                                                                                           mw_body_json_terminal_distance(
                                                                                                                          mw_terminal_distance
                                                                                                                          ))))) {
466
467
468
469
470
471
472
473
474
475
476
477

          tc_ac.stop;

          log("*** " & testcasename() & ": PASS: IUT successfully responds with a 200 OK ***");
          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

478
479
480
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TC_MEC_SRV_UEDISTLOOK_001_OK
481
482
483
484

    /**
     * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
     */
485
486
487
    testcase TC_MEC_SRV_UEDISTLOOK_001_BR() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var HeaderLines v_headers;
488

489
490
491
492
493
494
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_LOCATION_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_LOCATION_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
495
496
497
498
499
500
501
502
503
504
505

      // 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(
506
                                                      "/" & PICS_ROOT_API & PX_UE_LOC_QRY_URI & "?address=" & oct2char(unichar2oct(PX_IP_ADDRESS, "UTF-8")) & "&lat=" & fx_float2str(PX_UE_COORD_LAT) & "&longitude=" & fx_float2str(PX_UE_COORD_LONG),
507
508
509
510
511
512
513
514
515
516
517
                                                      v_headers
                                                      )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);

      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
518
519
                                             mw_http_response_400_bad_request
                                             )) {
520
521
522
523
524
525
526
527
528
529
530
531

          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

532
533
534
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TC_MEC_SRV_UEDISTLOOK_001_BR
535
536
537
538
539
540
541
542
543
544
545

  } // End of group ueDistanceLookup

   /*
    * UE Distance Subscribe (UEDISTSUB)
    */
  group ueDistanceSubscribe {

    /**
     * @desc Check that the IUT acknowledges the UE distance subscription request when commanded by a MEC Application and notifies it when (all) the requested UE(s) is (are) within the specified distance
     */
546
547
548
549
    testcase TC_MEC_SRV_UEDISTSUB_001_OK() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var HeaderLines v_headers;
      var HttpMessage v_response;
550

551
552
553
554
555
556
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_LOCATION_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_LOCATION_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
557
558
559
560
561
562
563
564
565
566
567

      // 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(
568
                                                       "/" & PICS_ROOT_API & PX_UE_DIST_SUB_URI,
569
570
                                                       v_headers,
                                                       m_http_message_body_json(
571
572
573
574
575
576
577
                                                                                m_body_json_distance_notification_subscription(
                                                                                                                               m_distance_notification_subscription(
                                                                                                                                                                    PX_CLIENT_ID, //clientCorrelator
                                                                                                                                                                    PX_UE_DIST_SUB_CALLBACK_URI, // callbackReference
                                                                                                                                                                    PX_UE_MONITORED_IP_ADDRESS, // monitoredAddress
                                                                                                                                                                    PX_IP_ADDRESS // address
                                                                                                                                                                    )
578
579
580
581
582
583
584
585
586
587
588
589
590
                                                                                                                               )
                                                                                )
                                                       )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);

      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
                                             mw_http_response_201_created(
591
592
593
594
595
596
597
598
                                                                          mw_http_message_body_json(
                                                                                                    mw_body_json_distance_notification_subscription(
                                                                                                                                                    mw_distance_notification_subscription(
                                                                                                                                                                                          PX_CLIENT_ID, //clientCorrelator
                                                                                                                                                                                          PX_UE_DIST_SUB_CALLBACK_URI, // callbackReference
                                                                                                                                                                                          PX_UE_MONITORED_IP_ADDRESS, // monitoredAddress
                                                                                                                                                                                          PX_IP_ADDRESS // address
                                                                                                                                                                                          )))))) -> value v_response {
599
          // TODO how to send this when the UE enters the area? The TP has the IUT doing this immediately. Do we want this or will it be discarded as part of the test?
600
601
//              
                                                                                                                  // MEC 013, clause 7.3.11.3
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
//               the IUT entity sends a vPOST containing, //                  uri indicating value CALLBACK_URL
//                  body containing
//                     subscriptionNotification containing
//                        terminalLocation containing
//                           address set to IP_ADDRESS
//                        ;
//                     ;
//                  ;
//               ;
//               to the MEC_APP entity

          tc_ac.stop;

          log("*** " & testcasename() & ": PASS: IUT successfully responds with a circleNotificationSubscription ***");
          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

624
625
626
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TC_MEC_SRV_UEDISTSUB_001_OK
627
628
629
630

    /**
     * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
     */
631
632
633
    testcase TC_MEC_SRV_UEDISTSUB_001_BR() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var HeaderLines v_headers;
634

635
636
637
638
639
640
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_LOCATION_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_LOCATION_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
641
642
643
644
645
646
647
648
649
650
651

      // 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(
652
                                                       "/" & PICS_ROOT_API & PX_UE_DIST_SUB_URI,
653
654
                                                       v_headers,
                                                       m_http_message_body_json(
655
                                                                                m_body_json_distance_notification_subscription(
656
657
            // TODO the TP uses a wrong field name to trigger an error response. Do we create a new data structure just for this or
            // change the test to use another trigger (e.g.: invalid IP address)?
658
659
660
661
662
663
                                                                                                                               m_distance_notification_subscription(
                                                                                                                                                                    PX_CLIENT_ID, //clientCorrelator
                                                                                                                                                                    PX_UE_DIST_SUB_CALLBACK_URI, // callbackReference
                                                                                                                                                                    PX_UE_MONITORED_IP_ADDRESS, // monitoredAddress
                                                                                                                                                                    PX_IP_ADDRESS // address
                                                                                                                                                                    )
664
665
666
667
668
669
670
671
672
673
674
675
                                                                                                                               )
                                                                                )
                                                       )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);

      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
676
677
                                             mw_http_response_400_bad_request
                                             )) {
678
679
680
681
682
683
684
685
686
687
688
689

          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

690
691
692
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TC_MEC_SRV_UEDISTSUB_001_BR
693
694
695
696

    /**
     * @desc Check that the IUT acknowledges the cancellation of UE distance notifications when commanded by a MEC Application
     */
697
698
699
    testcase TC_MEC_SRV_UEDISTSUB_002_OK() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var HeaderLines v_headers;
700

701
702
703
704
705
706
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_LOCATION_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_LOCATION_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
707
708
709
710
711
712
713
714
715
716
717

      // 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(
718
                                                         "/" & PICS_ROOT_API & PX_UE_DIST_SUB_URI & oct2char(unichar2oct(PX_SUBSCRIPTION_ID, "UTF-8")),
719
720
                                                         v_headers
                                                         )
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);

      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
                                             mw_http_response_204_no_content()
                                                                               )) {

          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

744
745
746
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TC_MEC_SRV_UEDISTSUB_002_OK
747
748
749
750

    /**
     * @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
     */
751
752
753
    testcase TC_MEC_SRV_UEDISTSUB_002_NF() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var HeaderLines v_headers;
754

755
756
757
758
759
760
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_LOCATION_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_LOCATION_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
761
762
763
764
765
766
767
768
769
770
771

      // 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(
772
                                                         "/" & PICS_ROOT_API & PX_UE_DIST_SUB_URI & oct2char(unichar2oct(PX_NON_EXISTENT_SUBSCRIPTION_ID, "UTF-8")),
773
774
                                                         v_headers
                                                         )
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
                                   )
                    );
      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

798
799
800
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TC_MEC_SRV_UEDISTSUB_002_NF
801
802
803
804
805
806
807
808
809
810
811

  } // End of group ueDistanceSubscribe

   /*
    * UE Information Lookup (UEINFOLOOK)
    */
  group ueInformationLookup {

    /**
     * @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
     */
812
813
814
    testcase TC_MEC_SRV_UEINFOLOOK_001_OK() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var HeaderLines v_headers;
815

816
817
818
819
820
821
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_LOCATION_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_LOCATION_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
822
823
824
825
826
827
828
829
830
831
832

      // 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(
833
                                                      "/" & PICS_ROOT_API & PX_UE_LOC_USERS_URI & "?address=" & oct2char(unichar2oct(PX_ACR_SOME_IP, "UTF-8")),
834
835
836
837
838
839
840
841
842
843
844
                                                      v_headers
                                                      )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);

      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
845
                                             mw_http_response_ok(
846
                                                                 mw_http_message_body_json(
847
848
849
                                                                                           mw_body_json_user_list(
                                                                                                                  mw_user_list
                                                                                                                  ))))) {
850
851
852
853
854
855
856
857
858
859
860
861

          tc_ac.stop;

          log("*** " & testcasename() & ": PASS: IUT successfully responds with a 200 OK ***");
          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

862
863
864
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TC_MEC_SRV_UEINFOLOOK_001_OK
865
866
867
868

    /**
     * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
     */
869
870
871
    testcase TC_MEC_SRV_UEINFOLOOK_001_BR() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var HeaderLines v_headers;
872

873
874
875
876
877
878
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_LOCATION_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_LOCATION_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
879
880
881
882
883
884
885
886
887
888
889

      // 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(
890
                                                      "/" & PICS_ROOT_API & PX_UE_LOC_USERS_URI & "?addr=" & oct2char(unichar2oct(PX_ACR_SOME_IP, "UTF-8")),
891
892
893
894
895
896
897
898
899
900
901
                                                      v_headers
                                                      )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);

      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
902
903
                                             mw_http_response_400_bad_request
                                             )) {
904
905
906
907
908
909
910
911
912
913
914
915

          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

916
917
918
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TC_MEC_SRV_UEINFOLOOK_001_BR
919
920
921
922

    /**
     * @desc Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application
     */
923
924
925
    testcase TC_MEC_SRV_UEINFOLOOK_001_NF() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var HeaderLines v_headers;
926

927
928
929
930
931
932
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_LOCATION_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_LOCATION_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
933
934
935
936
937
938
939
940
941
942
943

      // 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(
944
                                                      "/" & PICS_ROOT_API & PX_UE_LOC_USERS_URI & "?address=" & oct2char(unichar2oct(PX_ACR_UNKNOWN_IP, "UTF-8")),
945
946
947
948
949
950
951
952
953
954
955
                                                      v_headers
                                                      )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);

      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
956
957
                                             mw_http_response_404_not_found
                                             )) {
958
959
960
961
962
963
964
965
966
967
968
969

          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

970
971
972
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TC_MEC_SRV_UEINFOLOOK_001_NF
973
974
975

  } // End of group ueInformationLookup

976
977
978
  /*
   * UE Information Subscription (UEINFOSUB)
   */
979
980
981
982
983
  group ueInformationSubscription {

    /**
     * @desc Check that the IUT acknowledges the UE information change subscription request when commanded by a MEC Application and notifies it when the location changes
     */
984
985
986
987
    testcase TC_MEC_SRV_UEINFOSUB_001_OK() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var HeaderLines v_headers;
      var HttpMessage v_response;
988

989
990
991
992
993
994
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_LOCATION_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_LOCATION_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
995
996
997
998
999
1000
1001
1002
1003
1004
1005

      // 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(
1006
                                                       "/" & PICS_ROOT_API & oct2char(unichar2oct(PX_UE_ZONAL_TRAF_SUB_URI, "UTF-8")),
1007
1008
1009
                                                       v_headers,
                                                       m_http_message_body_json(
                                                                                m_body_json_zonal_traffic_subscription(
1010
1011
1012
1013
1014
1015
                                                                                                                       m_zonal_traffic_subscription(
                                                                                                                                                    PX_CLIENT_ID, //clientCorrelator
                                                                                                                                                    PX_TRAFFIC_SUB_CALLBACK_URI, // callbackReference
                                                                                                                                                    PX_ZONE_ID // zoneId
                                                                                                                                                    )
                                                                                                                       )
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
                                                                                )
                                                       )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);

      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
                                             mw_http_response_201_created(
1028
1029
1030
1031
1032
1033
1034
                                                                          mw_http_message_body_json(
                                                                                                    mw_body_json_zonal_traffic_subscription(
                                                                                                                                            mw_zonal_traffic_subscription(
                                                                                                                                                                          PX_CLIENT_ID, //clientCorrelator
                                                                                                                                                                          PX_TRAFFIC_SUB_CALLBACK_URI, // callbackReference
                                                                                                                                                                          PX_ZONE_ID // zoneId
                                                                                                                                                                          )))))) -> value v_response {
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
          // TODO how to send this when the UE enters the area? The TP has the IUT doing this immediately. Do we want this or will it be discarded as part of the test?
               // MEC 013, clause 7.3.5.3
//               the IUT entity sends a vPOST containing
//                  Uri set to CALLBACK_URL
//                  body containing
//                     zonalPresenceNotification containing
//                        clientCorrelator set to CLIENT_ID,
//                        zoneId indicating value ZONE_ID
//                     ;
//                  ;
//               ;
//               to the MEC_APP entity

          tc_ac.stop;

          log("*** " & testcasename() & ": PASS: IUT successfully responds with a circleNotificationSubscription ***");
          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

1059
1060
1061
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TC_MEC_SRV_UEINFOSUB_001_OK
1062
1063
1064
1065

    /**
     * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
     */
1066
1067
1068
    testcase TC_MEC_SRV_UEINFOSUB_001_BR() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var HeaderLines v_headers;
1069

1070
1071
1072
1073
1074
1075
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_LOCATION_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_LOCATION_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086

      // 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(
1087
                                                       "/" & PICS_ROOT_API & oct2char(unichar2oct(PX_UE_ZONAL_TRAF_SUB_URI, "UTF-8")),
1088
1089
                                                       v_headers,
                                                       m_http_message_body_json(
1090
1091
1092
                                                                                m_body_json_circle_notification_subscription(
                                                                                                                      m_circle_notification_subscription(
                                                                                                                                                  PX_CLIENT_ID, //clientCorrelator
1093
1094
            // TODO the TP uses a wrong field name to trigger an error response. Do we create a new data structure just for this or
            // change the test to use another trigger?
1095
1096
1097
1098
                                                                                                                                                  PX_TRAFFIC_SUB_CALLBACK_URI, // callbackReference
                                                                                                                                                  PX_ZONE_ID // zoneId
                                                                                                                                                  )
                                                                                                                      )
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
                                                                                )
                                                       )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);

      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
1110
1111
                                             mw_http_response_400_bad_request
                                             )) {
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123

          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

1124
1125
1126
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TC_MEC_SRV_UEINFOSUB_001_BR
1127
1128
1129
1130

    /**
     * @desc Check that the IUT acknowledges the cancellation of UE information change notifications when commanded by a MEC Application
     */
1131
1132
1133
    testcase TC_MEC_SRV_UEINFOSUB_002_OK() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var HeaderLines v_headers;
1134

1135
1136
1137
1138
1139
1140
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_LOCATION_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_LOCATION_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151

      // 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(
1152
1153
1154
                                                         "/" & PICS_ROOT_API & oct2char(unichar2oct(PX_UE_ZONAL_TRAF_SUB_URI, "UTF-8")) & oct2char(unichar2oct(PX_SUBSCRIPTION_ID, "UTF-8")),
                                                         v_headers
                                                         )
1155
1156
1157
1158
1159
1160
1161
1162
1163
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);

      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
1164
1165
                                             mw_http_response_204_no_content
                                             )) {
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177

          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

1178
1179
1180
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TC_MEC_SRV_UEINFOSUB_002_OK
1181
1182
1183
1184

    /**
     * @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
     */
1185
1186
1187
    testcase TC_MEC_SRV_UEINFOSUB_002_NF() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var HeaderLines v_headers;
1188

1189
1190
1191
1192
1193
1194
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_LOCATION_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_LOCATION_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205

      // 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(
1206
1207
1208
                                                         "/" & PICS_ROOT_API & oct2char(unichar2oct(PX_UE_ZONAL_TRAF_SUB_URI, "UTF-8")) & oct2char(unichar2oct(PX_NON_EXISTENT_SUBSCRIPTION_ID, "UTF-8")),
                                                         v_headers
                                                         )
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
                                   )
                    );
      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 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

1232
1233
1234
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TC_MEC_SRV_UEINFOSUB_002_NF
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245

  } // End of group ueInformationSubscription

   /*
    * UE Location Lookup (UELOCLOOK)
    */
  group ueLocationLookup {

    /**
     * @desc Check that the IUT responds with a list for the location of User Equipments when queried by a MEC Application
     */
1246
    testcase TC_MEC_SRV_UELOCLOOK_001_OK() runs on HttpComponent system HttpTestAdapter {
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
        // Local variables
        var HeaderLines v_headers;

        // Test control
        if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_LOCATION_API_SUPPORTED)) {
            log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_LOCATION_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(
1267
                                                      "/" & PICS_ROOT_API & PX_UE_LOC_USERS_URI & "?zoneId=" & oct2char(unichar2oct(PX_ZONE_ID, "UTF-8")),
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
                                                      v_headers
                                                      )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);

      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
1279
                                             mw_http_response_ok(
1280
                                                                 mw_http_message_body_json(
1281
1282
1283
1284
                                                                                           mw_body_json_user_info(
                                                                                                                  mw_user_info(
                                                                                                                               PX_ZONE_ID // zoneId
                                                                                                                               )))))) {
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296

          tc_ac.stop;

          log("*** " & testcasename() & ": PASS: IUT successfully responds with a 200 OK ***");
          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

1297
1298
1299
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TC_MEC_SRV_UELOCLOOK_001_OK
1300
1301
1302
1303

    /**
     * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
     */
1304
1305
1306
    testcase TC_MEC_SRV_UELOCLOOK_001_BR() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var HeaderLines v_headers;
1307

1308
1309
1310
1311
1312
1313
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_LOCATION_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_LOCATION_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324

      // 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(
1325
                                                      "/" & PICS_ROOT_API & PX_UE_LOC_USERS_URI & "?zone=" & oct2char(unichar2oct(PX_ZONE_ID, "UTF-8")),
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
                                                      v_headers
                                                      )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);

      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
1337
1338
                                             mw_http_response_400_bad_request
                                             )) {
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350

          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

1351
1352
1353
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TC_MEC_SRV_UELOCLOOK_001_BR
1354
1355
1356
1357

    /**
     * @desc Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application
     */
1358
    testcase TC_MEC_SRV_UELOCLOOK_001_NF() runs on HttpComponent system HttpTestAdapter {
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
        // Local variables
        var HeaderLines v_headers;

        // Test control
        if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_LOCATION_API_SUPPORTED)) {
            log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_LOCATION_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(
1379
                                                      "/" & PICS_ROOT_API & PX_UE_LOC_USERS_URI & "?zoneId=" & oct2char(unichar2oct(PX_NON_EXISTENT_ZONE_ID, "UTF-8")),
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
                                                      v_headers
                                                      )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);

      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
1391
1392
                                             mw_http_response_404_not_found
                                             )) {
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404

          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

1405
1406
1407
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TC_MEC_SRV_UELOCLOOK_001_NF
1408
1409
1410

  } // End of group ueLocationLookup

1411
1412
1413
  /*
   * UE Location Subscription (UELOCSUB)
   */
1414
1415
1416
1417
1418
  group ueLocationSubscription {

    /**
     * @desc Check that the IUT acknowledges the UE location change subscription request when commanded by a MEC Application and notifies it when the location changes
     */
1419
1420
1421
1422
    testcase TC_MEC_SRV_UELOCSUB_001_OK() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var HeaderLines v_headers;
      var HttpMessage v_response;
1423

1424
1425
1426
1427
1428
1429
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_LOCATION_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_LOCATION_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440

      // 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(
1441
                                                       "/" & PICS_ROOT_API & PX_UE_LOC_USERTRACK_SUB_URI,
1442
1443
1444
                                                       v_headers,
                                                       m_http_message_body_json(
                                                                                m_body_json_user_tracking_subscription(
1445
1446
1447
1448
1449
1450
                                                                                                                       m_user_tracking_subscription(
                                                                                                                                                    PX_CLIENT_ID, //clientCorrelator
                                                                                                                                                    PX_USERTRACK_SUB_CALLBACK_URI, // callbackReference
                                                                                                                                                    PX_IP_ADDRESS // address
                                                                                                                                                    )
                                                                                                                       )
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
                                                                                )
                                                       )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);

      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
                                             mw_http_response_201_created(
1463
1464
1465
1466
1467
1468
1469
                                                                          mw_http_message_body_json(
                                                                                                    mw_body_json_user_tracking_subscription(
                                                                                                                                            mw_user_tracking_subscription(
                                                                                                                                                                          PX_CLIENT_ID, //clientCorrelator
                                                                                                                                                                          PX_USERTRACK_SUB_CALLBACK_URI, // callbackReference
                                                                                                                                                                          PX_IP_ADDRESS // address
                                                                                                                                                                          )))))) -> value v_response {
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
          // TODO how to send this when the UE enters the area? The TP has the IUT doing this immediately. Do we want this or will it be discarded as part of the test?
               // MEC 013, clause 7.3.4.3
//               the IUT entity sends a vPOST containing
//                  Uri set to CALLBACK_URL
//                  body containing
//                     zonalPresenceNotification containing
//                        clientCorrelator set to CLIENT_ID,
//                        address set to IP_ADDRESS
//                     ;
//                  ;
//               ;
//               to the MEC_APP entity

          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

1494
1495
1496
      // Postamble
      f_cf_01_http_down();
    } // End of testcase TC_MEC_SRV_UELOCSUB_001_OK
1497
1498
1499
1500

    /**
     * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
     */
1501
1502
1503
    testcase TC_MEC_SRV_UELOCSUB_001_BR() runs on HttpComponent system HttpTestAdapter {
      // Local variables
      var HeaderLines v_headers;
1504

1505
1506
1507
1508
1509
1510
      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_LOCATION_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_LOCATION_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521

      // 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(
1522
                                                       "/" & PICS_ROOT_API & PX_UE_LOC_USERTRACK_SUB_URI,
1523
1524
1525
                                                       v_headers,
                                                       m_http_message_body_json(
                                                                                m_body_json_user_tracking_subscription(
1526
1527
                                                                                                                       m_user_tracking_subscription(
                                                                                                                                                    PX_CLIENT_ID, //clientCorrelator
1528
1529
            // TODO the TP uses a wrong field name to trigger an error response. Do we create a new data structure just for this or
            // change the test to use another trigger?
1530
1531
1532
1533
                                                                                                                                                    PX_USERTRACK_SUB_CALLBACK_URI, // callbackReference
                                                                                                                                                    PX_IP_ADDRESS // address
                                                                                                                                                    )
                                                                                                                       )
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
                                                                                )
                                                       )
                                   )
                    );