AtsMec_AppEnablementAPI_TestCases.ttcn 138 KB
Newer Older
YannGarcia's avatar
YannGarcia 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, Draft ETSI GS MEC 011 V2.0.8
YannGarcia's avatar
YannGarcia committed
11
12
 */
module AtsMec_AppEnablementAPI_TestCases {
13

YannGarcia's avatar
YannGarcia committed
14
  // Libcommon
YannGarcia's avatar
YannGarcia committed
15
  import from LibCommon_BasicTypesAndValues all;
YannGarcia's avatar
YannGarcia committed
16
  import from LibCommon_Sync all;
17

YannGarcia's avatar
YannGarcia committed
18
19
20
21
22
23
  // 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;
24

YannGarcia's avatar
YannGarcia committed
25
  // LibMec/AppEnablementAPI
YannGarcia's avatar
YannGarcia committed
26
27
28
  import from AppEnablementAPI_Templates all;
  import from AppEnablementAPI_Pics all;
  import from AppEnablementAPI_Pixits all;
YannGarcia's avatar
YannGarcia committed
29

YannGarcia's avatar
YannGarcia committed
30
31
32
33
  // LibMec
  import from LibMec_Functions all;
  import from LibMec_Pics all;
  import from LibMec_Pixits all;
34
35
36
37
38


   /*
    * Application Service Availability Query (APPSAQ)
    */
YannGarcia's avatar
YannGarcia committed
39
  group app_saq {
40
41
42
43
44

    /**
     * @desc Check that the IUT responds with a list of available MEC services for a given application instance when queried by a MEC Application
     * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/APPSAQ/PlatAppServices.tplan2
     */
45
    testcase TC_MEC_SRV_APPSAQ_001_OK() runs on HttpComponent system HttpTestAdapter {
YannGarcia's avatar
YannGarcia committed
46
      // Local variables
Yann Garcia's avatar
Yann Garcia committed
47
      var Headers v_headers;
48

YannGarcia's avatar
YannGarcia committed
49
      // Test control
50
51
52
53
54
55
56
57
58
59
60
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }

      // Test component configuration
      f_cf_01_http_up();

      // Test adapter configuration

YannGarcia's avatar
YannGarcia committed
61
62
63
64
65
      // Preamble
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                   m_http_request_get(
Yann Garcia's avatar
Yann Garcia committed
66
                                                       "/" & PICS_ROOT_API & PICS_ROOT_API & PX_MEC_SVC_MGMT_APPS_URI & "/" & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/services",
YannGarcia's avatar
YannGarcia committed
67
68
69
70
71
                                                      v_headers
                                                      )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
72

YannGarcia's avatar
YannGarcia committed
73
74
75
76
77
78
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
                                             mw_http_response_ok(
YannGarcia's avatar
YannGarcia committed
79
80
81
                                                                 mw_http_message_body_json(
                                                                                           mw_body_json_service_info_list
                                                                                           )))) {
YannGarcia's avatar
YannGarcia committed
82
          tc_ac.stop;
83
84

          log("*** " & testcasename() & ": PASS: IUT successfully responds with a ServiceInfoList ***");
YannGarcia's avatar
YannGarcia committed
85
86
87
88
89
90
91
          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
92

YannGarcia's avatar
YannGarcia committed
93
94
      // Postamble
      f_cf_01_http_down();
95
    } // End of testcase TC_MEC_SRV_APPSAQ_001_OK
96

YannGarcia's avatar
YannGarcia committed
97
    /**
98
99
     * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
     * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/APPSAQ/PlatAppServices.tplan2
YannGarcia's avatar
YannGarcia committed
100
     */
