Newer
Older
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
mw_ams_subscription(
PX_SUBSCRIPTION_TYPE,
PX_CALLBACK_REFERENCE,
-,
-,
-
)
)
)
)
)
)
{
tc_ac.stop;
log("*** " & testcasename() & ": PASS: IUT successfully responds with a AMS Subscription and 201 Created status code ***");
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
} // End of TP_MEC_SRV_AMS_004_OK
/**
* @desc Check that the AMS service sends an error when it receives a malformed request to create a notification subscription
* Permitted SUBSCRIPTION_TYPE are:
* - MobilityProcedureSubscription
* - AdjacentAppInfoSubscription
* @see ETSI GS MEC 021 2.0.8, clause 8.6.3.4
*/
testcase TP_MEC_SRV_AMS_004_BR() runs on HttpComponent system HttpTestAdapter {
var HeaderLines v_headers;
if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)){
log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***");
setverdict(inconc);
stop;
// Test component configuration
f_cf_01_http_up();
// Preamble
f_init_default_headers_list(-, -, v_headers);
httpPort.send(
m_http_request(
m_http_request_post(
"/" & PICS_ROOT_API & PX_ME_APP_AMS_SUBS,
v_headers,
m_http_message_body_json(
m_body_json_ams_subscriptions(
m_ams_subscription_error(
PX_SUBSCRIPTION_TYPE,
PX_CALLBACK_REFERENCE,
-,
-,
-
)
)
)
)
)
);
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
tc_ac.start;
alt {
[] httpPort.receive(
mw_http_response(
mw_http_response_400_bad_request(
mw_http_message_body_json(
mw_body_json_ams_problem_details(
mw_problem_details(
-, -, 400
)
)
)
)
)
)
{
log("*** " & testcasename() & ": PASS: IUT successfully responds with a Problem Details and 400 Bad request status code ***");
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
} // End of TP_MEC_SRV_AMS_004_BR
/**
* @desc Check that the AMS service returns information about a given subscription when requested.
* Permitted SUBSCRIPTION_TYPE are:
* - MobilityProcedureSubscription
* - AdjacentAppInfoSubscription
* @see ETSI GS MEC 021 2.0.8, clause 8.7.3.1
*/
testcase TP_MEC_SRV_AMS_005_OK() runs on HttpComponent system HttpTestAdapter {
var HeaderLines v_headers;
if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)){
log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***");
setverdict(inconc);
stop;
// Test component configuration
f_cf_01_http_up();
// Preamble
f_init_default_headers_list(-, -, v_headers);
httpPort.send(
m_http_request(
m_http_request_get(
"/" & PICS_ROOT_API & PX_ME_APP_AMS_SUBS & "/" & oct2char(unichar2oct(PX_SUBSCRIPTION_ID, "UTF-8")),
v_headers
)
)
);
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
tc_ac.start;
alt {
[] httpPort.receive(
mw_http_response(
mw_http_response_ok(
mw_http_message_body_json(
mw_body_json_ams_subscriptions(
mw_ams_subscription(PX_SUBSCRIPTION_TYPE, -, -, -, -)
)
)
)
)
)
{
log("*** " & testcasename() & ": PASS: IUT successfully responds with the list of subscriptions type MobilityProcedureSubscription ***");
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
} // End of TP_MEC_SRV_AMS_005_OK
/**
* @desc Check that the AMS service returns an error when receives a query about a not existing subscription
* @see ETSI GS MEC 021 2.0.8, clause 8.7.3.1
*/
testcase TP_MEC_SRV_AMS_005_NF() runs on HttpComponent system HttpTestAdapter {
var HeaderLines v_headers;
if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)){
log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***");
setverdict(inconc);
stop;
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
// Test component configuration
f_cf_01_http_up();
// Preamble
f_init_default_headers_list(-, -, v_headers);
httpPort.send(
m_http_request(
m_http_request_get(
"/" & PICS_ROOT_API & PX_ME_APP_AMS_SUBS & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_SUBSCRIPTION_ID, "UTF-8")),
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(
mw_http_message_body_json(
mw_body_json_ams_problem_details(
mw_problem_details(
-, -, 404
)
)
)
)
)
)
{
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
} // End of TP_MEC_SRV_AMS_005_NF
/**
* @desc Check that the AMS service deletes a given subscription when requested
* @see ETSI GS MEC 021 2.0.8, clause 8.7.3.5
*/
testcase TP_MEC_SRV_AMS_006_OK() runs on HttpComponent system HttpTestAdapter {
var HeaderLines v_headers;
if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)){
log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***");
setverdict(inconc);
stop;
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
// Test component configuration
f_cf_01_http_up();
// Preamble
f_init_default_headers_list(-, -, v_headers);
httpPort.send(
m_http_request(
m_http_request_delete(
"/" & PICS_ROOT_API & PX_ME_APP_AMS_SUBS & "/" & oct2char(unichar2oct(PX_SUBSCRIPTION_ID, "UTF-8")),
v_headers
)
)
);
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
tc_ac.start;
alt {
[] httpPort.receive(
mw_http_response(
)
)
{
tc_ac.stop;
log("*** " & testcasename() & ": PASS: IUT successfully responds with 204 No Content on deletion 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
} // End of TP_MEC_SRV_AMS_006_OK
* @desc Check that the AMS service sends an error when it receives a delete request for a not existing subscription
* @see ETSI GS MEC 021 2.0.8, clause 8.7.3.5
*/
testcase TP_MEC_SRV_AMS_006_NF() runs on HttpComponent system HttpTestAdapter {
var HeaderLines v_headers;
if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)){
log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***");
setverdict(inconc);
stop;
}
// Test component configuration
f_cf_01_http_up();
// Preamble
f_init_default_headers_list(-, -, v_headers);
httpPort.send(
m_http_request(
m_http_request_delete(
"/" & PICS_ROOT_API & PX_ME_APP_AMS_SUBS & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_SUBSCRIPTION_ID, "UTF-8")),
v_headers
)
)
);
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
tc_ac.start;
alt {
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
[] httpPort.receive(
mw_http_response(
mw_http_response_404_not_found(
mw_http_message_body_json(
mw_body_json_ams_problem_details(
)
)
)
)
)
{
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
} // End of TP_MEC_SRV_AMS_006_NF
/**
* @desc Check that the AMS service modifies a given subscription when requested.
* Permitted SUBSCRIPTION_TYPE are:
* - MobilityProcedureSubscription
* - AdjacentAppInfoSubscription
* @see ETSI GS MEC 021 2.0.8, clause 8.7.3.2
*/
testcase TP_MEC_SRV_AMS_007_OK() runs on HttpComponent system HttpTestAdapter {
var HeaderLines v_headers;
if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)){
log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***");
setverdict(inconc);
stop;
}
// Test component configuration
f_cf_01_http_up();
// Preamble
f_init_default_headers_list(-, -, v_headers);
httpPort.send(
m_http_request(
m_http_request_put(
"/" & PICS_ROOT_API & PX_ME_APP_AMS_SUBS & "/" & oct2char(unichar2oct(PX_SUBSCRIPTION_ID, "UTF-8")),
v_headers,
m_http_message_body_json(
m_body_json_ams_subscriptions(
m_ams_subscription(
PX_SUBSCRIPTION_TYPE, PX_CALLBACK_REFERENCE, -, -, -
)
)
)
)
)
);
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_ams_subscriptions(
mw_ams_subscription(PX_SUBSCRIPTION_TYPE, -, -, -, -)
)
)
)
)
)
{
tc_ac.stop;
log("*** " & testcasename() & ": PASS: IUT successfully responds with a AppMobilityServiceInfo ***");
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
} // End of TP_MEC_SRV_AMS_007_OK
/**
* @desc Check that the AMS service sends an error when it receives a malformed modify request for a given subscription.
* Permitted SUBSCRIPTION_TYPE are:
* - MobilityProcedureSubscription
* - AdjacentAppInfoSubscription
* @see ETSI GS MEC 021 2.0.8, clause 8.7.3.2
*/
testcase TP_MEC_SRV_AMS_007_BR() runs on HttpComponent system HttpTestAdapter {
var HeaderLines v_headers;
if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)){
log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***");
setverdict(inconc);
stop;
}
// Test component configuration
f_cf_01_http_up();
// Preamble
f_init_default_headers_list(-, -, v_headers);
httpPort.send(
m_http_request(
m_http_request_put(
"/" & PICS_ROOT_API & PX_ME_APP_AMS_SUBS & "/" & oct2char(unichar2oct(PX_SUBSCRIPTION_ID, "UTF-8")),
v_headers,
m_http_message_body_json(
m_body_json_ams_registration_request(
m_registration_request(
m_service_consumer_error(PX_APP_INS_ID, -),
-,
-
)
)
)
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
)
)
);
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
tc_ac.start;
alt {
[] httpPort.receive(
mw_http_response(
mw_http_response_400_bad_request(
mw_http_message_body_json(
mw_body_json_ams_problem_details(
)
)
)
)
)
{
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
} // End of TP_MEC_SRV_AMS_007_BR
/**
* @desc Check that the AMS service sends an error when it receives a modify request for a not existing subscription
* @see ETSI GS MEC 021 2.0.8, clause 8.7.3.2
*/
testcase TP_MEC_SRV_AMS_007_NF() runs on HttpComponent system HttpTestAdapter {
var HeaderLines v_headers;
if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)){
log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***");
setverdict(inconc);
stop;
}
// Test component configuration
f_cf_01_http_up();
// Preamble
f_init_default_headers_list(-, -, v_headers);
httpPort.send(
m_http_request(
m_http_request_put(
"/" & PICS_ROOT_API & PX_ME_APP_AMS_SUBS & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_SUBSCRIPTION_ID, "UTF-8")),
v_headers,
m_http_message_body_json(
m_body_json_ams_subscriptions(
m_ams_subscription(
PX_SUBSCRIPTION_TYPE, PX_CALLBACK_REFERENCE, -, -, -
)
)
)
)
)
);
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
tc_ac.start;
alt {
[] httpPort.receive(
mw_http_response(
mw_http_response_404_not_found(
mw_http_message_body_json(
mw_body_json_ams_problem_details(
)
)
)
)
)
{
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
} // End of TP_MEC_SRV_AMS_007_NF
} // End of group appMobilityServicesSubscriptions
group ams_notifications {
/**
* @desc Check that the AMS service sends an AMS notification about a mobility procedure if the AMS service has an associated subscription and the event is generated
* @see ETSI GS MEC 021 2.0.8, clause 7.4.2
*/
testcase TP_MEC_SRV_AMS_008_OK() runs on HttpComponent system HttpTestAdapter {
// Local variables
var HeaderLines v_headers;
// Test control
if (not(PICS_AMS) or not(PICS_AMS_NOTIFICATIONS)) {
log("*** " & testcasename() & ": PICS_AMS and PICS_AMS_NOTIFICATIONS required for executing the TC ***");
setverdict(inconc);
stop;
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
// Test component configuration
f_cf_01_http_notif_up();
// Test adapter configuration
// Preamble
f_init_default_headers_list(-, -, v_headers);
action("Trigger a mobility procedure event");
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
tc_wait.start;
alt {
[] httpPort_notif.receive(
mw_http_request(
mw_http_request_post(
PX_CALLBACK_URI,
-,
mw_http_message_body_json(
mw_body_json_mobility_procedure_notification(
mw_mobility_procedure_notification(
-,
PX_CALLBACK_REFERENCE,
-,
-,
-
)
)
)
)
)
) {
tc_wait.stop;
log("*** " & testcasename() & ": INFO: IUT successfully sends mobility procedure notification ***");
// Send 204 No Content
httpPort_notif.send(m_http_response(m_http_response_204_no_content(v_headers)));
log("*** " & testcasename() & ": PASS: IUT successfully sends mobility procedure notification ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
[] tc_wait.timeout {
log("*** " & testcasename() & ": INCONC: Expected message not received ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
}
} // End of 'alt' statement
// Postamble
f_cf_01_http_notif_down();
} // End of TP_MEC_SRV_AMS_008_OK
/**
* @desc Check that the AMS service sends an AMS notification about adjacent application instances if the AMS service has an associated subscription and the event is generated
* @see ETSI GS MEC 021 2.0.8, clause 7.4.3
*/
testcase TP_MEC_SRV_AMS_009_OK() runs on HttpComponent system HttpTestAdapter {
// Local variables
var HeaderLines v_headers;
// Test control
if (not(PICS_AMS) or not(PICS_AMS_NOTIFICATIONS)) {
log("*** " & testcasename() & ": PICS_AMS and PICS_AMS_NOTIFICATIONS required for executing the TC ***");
setverdict(inconc);
stop;
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
// Test component configuration
f_cf_01_http_notif_up();
// Test adapter configuration
// Preamble
f_init_default_headers_list(-, -, v_headers);
action("Trigger a adjacent application info event");
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
tc_wait.start;
alt {
[] httpPort_notif.receive(
mw_http_request(
mw_http_request_post(
PX_CALLBACK_URI,
-,
mw_http_message_body_json(
mw_body_json_adjacent_application_info_notification(
mw_adjacent_application_info_notification(
-,
PX_CALLBACK_REFERENCE,
-,
-,
-
)
)
)
)
)
) {
tc_wait.stop;
log("*** " & testcasename() & ": INFO: IUT successfully sends adjacent application info notification ***");
// Send 204 No Content
httpPort_notif.send(m_http_response(m_http_response_204_no_content(v_headers)));
log("*** " & testcasename() & ": PASS: IUT successfully sends adjacent application info notification ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
[] tc_wait.timeout {
log("*** " & testcasename() & ": INCONC: Expected message not received ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
}
} // End of 'alt' statement
// Postamble
f_cf_01_http_notif_down();
}
/**
* @desc Check that the AMS service sends an AMS notification on subscription expiration if the AMS service has an associated subscription and the event is generated
* @see ETSI GS MEC 021 2.0.8, clause 7.4.4
*/
testcase TP_MEC_SRV_AMS_010_OK() runs on HttpComponent system HttpTestAdapter {
// Local variables
var HeaderLines v_headers;
var UInt64 v_timestamp;
// Test control
if (not(PICS_AMS) or not(PICS_AMS_NOTIFICATIONS)) {
log("*** " & testcasename() & ": PICS_AMS and PICS_AMS_NOTIFICATIONS required for executing the TC ***");
setverdict(inconc);
stop;
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
// Test component configuration
f_cf_01_http_notif_up();
// Test adapter configuration
// Preamble
f_init_default_headers_list(-, -, v_headers);
action("Trigger a expire notification event");
v_timestamp := f_get_current_timestamp_utc();
f_selfOrClientSyncAndVerdict(c_prDone, e_success);
// Test Body
tc_wait.start;
alt {
[] httpPort_notif.receive(
mw_http_request(
mw_http_request_post(
PX_CALLBACK_URI,
-,
mw_http_message_body_json(
mw_body_json_expire_notification(
mw_expire_notification(
-,
-,
{ seconds := v_timestamp / 1000, nanoSeconds := 1000 * v_timestamp mod 1000 }
)
)
)
)
)
) {
tc_wait.stop;
log("*** " & testcasename() & ": INFO: IUT successfully sends adjacent application info notification ***");
// Send 204 No Content
httpPort_notif.send(m_http_response(m_http_response_204_no_content(v_headers)));
log("*** " & testcasename() & ": PASS: IUT successfully sends adjacent applicationinfo notification ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
}
[] tc_wait.timeout {
log("*** " & testcasename() & ": INCONC: Expected message not received ***");
f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
}
} // End of 'alt' statement
// Postamble
f_cf_01_http_notif_down();
}
} // End of group ams_notifications