101
    testcase TC_MEC_SRV_APPSAQ_001_BR() runs on HttpComponent system HttpTestAdapter {
YannGarcia's avatar
YannGarcia committed
102
      // Local variables
Yann Garcia's avatar
Yann Garcia committed
103
      var Headers v_headers;
104

YannGarcia's avatar
YannGarcia committed
105
      // Test control
106
107
      if (not(PICS_MEC_PLAT) or not (PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_API_SUPPORTED required for executing the TC ***");
YannGarcia's avatar
YannGarcia committed
108
109
110
        setverdict(inconc);
        stop;
      }
111

YannGarcia's avatar
YannGarcia committed
112
113
      // Test component configuration
      f_cf_01_http_up();
114

YannGarcia's avatar
YannGarcia committed
115
      // Test adapter configuration
116

YannGarcia's avatar
YannGarcia committed
117
118
119
120
121
      // Preamble
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                   m_http_request_get(
Yann Garcia's avatar
Yann Garcia committed
122
                                                       "/" & PICS_ROOT_API & PICS_ROOT_API & PX_MEC_SVC_MGMT_APPS_URI & "/" & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/services?instance_id=" & oct2char(unichar2oct(PX_NON_EXISTENT_APP_INSTANCE_ID)),
YannGarcia's avatar
YannGarcia committed
123
124
125
126
127
                                                      v_headers
                                                      )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
128

YannGarcia's avatar
YannGarcia committed
129
130
131
132
133
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
134
135
                                             mw_http_response_400_bad_request
                                             )) {
YannGarcia's avatar
YannGarcia committed
136
          tc_ac.stop;
137
138

          log("*** " & testcasename() & ": PASS: IUT successfully responds with a ProblemDetails set to 400 Bad Request ***");
YannGarcia's avatar
YannGarcia committed
139
140
141
142
143
144
145
          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
146

YannGarcia's avatar
YannGarcia committed
147
148
      // Postamble
      f_cf_01_http_down();
149
    } // End of testcase TC_MEC_SRV_APPSAQ_001_BR
150

YannGarcia's avatar
YannGarcia committed
151
    /**
152
153
     * @desc Check that the IUT notifies the authorised relevant (subscribed) application instances when a new service for a given application instance is registered.
     * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/APPSAQ/PlatAppServices.tplan2
YannGarcia's avatar
YannGarcia committed
154
     */
155
    testcase TC_MEC_SRV_APPSAQ_002_OK() runs on HttpComponent system HttpTestAdapter {
YannGarcia's avatar
YannGarcia committed
156
      // Local variables
Yann Garcia's avatar
Yann Garcia committed
157
      var Headers v_headers;
YannGarcia's avatar
YannGarcia committed
158
      var HttpMessage v_response;
159

YannGarcia's avatar
YannGarcia committed
160
      // Test control
YannGarcia's avatar
YannGarcia committed
161
      if (not(PICS_MEC_PLAT) or not (PICS_SERVICES) or not (PICS_NOTIFICATIONS) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) {
162
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PIC_NOTIFICATIONS and PICS_APP_ENABLEMENT_API_SUPPORTED required for executing the TC ***");
YannGarcia's avatar
YannGarcia committed
163
164
165
        setverdict(inconc);
        stop;
      }
166

YannGarcia's avatar
YannGarcia committed
167
168
      // Test component configuration
      f_cf_01_http_up();
169

YannGarcia's avatar
YannGarcia committed
170
      // Test adapter configuration
171

YannGarcia's avatar
YannGarcia committed
172
173
174
175
      // Preamble
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
176
                                   m_http_request_post(
Yann Garcia's avatar
Yann Garcia committed
177
                                                        "/" & PICS_ROOT_API & PICS_ROOT_API & PX_MEC_SVC_MGMT_APPS_URI & "/" & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/services",
178
179
180
                                                       v_headers,
                                                       m_http_message_body_json(
                                                                                m_body_json_service_info(
YannGarcia's avatar
YannGarcia committed
181
182
183
184
                                                                                                         m_service_info(
                                                                                                                        PX_SERVICE_NAME
                                                                                                                        )
                                                                                                         )
185
186
                                                                                )
                                                       )
YannGarcia's avatar
YannGarcia committed
187
188
189
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
190

YannGarcia's avatar
YannGarcia committed
191
192
193
194
195
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
196
                                             mw_http_response_201_created(
YannGarcia's avatar
YannGarcia committed
197
                                                                 mw_http_message_body_json(
198
199
200
                                                                                           mw_body_json_service_info(
                                                                                                                          mw_service_info(
                                                                                                                                          PX_SERVICE_NAME //serName
YannGarcia's avatar
YannGarcia committed
201
202
203
204
                                                                                                                                          )))))) -> value v_response {
          tc_ac.stop;
          
          if (f_check_headers(valueof(v_response.response.header)) == true) {
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
/* TODO how to test this as the notification is for another MEC Application?
               and
               // MEC 011, clause 6.4.2
               the IUT entity sends a notification_message containing
                  body containing
                     notificationType set to "SerAvailabilityNotification",
                     services containing
                        serName set to SERVICE_NAME
                     _links containing
                        subscription set to MP1_SUBSCRIPTION_A
                     ;
                     ;
                  ;
               ;
               to the MEC_APP_Subscriber entity
*/
YannGarcia's avatar
YannGarcia committed
221
222
223
224
225
226
            log("*** " & testcasename() & ": PASS: IUT successfully responds with a ServiceInfo and set notofocation ***");
            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
          } else {
            log("*** " & testcasename() & ": FAIL: Header 'Location' was not present in the response headers ***");
            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
          }
YannGarcia's avatar
YannGarcia committed
227
228
229
230
231
232
        }
        [] tc_ac.timeout {
          log("*** " & testcasename() & ": INCONC: Expected message not received ***");
          f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
        }
      } // End of 'alt' statement
233

YannGarcia's avatar
YannGarcia committed
234
235
      // Postamble
      f_cf_01_http_down();
236
    } // End of testcase TC_MEC_SRV_APPSAQ_002_OK
237

YannGarcia's avatar
YannGarcia committed
238
    /**
239
240
     * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
     * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/APPSAQ/PlatAppServices.tplan2
YannGarcia's avatar
YannGarcia committed
241
     */
242
    testcase TC_MEC_SRV_APPSAQ_002_BR() runs on HttpComponent system HttpTestAdapter {
YannGarcia's avatar
YannGarcia committed
243
      // Local variables
Yann Garcia's avatar
Yann Garcia committed
244
      var Headers v_headers;
245

YannGarcia's avatar
YannGarcia committed
246
      // Test control
247
248
      if (not(PICS_MEC_PLAT) or not (PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_API_SUPPORTED required for executing the TC ***");
YannGarcia's avatar
YannGarcia committed
249
250
251
        setverdict(inconc);
        stop;
      }
252

YannGarcia's avatar
YannGarcia committed
253
254
      // Test component configuration
      f_cf_01_http_up();
255

YannGarcia's avatar
YannGarcia committed
256
      // Test adapter configuration
257

YannGarcia's avatar
YannGarcia committed
258
259
      // Preamble
      f_init_default_headers_list(-, -, v_headers);
260

YannGarcia's avatar
YannGarcia committed
261
262
263
      httpPort.send(
                    m_http_request(
                                   m_http_request_post(
Yann Garcia's avatar
Yann Garcia committed
264
                                                       "/" & PICS_ROOT_API & PICS_ROOT_API & PX_MEC_SVC_MGMT_APPS_URI & "/" & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/services",
YannGarcia's avatar
YannGarcia committed
265
266
                                                       v_headers,
                                                       m_http_message_body_json(
267
                                                                                m_body_json_service_info(
YannGarcia's avatar
YannGarcia committed
268
269
270
                                                                                                         m_service_info(
                                                                                                                        PX_NON_EXISTENT_SERVICE_NAME
                                                                                                                        )
271
                                                                                                                 )
YannGarcia's avatar
YannGarcia committed
272
273
274
275
276
                                                                                )
                                                       )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
277

YannGarcia's avatar
YannGarcia committed
278
279
280
281
282
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
YannGarcia's avatar
YannGarcia committed
283
                                             mw_http_response_400_bad_request
284
285
286
287
288
289
290
291
292
293
294
295
296
297
                                             )) {
          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);
        }
      } // End of 'alt' statement

      // Postamble
      f_cf_01_http_down();
298
    } // End of testcase TC_MEC_SRV_APPSAQ_002_BR
299
300
301
302
303

    /**
     * @desc Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application
     * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/APPSAQ/PlatAppServices.tplan2
     */
304
    testcase TC_MEC_SRV_APPSAQ_002_NF() runs on HttpComponent system HttpTestAdapter {
305
      // Local variables
Yann Garcia's avatar
Yann Garcia committed
306
      var Headers v_headers;
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324

      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_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_post(
Yann Garcia's avatar
Yann Garcia committed
325
                                                       "/" & PICS_ROOT_API & PICS_ROOT_API & PX_MEC_SVC_MGMT_APPS_URI & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_APP_INSTANCE_ID, "UTF-8")) & "/services",
326
327
328
                                                       v_headers,
                                                       m_http_message_body_json(
                                                                                m_body_json_service_info(
YannGarcia's avatar
YannGarcia committed
329
330
331
332
                                                                                                         m_service_info(
                                                                                                                        PX_SERVICE_NAME
                                                                                                                        )
                                                                                                         )
333
334
335
336
337
338
339
340
341
342
343
                                                                                )
                                                       )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);

      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
YannGarcia's avatar
YannGarcia committed
344
                                             mw_http_response_404_not_found
345
346
347
348
                                             )) {
          tc_ac.stop;

          log("*** " & testcasename() & ": PASS: IUT successfully responds with a ProblemDetails set to 404 Not Found ***");
YannGarcia's avatar
YannGarcia committed
349
350
351
352
353
354
355
          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
356
357
358

      // Postamble
      f_cf_01_http_down();
359
    } // End of testcase TC_MEC_SRV_APPSAQ_002_NF
360
361
362
363
364

    /**
     * @desc Check that the IUT responds with the information on a specific service for a given application instance when queried by a MEC Application
     * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/APPSAQ/PlatAppServices.tplan2
     */
365
    testcase TC_MEC_SRV_APPSAQ_003_OK() runs on HttpComponent system HttpTestAdapter {
366
      // Local variables
Yann Garcia's avatar
Yann Garcia committed
367
      var Headers v_headers;
368
369
370
371
372
373
374
375
376
377
378
379
380

      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }

      // Test component configuration
      f_cf_01_http_up();

      // Test adapter configuration

YannGarcia's avatar
YannGarcia committed
381
382
383
384
385
      // Preamble
      f_init_default_headers_list(-, -, v_headers);
      httpPort.send(
                    m_http_request(
                                   m_http_request_get(
Yann Garcia's avatar
Yann Garcia committed
386
                                                       "/" & PICS_ROOT_API & PICS_ROOT_API & PX_MEC_SVC_MGMT_APPS_URI & "/" & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/services/" & oct2char(unichar2oct(PX_SERVICE_ID, "UTF-8")),
YannGarcia's avatar
YannGarcia committed
387
388
389
390
391
                                                      v_headers
                                                      )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);
392

YannGarcia's avatar
YannGarcia committed
393
394
395
396
397
      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
398
                                             mw_http_response_ok(
YannGarcia's avatar
YannGarcia committed
399
400
401
402
403
404
                                                                 mw_http_message_body_json(
                                                                                           mw_body_json_service_info(
                                                                                                                    mw_service_info(
                                                                                                                                    -, -, -, -,
                                                                                                                                    PX_SERVICE_ID
                                                                                                                                    )))))) {
405
406
407
          tc_ac.stop;

          log("*** " & testcasename() & ": PASS: IUT successfully responds with a ServiceInfo ***");
YannGarcia's avatar
YannGarcia committed
408
409
410
411
412
413
414
          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
415
416
417

      // Postamble
      f_cf_01_http_down();
418
    } // End of testcase TC_MEC_SRV_APPSAQ_003_OK
419
420
421
422
423

    /**
     * @desc Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application
     * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/APPSAQ/PlatAppServices.tplan2
     */
424
    testcase TC_MEC_SRV_APPSAQ_003_NF() runs on HttpComponent system HttpTestAdapter {
425
      // Local variables
Yann Garcia's avatar
Yann Garcia committed
426
      var Headers v_headers;
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444

      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_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(
Yann Garcia's avatar
Yann Garcia committed
445
                                                      "/" & PICS_ROOT_API & PICS_ROOT_API & PX_MEC_SVC_MGMT_APPS_URI & "/" & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/services/" & oct2char(unichar2oct(PX_NON_EXISTENT_SERVICE_ID, "UTF-8")),
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
                                                      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();
472
    } // End of testcase TC_MEC_SRV_APPSAQ_003_NF
473
474
475
476
477

    /**
     * @desc Check that the IUT updates a service information for a given application instance when commanded by a MEC Application
     * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/APPSAQ/PlatAppServices.tplan2
     */
478
    testcase TC_MEC_SRV_APPSAQ_004_OK() runs on HttpComponent system HttpTestAdapter {
479
      // Local variables
Yann Garcia's avatar
Yann Garcia committed
480
      var Headers v_headers;
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499

      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }

      // 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(
Yann Garcia's avatar
Yann Garcia committed
500
                                                       "/" & PICS_ROOT_API & PICS_ROOT_API & PX_MEC_SVC_MGMT_APPS_URI & "/" & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/services/" & oct2char(unichar2oct(PX_SERVICE_ID, "UTF-8")),
501
502
503
                                                       v_headers,
                                                       m_http_message_body_json(
                                                                                m_body_json_service_info(
YannGarcia's avatar
YannGarcia committed
504
505
506
                                                                                                         m_service_info(
                                                                                                                        PX_SERVICE_NAME,
                                                                                                                        PX_NEW_SERVICE_INFO_VERSION
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
                                                                                                                        )
                                                                                                         )
                                                                                )
                                                       )
                                   )
                    );
      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_service_info(
YannGarcia's avatar
YannGarcia committed
523
524
525
526
                                                                                                                     mw_service_info(
                                                                                                                                     PX_SERVICE_NAME,
                                                                                                                                     PX_NEW_SERVICE_INFO_VERSION
                                                                                                                                     )))))) {
527
528
529
530
531
532
533
534
535
536
537
538
539
          tc_ac.stop;

          log("*** " & testcasename() & ": PASS: IUT successfully responds with a ServiceInfo ***");
          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();
540
    } // End of testcase TC_MEC_SRV_APPSAQ_004_OK
541
542
543
544
545

    /**
     * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
     * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/APPSAQ/PlatAppServices.tplan2
     */
546
    testcase TC_MEC_SRV_APPSAQ_004_BR() runs on HttpComponent system HttpTestAdapter {
547
      // Local variables
Yann Garcia's avatar
Yann Garcia committed
548
      var Headers v_headers;
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568

      // Test control
      if (not(PICS_MEC_PLAT) or not (PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }

      // 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(
Yann Garcia's avatar
Yann Garcia committed
569
                                                       "/" & PICS_ROOT_API & PICS_ROOT_API & PX_MEC_SVC_MGMT_APPS_URI & "/" & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/services/" & oct2char(unichar2oct(PX_SERVICE_ID, "UTF-8")),
570
571
572
                                                       v_headers,
                                                       m_http_message_body_json(
                                                                                m_body_json_service_info(
YannGarcia's avatar
YannGarcia committed
573
574
575
576
577
                                                                                                         m_service_info(
                                                                                                                        PX_SERVICE_NAME,
                                                                                                                        PX_NEW_SERVICE_INFO_VERSION // TODO the parameter name should be an invalid one to trigger the error. How to do it?
                                                                                                                        )
                                                                                                         )
578
579
580
581
582
583
584
585
586
587
588
                                                                                )
                                                       )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);

      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
YannGarcia's avatar
YannGarcia committed
589
                                             mw_http_response_400_bad_request
590
591
592
593
594
595
596
597
598
599
600
601
602
603
                                             )) {
          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);
        }
      } // End of 'alt' statement

      // Postamble
      f_cf_01_http_down();
604
    } // End of testcase TC_MEC_SRV_APPSAQ_004_BR
605
606
607
608
609

    /**
     * @desc Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application
     * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/APPSAQ/PlatAppServices.tplan2
     */
610
    testcase TC_MEC_SRV_APPSAQ_004_NF() runs on HttpComponent system HttpTestAdapter {
611
      // Local variables
Yann Garcia's avatar
Yann Garcia committed
612
      var Headers v_headers;
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631

      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }

      // 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(
Yann Garcia's avatar
Yann Garcia committed
632
                                                       "/" & PICS_ROOT_API & PICS_ROOT_API & PX_MEC_SVC_MGMT_APPS_URI & "/" & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/services/" & oct2char(unichar2oct(PX_NON_EXISTENT_SERVICE_ID, "UTF-8")),
633
634
635
                                                       v_headers,
                                                       m_http_message_body_json(
                                                                                m_body_json_service_info(
YannGarcia's avatar
YannGarcia committed
636
637
638
639
640
                                                                                                         m_service_info(
                                                                                                                        PX_SERVICE_NAME,
                                                                                                                        PX_NEW_SERVICE_INFO_VERSION
                                                                                                                        )
                                                                                                         )
641
642
643
644
645
646
647
648
649
650
651
                                                                                )
                                                       )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);

      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
YannGarcia's avatar
YannGarcia committed
652
                                             mw_http_response_404_not_found
653
654
655
656
657
658
659
660
661
662
663
664
665
666
                                             )) {
          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();
667
    } // End of testcase TC_MEC_SRV_APPSAQ_004_NF
668
669
670
671
672

    /**
     * @desc Check that the IUT responds with an error when a request sent by a MEC Application doesn't comply with a required condition
     * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/APPSAQ/PlatAppServices.tplan2
     */
673
    testcase TC_MEC_SRV_APPSAQ_004_PF() runs on HttpComponent system HttpTestAdapter {
674
      // Local variables
Yann Garcia's avatar
Yann Garcia committed
675
      var Headers v_headers;
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694

      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_API_SUPPORTED required for executing the TC ***");
        setverdict(inconc);
        stop;
      }

      // 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(
Yann Garcia's avatar
Yann Garcia committed
695
                                                       "/" & PICS_ROOT_API & PICS_ROOT_API & PX_MEC_SVC_MGMT_APPS_URI & "/" & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/services/" & oct2char(unichar2oct(PX_SERVICE_ID, "UTF-8")),
696
697
698
                                                       v_headers,
                                                       m_http_message_body_json(
                                                                                m_body_json_service_info(
YannGarcia's avatar
YannGarcia committed
699
700
701
702
703
                                                                                                         m_service_info(
                                                                                                                        PX_SERVICE_NAME,
                                                                                                                        PX_NEW_SERVICE_INFO_VERSION
                                                                                                                        )
                                                                                                         )
704
705
706
707
708
709
710
711
712
713
714
                                                                                )
                                                       )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);

      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
YannGarcia's avatar
YannGarcia committed
715
                                             mw_http_response_412_precondition_failed
716
717
718
719
720
721
722
723
724
725
726
727
728
729
                                             )) {
          tc_ac.stop;

          log("*** " & testcasename() & ": PASS: IUT successfully responds with a ProblemDetails set to 412 Precondition Failed ***");
          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();
730
    } // End of testcase TC_MEC_SRV_APPSAQ_004_PF
731

YannGarcia's avatar
YannGarcia committed
732
  } // End of group app_saq
733
734
735
736

   /*
    * Application Subscriptions (APPSUB)
    */
YannGarcia's avatar
YannGarcia committed
737
  group app_sub {
738
739
740
741
742

    /**
     * @desc Check that the IUT responds with a list of subscriptions for notifications on services availability when queried by a MEC Application
     * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/APPSAQ/PlatAppSubscriptions.tplan2
     */
743
    testcase TC_MEC_SRV_APPSUB_001_OK() runs on HttpComponent system HttpTestAdapter {
744
      // Local variables
Yann Garcia's avatar
Yann Garcia committed
745
      var Headers v_headers;
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763

      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_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(
YannGarcia's avatar
YannGarcia committed
764
                                                      "/" & PICS_ROOT_API & PX_ME_APP_SUPPORT_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/subscriptions",
765
766
767
768
769
770
771
772
773
774
775
776
                                                      v_headers
                                                      )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);

      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
                                             mw_http_response_ok(
YannGarcia's avatar
YannGarcia committed
777
778
779
780
                                                                 mw_http_message_body_json(
                                                                                           mw_body_json_subscription_link_list(
                                                                                                                               mw_subscription_link_list
                                                                                                                               ))))) {
781
782
783
784
785
786
787
788
789
790
791
792
793
          tc_ac.stop;

          log("*** " & testcasename() & ": PASS: IUT successfully responds with a Mp1SubscriptionLinkList ***");
          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();
794
    } // End of testcase TC_MEC_SRV_APPSUB_001_OK
795
796
797
798
799

    /**
     * @desc Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application
     * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/APPSAQ/PlatAppSubscriptions.tplan2
     */
800
    testcase TC_MEC_SRV_APPSUB_001_NF() runs on HttpComponent system HttpTestAdapter {
801
      // Local variables
Yann Garcia's avatar
Yann Garcia committed
802
      var Headers v_headers;
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820

      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_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(
Yann Garcia's avatar
Yann Garcia committed
821
                                                       "/" & PICS_ROOT_API & PICS_ROOT_API & PX_MEC_SVC_MGMT_APPS_URI & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_APP_INSTANCE_ID, "UTF-8")) & "/subscriptions",
822
823
824
825
826
827
828
829
830
831
832
                                                      v_headers
                                                      )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);

      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
YannGarcia's avatar
YannGarcia committed
833
                                             mw_http_response_404_not_found
834
835
836
837
838
839
840
841
842
843
844
845
846
847
                                             )) {
          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();
848
    } // End of testcase TC_MEC_SRV_APPSUB_001_NF
849
850
851
852
853

    /**
     * @desc Check that the IUT acknowledges the subscription by a MEC Application to notifications on service availability events.
     * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/APPSAQ/PlatAppSubscriptions.tplan2
     */
854
    testcase TC_MEC_SRV_APPSUB_002_OK() runs on HttpComponent system HttpTestAdapter {
855
      // Local variables
Yann Garcia's avatar
Yann Garcia committed
856
      var Headers v_headers;
YannGarcia's avatar
YannGarcia committed
857
      var HttpMessage v_response;
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875

      // Test control
      if (not(PICS_MEC_PLAT) or not (PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_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_post(
YannGarcia's avatar
YannGarcia committed
876
                                                      "/" & PICS_ROOT_API & PX_ME_APP_SUPPORT_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/subscriptions",
877
878
879
                                                       v_headers,
                                                       m_http_message_body_json(
                                                                                m_body_json_app_termination_notif_subscription(
YannGarcia's avatar
YannGarcia committed
880
881
882
883
884
885
886
                                                                                                                               m_app_termination_notif_subscription(
                                                                                                                                                                    PX_APP_TERM_NOTIF_CALLBACK_URI,
                                                                                                                                                                    m_self(
                                                                                                                                                                           { href := PX_HREF }
                                                                                                                                                                           ),
                                                                                                                                                                    PX_APP_INSTANCE_ID
                                                                                                                                                                    )
887
888
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(
                                                                 mw_http_message_body_json(
YannGarcia's avatar
YannGarcia committed
901
902
903
904
                                                                                           mw_body_json_app_termination_notif_subscription(
                                                                                                                                           mw_app_termination_notif_subscription(
                                                                                                                                                                                 PX_APP_TERM_NOTIF_CALLBACK_URI
                                                                                                                                                                                 )))))) -> value v_response {
905
906
          tc_ac.stop;

YannGarcia's avatar
YannGarcia committed
907
908
909
910
911
912
913
          if (f_check_headers(valueof(v_response.response.header)) == true) {
            log("*** " & testcasename() & ": PASS: IUT successfully responds with a AppTerminationNotificationSubscription ***");
            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
          } else {
            log("*** " & testcasename() & ": FAIL: Header 'Location' was not present in the response headers ***");
            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
          }
914
915
916
917
918
919
920
921
922
        }
        [] 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();
923
    } // End of testcase TC_MEC_SRV_APPSUB_002_OK
924
925
926
927
928

    /**
     * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
     * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/APPSAQ/PlatAppSubscriptions.tplan2
     */
929
    testcase TC_MEC_SRV_APPSUB_002_BR() runs on HttpComponent system HttpTestAdapter {
930
      // Local variables
Yann Garcia's avatar
Yann Garcia committed
931
      var Headers v_headers;
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950

      // Test control
      if (not(PICS_MEC_PLAT) or not (PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) {
        log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_APP_ENABLEMENT_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_post(
YannGarcia's avatar
YannGarcia committed
951
                                                      "/" & PICS_ROOT_API & PX_ME_APP_SUPPORT_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/subscriptions",
952
953
954
                                                       v_headers,
                                                       m_http_message_body_json(
                                                                                m_body_json_app_termination_notif_subscription(
YannGarcia's avatar
YannGarcia committed
955
956
957
958
959
960
961
                                                                                                                               m_app_termination_notif_subscription_invalid(
                                                                                                                                                                            PX_APP_TERM_NOTIF_CALLBACK_URI,
                                                                                                                                                                            m_self(
                                                                                                                                                                                   { href := PX_HREF }
                                                                                                                                                                                   ),
                                                                                                                                                                            PX_APP_INSTANCE_ID
                                                                                                                                                                            )
962
963
964
965
966
967
968
969
970
971
972
973
                                                                                                                               )
                                                                                )
                                                       )
                                   )
                    );
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);

      // Test Body
      tc_ac.start;
      alt {
        [] httpPort.receive(
                            mw_http_response(
YannGarcia's avatar
YannGarcia committed
974
                                             mw_http_response_400_bad_request
975
976
977
978
979
980
981
982
983
984
985
986
987
988
                                             )) {
          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);
        }
      } // End of 'alt' statement

      // Postamble
      f_cf_01_http_down();
989
    } // End of testcase TC_MEC_SRV_APPSUB_002_BR
990
991
992
993
994

    /**
     * @desc Check that the IUT responds with the information on a specific subscription when queried by a MEC Application
     * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/APPSAQ/PlatAppSubscriptions.tplan2
     */
995
    testcase TC_MEC_SRV_APPSUB_003_OK() runs on HttpComponent system HttpTestAdapter {
996
      // Local variables
Yann Garcia's avatar
Yann Garcia committed
997
      var Headers v_headers;
998
999
1000

      // Test control
      if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_APP_ENABLEMENT_API_SUPPORTED)) {
For faster browsing, not all history is shown. View entire blame