/** * @author ETSI / STF569 / TTF T027 * @version $URL:$ * $ID:$ * @desc This module provides the MEC test cases. * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. * The copyright and the foregoing restriction extend to reproduction in all media. * All rights reserved. * @see ETSI GS MEC 003, Draft ETSI GS MEC 013 V3.1.1 (2018-10) */ module AtsMec_LocationAPI_TestCases { // Libcommon import from LibCommon_Sync all; // LibHttp import from LibHttp_TypesAndValues all; import from LibHttp_Functions all; import from LibHttp_Templates all; import from LibHttp_JsonTemplates all; import from LibHttp_TestSystem all; // LibMec/LocationAPI import from LocationAPI_TypesAndValues all; import from LocationAPI_Templates all; import from LocationAPI_Functions all; import from LocationAPI_Pics all; import from LocationAPI_Pixits all; // LibMec import from LibMec_Functions all; import from LibMec_Templates all; import from LibMec_Pics all; import from LibMec_Pixits all; group radioNodeLocationLookup { /** * @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 */ testcase TC_MEC_MEC013_SRV_RLOCLOOK_001_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var HttpMessage v_response; // 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( PICS_ROOT_API & PX_ME_APP_Q_ZONE_ID_URI & "/" & oct2char(unichar2oct(PX_ZONE_ID, "UTF-8")) & "/accessPoints", 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_access_point_list( mw_access_point_list( PX_ZONE_ID )))))) -> value v_response { tc_ac.stop; 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 // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_RLOCLOOK_001_OK /** * @desc Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application */ testcase TC_MEC_MEC013_SRV_RLOCLOOK_001_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers 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( PICS_ROOT_API & PX_ME_APP_Q_ZONE_ID_URI & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_ZONE_ID, "UTF-8")) & "/accessPoints", 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(); } // End of testcase TC_MEC_MEC013_SRV_RLOCLOOK_001_NF /** * @desc Check that the IUT responds with the radio nodes when queried by a MEC Application */ testcase TC_MEC_MEC013_SRV_RLOCLOOK_002_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var HttpMessage v_response; // 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( PICS_ROOT_API & PX_ME_APP_Q_ZONE_ID_URI & "/" & oct2char(unichar2oct(PX_ZONE_ID, "UTF-8")) & "/accessPoints/" & oct2char(unichar2oct(PX_ACCESS_POINT_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_access_point_info( mw_access_point_info( PX_ACCESS_POINT_ID )))))) -> value v_response { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with an AccessPointInfo ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_RLOCLOOK_002_OK /** * @desc Check that the IUT responds with an error when the radio nodes does not exist */ testcase TC_MEC_MEC013_SRV_RLOCLOOK_002_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers 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( PICS_ROOT_API & PX_ME_APP_Q_ZONE_ID_URI & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_ZONE_ID, "UTF-8")) & "/accessPoints/" & oct2char(unichar2oct(PX_NON_EXISTENT_ZONE_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() )) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a ProblemDetails set to 404 Not Found ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_RLOCLOOK_002_NF } // End of group radioNodeLocationLookup group ueAreaLookup { /** * @desc Check that the IUT responds with a list of UE area subscriptions when queried by a MEC Application - No filter */ testcase TC_MEC_MEC013_SRV_UEAREALOOK_001_OK_01() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var UserAreaNotification v_user_area_notification; var charstring v_subscription_id; // 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_create_user_area_subscription(v_user_area_notification, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_LOC_API_AREA_SUB_URI, v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_ok( mw_http_message_body_json( mw_body_json_notification_subscription_list( mw_notification_subscription_list( -, { *, mw_subscription( "UserAreaSubscription", v_user_area_notification.links_.self_.href ), * } )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of UserAreaSubscription ***"); 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_delete_user_area_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEAREALOOK_001_OK_01 /** * @desc Check that the IUT responds with a list of UE area subscriptions when queried by a MEC Application - Event filter */ testcase TC_MEC_MEC013_SRV_UEAREALOOK_001_OK_02() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var HttpMessage v_response; var UserAreaNotification v_user_area_notification; var charstring v_subscription_id; // 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_create_user_area_subscription(v_user_area_notification, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_LOC_API_AREA_SUB_URI & "?event", 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_notification_subscription_list( mw_notification_subscription_list( -, { *, mw_subscription( "UserAreaSubscription", v_user_area_notification.links_.self_.href ), * } )))))) -> value v_response { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of UserAreaSubscription ***"); 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_delete_user_area_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEAREALOOK_001_OK_02 /** * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid filter */ testcase TC_MEC_MEC013_SRV_UEAREALOOK_001_BR() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var UserAreaNotification v_user_area_notification; var charstring v_subscription_id; // 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_create_user_area_subscription(v_user_area_notification, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_LOC_API_AREA_SUB_URI & "?filter(dummy, "")", v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_400_bad_request )) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a correct error 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 // Postamble f_delete_user_area_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEAREALOOK_001_BR /** * @desc Check that the IUT acknowledges the change of UE area subscription request when commanded by a MEC Application */ testcase TC_MEC_MEC013_SRV_UEAREALOOK_002_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var UserAreaNotification v_user_area_notification; var charstring v_subscription_id; // 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_create_user_area_subscription(v_user_area_notification, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_LOC_API_AREA_SUB_URI & "/" & v_subscription_id, 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_user_area_notification( v_user_area_notification ))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct UserAreaNotification ***"); 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_delete_user_area_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEAREALOOK_002_OK /** * @desc Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application */ testcase TC_MEC_MEC013_SRV_UEAREALOOK_002_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers 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( PICS_ROOT_API & PX_LOC_API_AREA_SUB_URI & "/" & PX_NON_EXISTENT_SUBSCRIPTION_ID, 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 the correct error 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 // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEAREALOOK_002_NF } // End of group ueAreaLookup group ueAreaSubscribe { /** * @desc Check that the IUT acknowledges the creation of UE area subscription request when commanded by a MEC Application */ testcase TC_MEC_MEC013_SRV_UEAREASUB_001_OK_01() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var HttpMessage v_response; var charstring v_subscription_id; // 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_post( PICS_ROOT_API & PX_LOC_API_AREA_SUB_URI, v_headers, m_http_message_body_json( m_body_json_user_area_subscription( m_user_area_subscription( PX_AREA_SUB_CALLBACK_URI, // callbackReference PX_USER, m_area_info( ELLIPSOID_POINT_UNCERT_CIRCLE, { m_point({PX_UE_COORD_LAT}, {PX_UE_COORD_LONG}) }, PX_RADIUS ), PX_TRACKIMNG_ACCURACY, PX_CLIENT_ID //clientCorrelator )))))); 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( mw_body_json_user_area_notification( mw_user_area_notification // FIXME To be refined ))))) -> value v_response { tc_ac.stop; // Check HTTP Location header if (f_check_headers(v_response.response.header) == false) { log("*** " & testcasename() & ": FAIL: IUT failed in Area subscription ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } else { var charstring_list v_header_location; f_get_header(v_response.response.header, "Location", v_header_location); v_subscription_id := regexp( v_header_location[0], "?+" & PX_LOC_API_USERS_SUB_URI & "/(?*)", 0 ); log("*** " & testcasename() & ": PASS: IUT successfully responds with a userAreaNotification, SubscriptionId: ", v_subscription_id," ***"); 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_delete_user_area_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEAREASUB_001_OK_01 /** * @desc Check that the IUT acknowledges the creation of UE area subscription request when commanded by a MEC Application */ testcase TC_MEC_MEC013_SRV_UEAREASUB_001_OK_02() runs on HttpComponent system HttpTestAdapter { // Local variables var UserAreaNotification v_user_area_notification; var charstring v_subscription_id; // 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_notif_up(); // Test adapter configuration // Preamble f_create_user_area_subscription(v_user_area_notification, v_subscription_id); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort_notif.receive( mw_http_request( mw_http_request_post( -, -, mw_http_message_body_json( mw_body_json_user_area_notification( mw_user_area_notification // FIXME To be refined ))))) { tc_ac.stop; // Send response var Headers v_headers; f_init_default_headers_list(-, -, v_headers); httpPort_notif.send(m_http_response(m_http_response_ok_no_body(v_headers))); log("*** " & testcasename() & ": PASS: IUT successfully responds with a userAreaNotification ***"); 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_delete_user_area_subscription(v_subscription_id); f_cf_01_http_notif_down(); } // End of testcase TC_MEC_MEC013_SRV_UEAREASUB_001_OK_02 /** * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Neither callbackReference nor websockNotifConfig provided */ testcase TC_MEC_MEC013_SRV_UEAREASUB_001_BR() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers 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_post( PICS_ROOT_API & PX_LOC_API_AREA_SUB_URI, v_headers, m_http_message_body_json( m_body_json_user_area_subscription( m_user_area_subscription( "", // callbackReference PX_USER, m_area_info( ELLIPSOID_POINT_UNCERT_CIRCLE, { m_point({PX_UE_COORD_LAT}, {PX_UE_COORD_LONG}) } // No radius ), PX_TRACKIMNG_ACCURACY, PX_CLIENT_ID //clientCorrelator )))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_400_bad_request )) { 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 // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEAREASUB_001_BR /** * @desc Check that the IUT acknowledges the change of UE area subscription request when commanded by a MEC Application */ testcase TC_MEC_MEC013_SRV_UEAREASUB_002_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var UserAreaNotification v_user_area_notification; var charstring v_subscription_id; // 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_create_user_area_subscription(v_user_area_notification, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_put( PICS_ROOT_API & PX_LOC_API_AREA_SUB_URI & "/" & v_subscription_id, v_headers, m_http_message_body_json( m_body_json_user_area_subscription( m_user_area_subscription( PX_UE_NEW_SUB_CALLBACK_URI, // callbackReference PX_USER, m_area_info( ELLIPSOID_POINT_UNCERT_CIRCLE, { m_point({PX_UE_COORD_LAT}, {PX_UE_COORD_LONG}) }, PX_RADIUS ), // AreaInfo PX_TRACKIMNG_ACCURACY // TrackingAccuracy )))))); 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_user_area_subscription( mw_user_area_subscription(PX_UE_NEW_SUB_CALLBACK_URI )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with updated subscription ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEAREASUB_002_OK /** * @desc Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application */ testcase TC_MEC_MEC013_SRV_UEAREASUB_002_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers 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_put( PICS_ROOT_API & PX_LOC_API_AREA_SUB_URI & "/" & PX_NON_EXISTENT_SUBSCRIPTION_ID, v_headers, m_http_message_body_json( m_body_json_user_area_subscription( m_user_area_subscription( PX_UE_NEW_SUB_CALLBACK_URI, // callbackReference PX_USER, m_area_info( ELLIPSOID_POINT_UNCERT_CIRCLE, { m_point({PX_UE_COORD_LAT}, {PX_UE_COORD_LONG}) }, PX_RADIUS ), // AreaInfo PX_TRACKIMNG_ACCURACY // TrackingAccuracy )))))); 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 the correct error 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 // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEAREASUB_002_NF /** * @desc Check that the IUT acknowledges the cancellation of UE area change notifications when commanded by a MEC Application */ testcase TC_MEC_MEC013_SRV_UEAREASUB_003_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var UserAreaNotification v_user_area_notification; var charstring v_subscription_id; // 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_create_user_area_subscription(v_user_area_notification, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_delete( PICS_ROOT_API & PX_LOC_API_AREA_SUB_URI & "/" & v_subscription_id, v_headers ))); 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 // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEAREASUB_003_OK /** * @desc Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application */ testcase TC_MEC_MEC013_SRV_UEAREASUB_003_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers 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_delete( PICS_ROOT_API & PX_LOC_API_AREA_SUB_URI & "/" & 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 )) { 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 // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEAREASUB_003_NF } // End of group ueAreaSubscribe group ueDistanceLookup { /** * @desc Check that the IUT responds with the list of UE distance subscriptions to a UE when queried by a MEC Application */ testcase TC_MEC_MEC013_SRV_UEDISTLOOK_001_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var UserDistanceNotification v_user_distance_notification; var charstring v_subscription_id; // 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_create_user_distance_subscription(v_user_distance_notification, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_LOC_API_DISTANCE_SUB_URI, v_headers ) ) ); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_ok( mw_http_message_body_json( mw_body_json_notification_subscription_list( mw_notification_subscription_list( -, { *, mw_subscription( "UserDistanceSubscription", v_user_distance_notification.links_.self_.href ), * } )))))) { 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 // Postamble f_delete_user_distance_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEDISTLOOK_001_OK /** * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Invalid filter */ testcase TC_MEC_MEC013_SRV_UEDISTLOOK_001_BR() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers 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( PICS_ROOT_API & PX_LOC_API_DISTANCE_SUB_URI & "?event", v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_400_bad_request )) { 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 // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEDISTLOOK_001_BR /** * @desc Check that the IUT responds with the distance to a UE when queried by a MEC Application */ testcase TC_MEC_MEC013_SRV_UEDISTLOOK_002_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var UserDistanceNotification v_user_distance_notification; var charstring v_subscription_id; // 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_create_user_distance_subscription(v_user_distance_notification, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_LOC_API_DISTANCE_SUB_URI & v_subscription_id, 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_user_distance_notification( v_user_distance_notification ))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct UserDistanceNotification ***"); 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_delete_user_distance_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEDISTLOOK_002_OK /** * @desc Check that the IUT responds with an error when inconsistent request was sent by a MEC Application */ testcase TC_MEC_MEC013_SRV_UEDISTLOOK_002_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var UserDistanceNotification v_user_distance_notification; var charstring v_subscription_id; // 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_create_user_distance_subscription(v_user_distance_notification, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_LOC_API_DISTANCE_SUB_URI & "/" & PX_NON_EXISTENT_SUBSCRIPTION_ID, 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 the correct error 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 // Postamble f_delete_user_distance_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEDISTLOOK_002_NF } // End of group ueDistanceLookup 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 */ testcase TC_MEC_MEC013_SRV_UEDISTSUB_001_OK_01() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var HttpMessage v_response; var charstring v_subscription_id; // 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_post( PICS_ROOT_API & PX_LOC_API_DISTANCE_SUB_URI, v_headers, m_http_message_body_json( m_body_json_user_distance_subscription( m_user_distance_subscription( PX_UE_DIST_SUB_CALLBACK_URI, // callbackReference PX_USER, { PX_UE_MONITORED_IP_ADDRESS }, // monitoredAddress PX_DISTANCE, PX_TRACKIMNG_ACCURACY, AllWithinDistance, -, // checkImmediate PX_CLIENT_ID //clientCorrelator )))))); 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( mw_body_json_user_distance_subscription( mw_user_distance_subscription( PX_UE_DIST_SUB_CALLBACK_URI, // callbackReference -, PX_USER, { PX_UE_MONITORED_IP_ADDRESS }, // monitoredAddressPX_CLIENT_ID, //clientCorrelator PX_DISTANCE, PX_TRACKIMNG_ACCURACY, AllWithinDistance, -, // checkImmediate PX_CLIENT_ID //clientCorrelator )))))) -> value v_response { tc_ac.stop; // Check HTTP Location header if (f_check_headers(v_response.response.header) == false) { log("*** " & testcasename() & ": FAIL: IUT failed in Distance subscription ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } else { var charstring_list v_header_location; f_get_header(v_response.response.header, "Location", v_header_location); v_subscription_id := regexp( v_header_location[0], "?+" & PX_LOC_API_DISTANCE_SUB_URI & "/(?*)", 0 ); log("*** " & testcasename() & ": PASS: IUT successfully responds with a userDistanceSubscription, SubscriptionId: ", v_subscription_id," ***"); 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_delete_user_distance_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEDISTSUB_001_OK_01 /** * @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 */ testcase TC_MEC_MEC013_SRV_UEDISTSUB_001_OK_02() runs on HttpComponent system HttpTestAdapter { // Local variables var UserDistanceNotification v_user_distance_notification; var charstring v_subscription_id; // 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_notif_up(); // Test adapter configuration // Preamble f_create_user_distance_subscription(v_user_distance_notification, v_subscription_id); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort_notif.receive( mw_http_request( mw_http_request_post( -, -, mw_http_message_body_json( mw_body_json_user_distance_notification( v_user_distance_notification ))))) { tc_ac.stop; // Send response var Headers v_headers; f_init_default_headers_list(-, -, v_headers); httpPort_notif.send(m_http_response(m_http_response_ok_no_body(v_headers))); log("*** " & testcasename() & ": PASS: IUT successfully responds with a userDistanceNotification ***"); 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_delete_user_distance_subscription(v_subscription_id); f_cf_01_http_notif_down(); } // End of testcase TC_MEC_MEC013_SRV_UEDISTSUB_001_OK_02 /** * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Neither callbackReference nor websockNotifConfig provided */ testcase TC_MEC_MEC013_SRV_UEDISTSUB_001_BR() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers 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_post( PICS_ROOT_API & PX_LOC_API_DISTANCE_SUB_URI, v_headers, m_http_message_body_json( m_body_json_user_distance_subscription( m_user_distance_subscription( "", // callbackReference PX_USER, { }, // monitoredAddress is empty PX_DISTANCE, PX_TRACKIMNG_ACCURACY, AllWithinDistance, -, // checkImmediate PX_CLIENT_ID //clientCorrelator )))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_400_bad_request )) { 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 // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEDISTSUB_001_BR /** * @desc Check that the IUT acknowledges the cancellation of UE distance notifications when commanded by a MEC Application */ testcase TC_MEC_MEC013_SRV_UEDISTSUB_002_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var UserDistanceNotification v_user_distance_notification; var charstring v_subscription_id; // 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_create_user_distance_subscription(v_user_distance_notification, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_delete( PICS_ROOT_API & PX_LOC_API_DISTANCE_SUB_URI & "/" & v_subscription_id, v_headers ))); 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 // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEDISTSUB_002_OK /** * @desc Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application */ testcase TC_MEC_MEC013_SRV_UEDISTSUB_002_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers 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_delete( PICS_ROOT_API & PX_LOC_API_DISTANCE_SUB_URI & "/" & 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() )) { 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 // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEDISTSUB_002_NF } // End of group ueDistanceSubscribe group ueInfLook { /** * @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 - No Filter */ testcase TC_MEC_MEC013_SRV_UEINFLOOK_001_OK_01() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_LOCATION_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLATand 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( PICS_ROOT_API & PX_ME_APP_Q_USERS_LIST_URI, v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_ok( mw_http_message_body_json( mw_body_json_user_list( mw_user_list(-, ?) ))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a UserList ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEINFLOOK_001_OK_01 /** * @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 - Filter with one address */ testcase TC_MEC_MEC013_SRV_UEINFLOOK_001_OK_02() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_LOCATION_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLATand 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( PICS_ROOT_API & PX_ME_APP_Q_USERS_LIST_URI & "?address=" & PX_IP_ADDRESS, 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_user_list( mw_user_list( { *, mw_user_info(PX_IP_ADDRESS), * }, ?) ))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a UserList ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEINFLOOK_001_OK_02 /** * @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 - Filter with several addresses */ testcase TC_MEC_MEC013_SRV_UEINFLOOK_001_OK_03() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_LOCATION_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLATand 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( PICS_ROOT_API & PX_ME_APP_Q_USERS_LIST_URI & "?address=[" & PX_IP_ADDRESS & "," & PX_IP_ADDRESS_1 & "]", 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_user_list( mw_user_list( // FIXME Use superset? { *, mw_user_info(PX_IP_ADDRESS), mw_user_info(PX_IP_ADDRESS_1), * }, ?) ))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a UserList ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEINFLOOK_001_OK_03 /** * @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 - Filter with several zoneIds */ testcase TC_MEC_MEC013_SRV_UEINFLOOK_001_OK_04() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_LOCATION_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLATand 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( PICS_ROOT_API & PX_ME_APP_Q_USERS_LIST_URI & "?zoneId=[" & PX_ZONE_ID & "," & PX_ZONE_ID_1 & "]", 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_user_list( mw_user_list( // FIXME Use superset? { *, mw_user_info(-, -, PX_ZONE_ID), mw_user_info(-, -, PX_ZONE_ID_1), * } )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a UserList ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEINFLOOK_001_OK_04 /** * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application */ testcase TC_MEC_MEC013_SRV_UEINFLOOK_001_BR() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers 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( PICS_ROOT_API & PX_ME_APP_Q_USERS_LIST_URI & "?addr=" & PX_IP_ADDRESS, // Wrong name should trigger an error response. v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_400_bad_request )) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds 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(); } // End of testcase TC_MEC_MEC013_SRV_UEINFLOOK_001_BR /** * @desc Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application */ testcase TC_MEC_MEC013_SRV_UEINFLOOK_001_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers 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( PICS_ROOT_API & PX_ME_APP_Q_USERS_LIST_URI & "?address=" & PX_ACR_UNKNOWN_IP, 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 404 Not Found ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEINFLOOK_001_OK_001_NF } // End of group ueInfLook group ueLocationLookup { /** * @desc Check that the IUT responds with a list for the location of User Equipments when queried by a MEC Application */ testcase TC_MEC_MEC013_SRV_UELOCLOOK_001_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers 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( PICS_ROOT_API & PX_LOC_API_USERS_SUB_URI, v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_ok( mw_http_message_body_json( mw_body_json_notification_subscription_list( mw_notification_subscription_list // FIXME ))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of notification subscriptions ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UELOCLOOK_001_OK /** * @desc Check that the IUT responds with the subscription when queried by a MEC Application - UE location Event */ testcase TC_MEC_MEC013_SRV_UELOCLOOK_002_OK_01() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var UserLocationEventNotification v_user_location_event_notification; var charstring v_user_location_event_subscription_id; var UserLocationPeriodicNotification v_user_location_periodic_notification; var charstring v_user_location_periodic_subscription_id; // 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_create_user_location_event_subscription(v_user_location_event_notification, v_user_location_event_subscription_id); f_create_user_location_periodic_subscription(v_user_location_periodic_notification, v_user_location_periodic_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_LOC_API_USERS_SUB_URI & "?event", 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_notification_subscription_list( mw_notification_subscription_list( -, // FIXME { *, mw_subscription( v_user_location_event_notification.notificationType, v_user_location_event_notification.links_.self_.href ), * } )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of notification subscriptions ***"); 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_delete_user_location_event_subscription(v_user_location_event_subscription_id); f_delete_user_location_periodic_subscription(v_user_location_periodic_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UELOCLOOK_002_OK_01 /** * @desc Check that the IUT responds with the subscription when queried by a MEC Application - UE location Periodic */ testcase TC_MEC_MEC013_SRV_UELOCLOOK_002_OK_02() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var UserLocationEventNotification v_user_location_event_notification; var charstring v_user_location_event_subscription_id; var UserLocationPeriodicNotification v_user_location_periodic_notification; var charstring v_user_location_periodic_subscription_id; // 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_create_user_location_event_subscription(v_user_location_event_notification, v_user_location_event_subscription_id); f_create_user_location_periodic_subscription(v_user_location_periodic_notification, v_user_location_periodic_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_LOC_API_USERS_SUB_URI & "?periodic", 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_notification_subscription_list( mw_notification_subscription_list( -, // FIXME { *, mw_subscription( v_user_location_periodic_notification.notificationType, v_user_location_periodic_notification.links_.self_.href ), * } )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of notification subscriptions ***"); 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_delete_user_location_event_subscription(v_user_location_event_subscription_id); f_delete_user_location_periodic_subscription(v_user_location_periodic_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UELOCLOOK_002_OK_02 /** * @desc Check that the IUT responds with the subscription when queried by a MEC Application - UE location Event and address */ testcase TC_MEC_MEC013_SRV_UELOCLOOK_002_OK_03() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var UserLocationEventNotification v_user_location_event_notification_1; var charstring v_user_location_event_subscription_id_1; var UserLocationEventNotification v_user_location_event_notification_2; var charstring v_user_location_event_subscription_id_2; var UserLocationPeriodicNotification v_user_location_periodic_notification; var charstring v_user_location_periodic_subscription_id; // 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_create_user_location_event_subscription(v_user_location_event_notification_1, v_user_location_event_subscription_id_1); f_create_user_location_event_subscription(v_user_location_event_notification_2, v_user_location_event_subscription_id_2, PX_USER_2); f_create_user_location_periodic_subscription(v_user_location_periodic_notification, v_user_location_periodic_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_LOC_API_USERS_SUB_URI & "?event&adress=" & PX_USER_2, 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_notification_subscription_list( mw_notification_subscription_list( -, // FIXME { *, mw_subscription( v_user_location_periodic_notification.notificationType, v_user_location_periodic_notification.links_.self_.href ), * } )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of notification subscriptions ***"); 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_delete_user_location_event_subscription(v_user_location_event_subscription_id_1); f_delete_user_location_event_subscription(v_user_location_event_subscription_id_2); f_delete_user_location_periodic_subscription(v_user_location_periodic_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UELOCLOOK_002_OK_03 /** * @desc Check that the IUT responds with an error when inconsistent request was sent by a MEC Application - Invalid filter */ testcase TC_MEC_MEC013_SRV_UELOCLOOK_002_BR() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var UserLocationEventNotification v_user_location_event_notification; var charstring v_user_location_event_subscription_id; var UserLocationPeriodicNotification v_user_location_periodic_notification; var charstring v_user_location_periodic_subscription_id; // 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_create_user_location_event_subscription(v_user_location_event_notification, v_user_location_event_subscription_id); f_create_user_location_periodic_subscription(v_user_location_periodic_notification, v_user_location_periodic_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_LOC_API_USERS_SUB_URI & "?dummy", v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_400_bad_request )) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error 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 // Postamble f_delete_user_location_event_subscription(v_user_location_event_subscription_id); f_delete_user_location_periodic_subscription(v_user_location_periodic_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UELOCLOOK_002_BR /** * @desc Check that the IUT responds with an error when inconsistent request was sent by a MEC Application */ testcase TC_MEC_MEC013_SRV_UELOCLOOK_002_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var UserLocationEventNotification v_user_location_event_notification; var charstring v_user_location_event_subscription_id; var UserLocationPeriodicNotification v_user_location_periodic_notification; var charstring v_user_location_periodic_subscription_id; // 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_create_user_location_event_subscription(v_user_location_event_notification, v_user_location_event_subscription_id); f_create_user_location_periodic_subscription(v_user_location_periodic_notification, v_user_location_periodic_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_LOC_API_USERS_SUB_URI & "?event&adress=" & PX_USER_2, 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 the correct error 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 // Postamble f_delete_user_location_event_subscription(v_user_location_event_subscription_id); f_delete_user_location_periodic_subscription(v_user_location_periodic_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UELOCLOOK_002_NF /** * @desc Check that the IUT responds with the subscription when queried by a MEC Application - UE location Event */ testcase TC_MEC_MEC013_SRV_UELOCLOOK_003_OK_01() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var UserLocationEventNotification v_user_location_event_notification; var charstring v_user_location_event_subscription_id; var UserLocationPeriodicNotification v_user_location_periodic_notification; var charstring v_user_location_periodic_subscription_id; // 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_create_user_location_event_subscription(v_user_location_event_notification, v_user_location_event_subscription_id); f_create_user_location_periodic_subscription(v_user_location_periodic_notification, v_user_location_periodic_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_LOC_API_USERS_SUB_URI & "/" & v_user_location_event_subscription_id, 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_user_location_event_subscription( mw_user_location_event_subscription( v_user_location_event_notification.links_.self_.href )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct userLocationEventSubscription ***"); 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_delete_user_location_event_subscription(v_user_location_event_subscription_id); f_delete_user_location_periodic_subscription(v_user_location_periodic_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UELOCLOOK_003_OK_01 /** * @desc Check that the IUT responds with the subscription when queried by a MEC Application - UE location Periodoc */ testcase TC_MEC_MEC013_SRV_UELOCLOOK_003_OK_02() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var UserLocationEventNotification v_user_location_event_notification; var charstring v_user_location_event_subscription_id; var UserLocationPeriodicNotification v_user_location_periodic_notification; var charstring v_user_location_periodic_subscription_id; // 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_create_user_location_event_subscription(v_user_location_event_notification, v_user_location_event_subscription_id); f_create_user_location_periodic_subscription(v_user_location_periodic_notification, v_user_location_periodic_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_LOC_API_USERS_SUB_URI & "/" & v_user_location_periodic_subscription_id, 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_user_location_periodic_subscription( mw_user_location_periodic_subscription( v_user_location_periodic_notification.links_.self_.href )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct userLocationEventSubscription ***"); 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_delete_user_location_event_subscription(v_user_location_event_subscription_id); f_delete_user_location_periodic_subscription(v_user_location_periodic_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UELOCLOOK_003_OK_02 /** * @desc Check that the IUT responds with the subscription when queried by a MEC Application - UE location Event */ testcase TC_MEC_MEC013_SRV_UELOCLOOK_003_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers 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( PICS_ROOT_API & PX_LOC_API_USERS_SUB_URI & "/" & PX_NON_EXISTENT_SUBSCRIPTION_ID, 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 the correct userLocationEventSubscription ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UELOCLOOK_003_NF } // End of group ueLocationLookup group ueLocSub { /** * @desc Check that the IUT acknowledges the subscription by a MEC Application to notifications user location event */ testcase TC_MEC_MEC013_SRV_UELOCSUB_001_OK_01_01() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var HttpMessage v_response; var charstring v_subscription_id; // 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_post( PICS_ROOT_API & PX_LOC_API_USERS_SUB_URI, v_headers, m_http_message_body_json( m_body_json_user_location_event_subscription( m_user_location_event_subscription( PX_CALLBACK_REF_URL, PX_USER, PX_CLIENT_ID )))))); 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( mw_body_json_user_location_event_subscription( mw_user_location_event_subscription( PX_CALLBACK_REF_URL, PX_USER, -, PX_CLIENT_ID )))))) -> value v_response { tc_ac.stop; // Check HTTP Location header if (f_check_headers(v_response.response.header) == false) { log("*** " & testcasename() & ": FAIL: IUT failed in Distance subscription ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } else { var charstring_list v_header_location; f_get_header(v_response.response.header, "Location", v_header_location); v_subscription_id := regexp( v_header_location[0], "?+" & PX_LOC_API_USERS_SUB_URI & "/(?*)", 0 ); log("*** " & testcasename() & ": PASS: IUT successfully responds with a userLocationEventSubscription, SubscriptionId: ", v_subscription_id," ***"); 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_delete_user_location_event_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UELOCSUB_001_OK_01_01 /** * @desc Check that the IUT acknowledges the subscription by a MEC Application to notifications user location event */ testcase TC_MEC_MEC013_SRV_UELOCSUB_001_OK_01_02() runs on HttpComponent system HttpTestAdapter { // Local variables var UserLocationEventNotification v_user_location_event_notification; var charstring v_subscription_id; // 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_notif_up(); // Test adapter configuration // Preamble f_create_user_location_event_subscription(v_user_location_event_notification, v_subscription_id); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort_notif.receive( mw_http_request( mw_http_request_post( -, -, mw_http_message_body_json( mw_body_json_user_location_event_notification( mw_user_location_event_notification( -, -, v_user_location_event_notification.links_ )))))) { tc_ac.stop; // Send response var Headers v_headers; f_init_default_headers_list(-, -, v_headers); httpPort_notif.send(m_http_response(m_http_response_ok_no_body(v_headers))); log("*** " & testcasename() & ": PASS: IUT successfully responds with a userLocationEventNotification ***"); 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_delete_user_location_event_subscription(v_subscription_id); f_cf_01_http_notif_down(); } // End of testcase TC_MEC_MEC013_SRV_UELOCSUB_001_OK_01_02 /** * @desc Check that the IUT acknowledges the subscription by a MEC Application to notifications user location periodic */ testcase TC_MEC_MEC013_SRV_UELOCSUB_001_OK_02_01() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var HttpMessage v_response; var charstring v_subscription_id; // 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_post( PICS_ROOT_API & PX_LOC_API_USERS_SUB_URI, v_headers, m_http_message_body_json( m_body_json_user_location_periodic_subscription( m_user_location_periodic_subscription( PX_CALLBACK_REF_URL, PX_USER, PX_CLIENT_ID )))))); 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( mw_body_json_user_location_periodic_subscription( mw_user_location_periodic_subscription( PX_CALLBACK_REF_URL, PX_USER, -, PX_CLIENT_ID )))))) -> value v_response { tc_ac.stop; // Check HTTP Location header if (f_check_headers(v_response.response.header) == false) { log("*** " & testcasename() & ": FAIL: IUT failed in Distance subscription ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } else { var charstring_list v_header_location; f_get_header(v_response.response.header, "Location", v_header_location); v_subscription_id := regexp( v_header_location[0], "?+" & PX_LOC_API_USERS_SUB_URI & "/(?*)", 0 ); log("*** " & testcasename() & ": PASS: IUT successfully responds with a userLocationPeriodicSubscription, SubscriptionId: ", v_subscription_id," ***"); 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_delete_user_location_periodic_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UELOCSUB_001_OK_02_01 /** * @desc Check that the IUT acknowledges the subscription by a MEC Application to notifications user location periodic */ testcase TC_MEC_MEC013_SRV_UELOCSUB_001_OK_02_02() runs on HttpComponent system HttpTestAdapter { // Local variables var UserLocationPeriodicNotification v_user_location_periodic_notification; var charstring v_subscription_id; // 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_notif_up(); // Test adapter configuration // Preamble f_create_user_location_periodic_subscription(v_user_location_periodic_notification, v_subscription_id); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort_notif.receive( mw_http_request( mw_http_request_post( -, -, mw_http_message_body_json( mw_body_json_user_location_periodic_notification( mw_user_location_periodic_notification( -, -, v_user_location_periodic_notification.links_ )))))) { tc_ac.stop; // Send response var Headers v_headers; f_init_default_headers_list(-, -, v_headers); httpPort_notif.send(m_http_response(m_http_response_ok_no_body(v_headers))); log("*** " & testcasename() & ": PASS: IUT successfully responds with a userLocationPeriodicNotification ***"); 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_delete_user_location_periodic_subscription(v_subscription_id); f_cf_01_http_notif_down(); } // End of testcase TC_MEC_MEC013_SRV_UELOCSUB_001_OK_02_02 /** * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Neither callbackReference nor websockNotifConfig provided */ testcase TC_MEC_MEC013_SRV_UELOCSUB_001_BR_01() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers 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_post( PICS_ROOT_API & PX_LOC_API_USERS_SUB_URI, v_headers, m_http_message_body_json( m_body_json_user_location_event_subscription( m_user_location_event_subscription( "", PX_USER, PX_CLIENT_ID )))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_400_bad_request )) { 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 // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UELOCSUB_001_BR_01 /** * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Neither callbackReference nor websockNotifConfig provided */ testcase TC_MEC_MEC013_SRV_UELOCSUB_001_BR_02() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers 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_post( PICS_ROOT_API & PX_LOC_API_USERS_SUB_URI, v_headers, m_http_message_body_json( m_body_json_user_location_periodic_subscription( m_user_location_periodic_subscription( "", PX_USER, PX_CLIENT_ID )))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_400_bad_request )) { 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 // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UELOCSUB_001_BR_02 /** * @desc Check that the IUT acknowledges the cancellation of UE location change notifications when commanded by a MEC Application */ testcase TC_MEC_MEC013_SRV_UELOCSUB_002_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var UserLocationEventNotification v_user_location_event_notification; var charstring v_subscription_id; // 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_create_user_location_event_subscription(v_user_location_event_notification, v_subscription_id); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_delete( PICS_ROOT_API & PX_LOC_API_USERS_SUB_URI & "/" & v_subscription_id, v_headers ))); 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 204 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 // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UELOCSUB_002_OK /** * @desc Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application */ testcase TC_MEC_MEC013_SRV_UELOCSUB_002_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers 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_delete( PICS_ROOT_API & PX_LOC_API_USERS_SUB_URI & "/" & 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 )) { 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 // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UELOCSUB_002_NF /** * @desc Check that the IUT acknowledges a request to modify an existing subscription by a MEC Application */ testcase TC_MEC_MEC013_SRV_UELOCSUB_003_OK_01() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var UserLocationEventNotification v_user_location_event_notification; var charstring v_subscription_id; // 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_create_user_location_event_subscription(v_user_location_event_notification, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_put( PICS_ROOT_API & PX_LOC_API_USERS_SUB_URI & "/" & v_subscription_id, v_headers, m_http_message_body_json( m_body_json_user_location_event_subscription( m_user_location_event_subscription( PX_UE_NEW_SUB_CALLBACK_URI, PX_USER, PX_CLIENT_ID )))))); 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_user_location_event_subscription( mw_user_location_event_subscription( PX_UE_NEW_SUB_CALLBACK_URI, PX_USER, -, PX_CLIENT_ID )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully updates userLocationPeriodicSubscription, SubscriptionId: ", v_subscription_id," ***"); 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_delete_user_location_periodic_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UELOCSUB_003_OK_01 /** * @desc Check that the IUT acknowledges a request to modify an existing subscription by a MEC Application */ testcase TC_MEC_MEC013_SRV_UELOCSUB_003_OK_02() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var UserLocationPeriodicNotification v_user_location_periodic_notification; var charstring v_subscription_id; // 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_create_user_location_periodic_subscription(v_user_location_periodic_notification, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_put( PICS_ROOT_API & PX_LOC_API_USERS_SUB_URI & "/" & v_subscription_id, v_headers, m_http_message_body_json( m_body_json_user_location_periodic_subscription( m_user_location_periodic_subscription( PX_UE_NEW_SUB_CALLBACK_URI, PX_USER, PX_CLIENT_ID )))))); 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_user_location_periodic_subscription( mw_user_location_periodic_subscription( PX_UE_NEW_SUB_CALLBACK_URI, PX_USER, -, PX_CLIENT_ID )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully updates userLocationPeriodicSubscription, SubscriptionId: ", v_subscription_id," ***"); 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_delete_user_location_periodic_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UELOCSUB_003_OK_02 /** * @desc Check that the IUT responds with an error when received an inconsistent request */ testcase TC_MEC_MEC013_SRV_UELOCSUB_003_BR_01() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var UserLocationEventNotification v_user_location_event_notification; var charstring v_subscription_id; // 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_create_user_location_event_subscription(v_user_location_event_notification, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_put( PICS_ROOT_API & PX_LOC_API_USERS_SUB_URI & "/" & v_subscription_id, v_headers, m_http_message_body_json( m_body_json_user_location_event_subscription( m_user_location_event_subscription( "", PX_USER, PX_CLIENT_ID )))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_400_bad_request )) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error 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 // Postamble f_delete_user_location_periodic_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UELOCSUB_003_BR_01 /** * @desc Check that the IUT responds with an error when received an inconsistent request */ testcase TC_MEC_MEC013_SRV_UELOCSUB_003_BR_02() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var UserLocationPeriodicNotification v_user_location_periodic_notification; var charstring v_subscription_id; // 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_create_user_location_periodic_subscription(v_user_location_periodic_notification, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_put( PICS_ROOT_API & PX_LOC_API_USERS_SUB_URI & "/" & v_subscription_id, v_headers, m_http_message_body_json( m_body_json_user_location_periodic_subscription( m_user_location_periodic_subscription( "", PX_USER, PX_CLIENT_ID )))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_400_bad_request )) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error 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 // Postamble f_delete_user_location_periodic_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UELOCSUB_003_BR_02 /** * @desc Check that the IUT acknowledges a request to modify a not existing subscription by a MEC Application */ testcase TC_MEC_MEC013_SRV_UELOCSUB_003_NF_01() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers 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_put( PICS_ROOT_API & PX_LOC_API_USERS_SUB_URI & "/" & PX_NON_EXISTENT_SUBSCRIPTION_ID, v_headers, m_http_message_body_json( m_body_json_user_location_event_subscription( m_user_location_event_subscription( PX_UE_NEW_SUB_CALLBACK_URI, PX_USER, PX_CLIENT_ID )))))); 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 the correct error 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 // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UELOCSUB_003_NF_01 /** * @desc Check that the IUT responds with an error when received an inconsistent request */ testcase TC_MEC_MEC013_SRV_UELOCSUB_003_NF_02() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers 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_put( PICS_ROOT_API & PX_LOC_API_USERS_SUB_URI & "/" & PX_NON_EXISTENT_SUBSCRIPTION_ID, v_headers, m_http_message_body_json( m_body_json_user_location_periodic_subscription( m_user_location_periodic_subscription( PX_UE_NEW_SUB_CALLBACK_URI, PX_USER, PX_CLIENT_ID )))))); 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 the correct error 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 // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UELOCSUB_003_NF_02 } // End of group ueLocSub group ueTestNot { /** * @desc Check that the IUT provides a test notification when requested by a MEC Application */ testcase TC_MEC_MEC013_SRV_UETESTNOT_001_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var HttpMessage v_response; var charstring v_subscription_id; // 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_notif_up(); // Test adapter configuration // Preamble f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_post( PICS_ROOT_API & PX_LOC_API_USERS_SUB_URI, v_headers, m_http_message_body_json( m_body_json_user_location_event_subscription( m_user_location_event_subscription( PX_CALLBACK_REF_URL, PX_USER, PX_CLIENT_ID, true )))))); 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( mw_body_json_user_location_event_subscription( mw_user_location_event_subscription( PX_CALLBACK_REF_URL, PX_USER, -, PX_CLIENT_ID, true )))))) -> value v_response { tc_ac.stop; // Check HTTP Location header if (f_check_headers(v_response.response.header) == false) { log("*** " & testcasename() & ": FAIL: IUT failed in Distance subscription ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } else { var charstring_list v_header_location; f_get_header(v_response.response.header, "Location", v_header_location); v_subscription_id := regexp( v_header_location[0], "?+" & PX_LOC_API_USERS_SUB_URI & "/(?*)", 0 ); log("*** " & testcasename() & ": INFO: IUT successfully responds with a userLocationEventSubscription, SubscriptionId: ", v_subscription_id," ***"); repeat; // Wait for test notification } } [] httpPort_notif.receive( mw_http_request( mw_http_request_post( -, -, mw_http_message_body_json( mw_body_json_test_notification( mw_test_notification( v_response.response.body.json_body.userLocationEventNotification.links_ )))))) { tc_ac.stop; // Send response f_init_default_headers_list(-, -, v_headers); httpPort_notif.send(m_http_response(m_http_response_ok_no_body(v_headers))); log("*** " & testcasename() & ": PASS: IUT successfully responds with a userAreaNotification ***"); 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_delete_user_location_event_subscription(v_subscription_id); f_cf_01_http_notif_down(); } // End of testcase TC_MEC_MEC013_SRV_UETESTNOT_001_OK /** * @desc Check that the IUT terminates notifications after time expiration */ testcase TC_MEC_MEC013_SRV_UETESTNOT_002_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var HttpMessage v_response; var charstring v_subscription_id; var boolean v_notification_received_after_expiry := false; timer tc_expiry := PX_NOTIF_EXPIRY; timer tc_expiry_guard := PX_NOTIF_EXPIRY / 2.0; // 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_notif_up(); // Test adapter configuration // Preamble f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_post( PICS_ROOT_API & PX_LOC_API_USERS_SUB_URI, v_headers, m_http_message_body_json( m_body_json_user_location_event_subscription( m_user_location_event_subscription( PX_CALLBACK_REF_URL, PX_USER, PX_CLIENT_ID, -, -, -, -, m_time_stamp( float2int(PX_NOTIF_EXPIRY) ))))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; tc_expiry.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_201_created( mw_http_message_body_json( mw_body_json_user_location_event_subscription( mw_user_location_event_subscription( PX_CALLBACK_REF_URL, PX_USER, -, PX_CLIENT_ID )))))) -> value v_response { tc_ac.stop; // Check HTTP Location header if (f_check_headers(v_response.response.header) == false) { log("*** " & testcasename() & ": FAIL: IUT failed in Distance subscription ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } else { var charstring_list v_header_location; f_get_header(v_response.response.header, "Location", v_header_location); v_subscription_id := regexp( v_header_location[0], "?+" & PX_LOC_API_USERS_SUB_URI & "/(?*)", 0 ); log("*** " & testcasename() & ": INFO: IUT successfully responds with a userLocationEventSubscription, SubscriptionId: ", v_subscription_id," ***"); tc_ac.start; repeat; // Wait for test notification } } [] httpPort_notif.receive( mw_http_request( mw_http_request_post( -, -, mw_http_message_body_json( mw_body_json_test_notification( mw_test_notification( v_response.response.body.json_body.userLocationEventNotification.links_ )))))) { tc_ac.stop; // Send response f_init_default_headers_list(-, -, v_headers); httpPort_notif.send(m_http_response(m_http_response_ok_no_body(v_headers))); log("*** " & testcasename() & ": INFO: Receive new notification ***"); v_notification_received_after_expiry := true; tc_ac.start; repeat; } [] tc_expiry.timeout { v_notification_received_after_expiry := false; tc_expiry_guard.start; repeat; } [] tc_expiry_guard.timeout { if (v_notification_received_after_expiry) { log("*** " & testcasename() & ": FAIL: Received notification after expiration time ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } else { log("*** " & testcasename() & ": PASS: No more notification received ***"); 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_delete_user_location_event_subscription(v_subscription_id); f_cf_01_http_notif_down(); } // End of testcase TC_MEC_MEC013_SRV_UETESTNOT_002_OK } // End of group ueTestNot group ueZoneLook { /** * @desc Check that the IUT responds with a list zones when queried by a MEC Application */ testcase TC_MEC_MEC013_SRV_UEZONELOOK_001_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers 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( PICS_ROOT_API & PX_LOC_API_ZONES_SUB_URI, v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_ok( mw_http_message_body_json( mw_body_json_notification_subscription_list( mw_notification_subscription_list ))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of ZoneSubscription ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEZONELOOK_001_OK /** * @desc Check that the IUT responds with the subscription when queried by a MEC Application - Zone location Event */ testcase TC_MEC_MEC013_SRV_UEZONELOOK_002_OK_01() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var ZoneLocationEventNotification v_zone_location_event_notification; var charstring v_subscription_id; // 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_create_zone_location_event_subscription(v_zone_location_event_notification, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_LOC_API_ZONES_SUB_URI & "?event", 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_notification_subscription_list( mw_notification_subscription_list( -, { *, mw_subscription( "ZoneLocationEventSubscription", v_zone_location_event_notification.links_.self_.href ), * } )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of ZoneSubscription ***"); 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_delete_zone_location_event_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEZONELOOK_002_OK_01 /** * @desc Check that the IUT responds with the subscription when queried by a MEC Application - Zone Status */ testcase TC_MEC_MEC013_SRV_UEZONELOOK_002_OK_02() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var ZoneStatusNotification v_zone_status_notification; var charstring v_subscription_id; // 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_create_zone_status_subscription(v_zone_status_notification, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_LOC_API_ZONES_SUB_URI & "?status", 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_notification_subscription_list( mw_notification_subscription_list( -, { *, mw_subscription( "ZoneStatusSubscription", v_zone_status_notification.links_.self_.href ), * } )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of ZoneSubscription ***"); 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_delete_zone_status_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEZONELOOK_002_OK_02 /** * @desc Check that the IUT responds with the subscription when queried by a MEC Application - UE location Event and address */ testcase TC_MEC_MEC013_SRV_UEZONELOOK_002_OK_03() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var ZoneLocationEventNotification v_zone_location_event_notification_1, v_zone_location_event_notification_2; var ZoneStatusNotification v_zone_status_notification; var charstring v_subscription_id_event_1, v_subscription_id_event_2; var charstring v_subscription_id_status; // 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_create_zone_location_event_subscription(v_zone_location_event_notification_1, v_subscription_id_event_1); f_create_zone_location_event_subscription(v_zone_location_event_notification_2, v_subscription_id_event_2, PX_USER_2); f_create_zone_status_subscription(v_zone_status_notification, v_subscription_id_status); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_LOC_API_ZONES_SUB_URI & "?event&address=" & PX_USER_2, 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_notification_subscription_list( mw_notification_subscription_list( -, { *, mw_subscription( "ZoneLocationEventSubscription.", v_zone_location_event_notification_2.links_.self_.href ), * } )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of ZoneSubscription ***"); 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_delete_zone_location_event_subscription(v_subscription_id_event_1); f_delete_zone_location_event_subscription(v_subscription_id_event_2); f_delete_zone_status_subscription(v_subscription_id_status); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEZONELOOK_002_OK_03 /** * @desc Check that the IUT responds with an error when inconsistent request was sent by a MEC Application - Invalid filter */ testcase TC_MEC_MEC013_SRV_UEZONELOOK_002_BR() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var ZoneLocationEventNotification v_zone_location_event_notification_1, v_zone_location_event_notification_2; var ZoneStatusNotification v_zone_status_notification; var charstring v_subscription_id_event_1, v_subscription_id_event_2; var charstring v_subscription_id_status; // 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_create_zone_location_event_subscription(v_zone_location_event_notification_1, v_subscription_id_event_1); f_create_zone_location_event_subscription(v_zone_location_event_notification_2, v_subscription_id_event_2, PX_USER_2); f_create_zone_status_subscription(v_zone_status_notification, v_subscription_id_status); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_LOC_API_ZONES_SUB_URI & "?event&address", // Invalid filter v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_400_bad_request )) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of ZoneSubscription ***"); 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_delete_zone_location_event_subscription(v_subscription_id_event_1); f_delete_zone_location_event_subscription(v_subscription_id_event_2); f_delete_zone_status_subscription(v_subscription_id_status); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEZONELOOK_002_BR /** * @desc Check that the IUT responds with an error when inconsistent request was sent by a MEC Application */ testcase TC_MEC_MEC013_SRV_UEZONELOOK_002_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var ZoneLocationEventNotification v_zone_location_event_notification; var ZoneStatusNotification v_zone_status_notification; var charstring v_subscription_id_event; var charstring v_subscription_id_status; // 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_create_zone_location_event_subscription(v_zone_location_event_notification, v_subscription_id_event); f_create_zone_status_subscription(v_zone_status_notification, v_subscription_id_status); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_LOC_API_ZONES_SUB_URI & "?event&address=" & PX_USER_2, 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 the correct error 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 // Postamble f_delete_zone_location_event_subscription(v_subscription_id_event); f_delete_zone_status_subscription(v_subscription_id_status); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEZONELOOK_002_NF /** * @desc Check that the IUT responds with the subscription when queried by a MEC Application - Zone location Event */ testcase TC_MEC_MEC013_SRV_UEZONELOOK_003_OK_01() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var ZoneLocationEventNotification v_zone_location_event_notification; var charstring v_subscription_id; // 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_create_zone_location_event_subscription(v_zone_location_event_notification, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_LOC_API_ZONES_SUB_URI & "/" & v_subscription_id, 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_notification_subscription_list( mw_notification_subscription_list( -, { *, mw_subscription( "ZoneLocationEventSubscription.", v_zone_location_event_notification.links_.self_.href ), * } )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct ZoneSubscription ***"); 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_delete_zone_location_event_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEZONELOOK_003_OK_01 /** * @desc Check that the IUT responds with the subscription when queried by a MEC Application - Zone status Event */ testcase TC_MEC_MEC013_SRV_UEZONELOOK_003_OK_02() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var ZoneStatusNotification v_zone_status_notification; var charstring v_subscription_id; // 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_create_zone_status_subscription(v_zone_status_notification, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_LOC_API_ZONES_SUB_URI & "/" & v_subscription_id, 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_notification_subscription_list( mw_notification_subscription_list( -, { *, mw_subscription( "ZoneLocationEventSubscription.", v_zone_status_notification.links_.self_.href ), * } )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct ZoneSubscription ***"); 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_delete_zone_status_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEZONELOOK_003_OK_02 /** * @desc Check that the IUT responds with an error when the non existing subscription is queried by a MEC Application */ testcase TC_MEC_MEC013_SRV_UEZONELOOK_003_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers 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( PICS_ROOT_API & PX_LOC_API_ZONES_SUB_URI & "/" & PX_NON_EXISTENT_SUBSCRIPTION_ID, 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 the correct error 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 // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEZONELOOK_003_NF } // End of group ueZoneLook group ueZoneSub { /** * @desc Check that the IUT acknowledges the creation of UE zone subscription request when commanded by a MEC Application */ testcase TC_MEC_MEC013_SRV_UEZONESUB_001_OK_01_01() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var HttpMessage v_response; var charstring v_subscription_id; // 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_post( PICS_ROOT_API & PX_LOC_API_ZONES_SUB_URI, v_headers, m_http_message_body_json( m_body_json_zone_location_event_subscription( m_zone_location_event_subscription( PX_CALLBACK_REF_URL, PX_CLIENT_ID, PX_ZONE_ID )))))); 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( mw_body_json_zone_location_event_notification( mw_zone_location_event_notification( // FIXME )))))) -> value v_response { tc_ac.stop; // Check HTTP Location header if (f_check_headers(v_response.response.header) == false) { log("*** " & testcasename() & ": FAIL: IUT failed in Distance subscription ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } else { var charstring_list v_header_location; f_get_header(v_response.response.header, "Location", v_header_location); v_subscription_id := regexp( v_header_location[0], "?+" & PX_LOC_API_ZONES_SUB_URI & "/(?*)", 0 ); log("*** " & testcasename() & ": PASS: IUT successfully responds with a zoneLocationEventSubscription, SubscriptionId: ", v_subscription_id," ***"); 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_delete_zone_location_event_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEZONESUB_001_OK_01_01 /** * @desc Check that the IUT acknowledges the creation of UE zone subscription request when commanded by a MEC Application */ testcase TC_MEC_MEC013_SRV_UEZONESUB_001_OK_01_02() runs on HttpComponent system HttpTestAdapter { // Local variables var ZoneLocationEventNotification v_zone_location_event_notification; var charstring v_subscription_id; // 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_notif_up(); // Test adapter configuration // Preamble f_create_zone_location_event_subscription(v_zone_location_event_notification, v_subscription_id); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort_notif.receive( mw_http_request( mw_http_request_post( -, -, mw_http_message_body_json( mw_body_json_zone_location_event_notification( mw_zone_location_event_notification( -, v_zone_location_event_notification.links_ )))))) { tc_ac.stop; // Send response var Headers v_headers; f_init_default_headers_list(-, -, v_headers); httpPort_notif.send(m_http_response(m_http_response_ok_no_body(v_headers))); log("*** " & testcasename() & ": PASS: IUT successfully responds with a zoneLocationEventNotification ***"); 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_delete_zone_location_event_subscription(v_subscription_id); f_cf_01_http_notif_down(); } // End of testcase TC_MEC_MEC013_SRV_UEZONESUB_001_OK_01_02 /** * @desc Check that the IUT acknowledges the creation of UE zone subscription request when commanded by a MEC Application - OperationStatus constraint */ testcase TC_MEC_MEC013_SRV_UEZONESUB_001_OK_02_01_01() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var HttpMessage v_response; var charstring v_subscription_id; // 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_post( PICS_ROOT_API & PX_LOC_API_ZONES_SUB_URI, v_headers, m_http_message_body_json( m_body_json_zone_status_subscription( m_zone_status_subscription( PX_AREA_SUB_CALLBACK_URI, -, PX_ZONE_ID, -, -, -, -, -, -, -, Serviceable )))))); 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( mw_body_json_zone_status_notification( mw_zone_status_notification( -, -, Serviceable )))))) -> value v_response { tc_ac.stop; // Check HTTP Location header if (f_check_headers(v_response.response.header) == false) { log("*** " & testcasename() & ": FAIL: IUT failed in Distance subscription ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } else { var charstring_list v_header_location; f_get_header(v_response.response.header, "Location", v_header_location); v_subscription_id := regexp( v_header_location[0], "?+" & PX_LOC_API_ZONES_SUB_URI & "/(?*)", 0 ); log("*** " & testcasename() & ": PASS: IUT successfully responds with a zoneLocationEventSubscription, SubscriptionId: ", v_subscription_id," ***"); 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_delete_zone_status_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEZONESUB_001_OK_02_01_01 /** * @desc Check that the IUT acknowledges the creation of UE zone subscription request when commanded by a MEC Application - OperationStatus constraint */ testcase TC_MEC_MEC013_SRV_UEZONESUB_001_OK_02_01_02() runs on HttpComponent system HttpTestAdapter { // Local variables var ZoneStatusNotification v_zone_status_notification; var charstring v_subscription_id; // 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_notif_up(); // Test adapter configuration // Preamble f_create_zone_status_subscription(v_zone_status_notification, v_subscription_id); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort_notif.receive( mw_http_request( mw_http_request_post( -, -, mw_http_message_body_json( mw_body_json_zone_status_notification( mw_zone_status_notification( v_zone_status_notification.links_ )))))) { tc_ac.stop; // Send response var Headers v_headers; f_init_default_headers_list(-, -, v_headers); httpPort_notif.send(m_http_response(m_http_response_ok_no_body(v_headers))); log("*** " & testcasename() & ": PASS: IUT successfully responds with a zoneLocationEventNotification ***"); 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_delete_zone_status_subscription(v_subscription_id); f_cf_01_http_notif_down(); } // End of testcase TC_MEC_MEC013_SRV_UEZONESUB_001_OK_02_01_02 /** * @desc Check that the IUT acknowledges the creation of UE zone subscription request when commanded by a MEC Application - UserNumEvent constraint */ testcase TC_MEC_MEC013_SRV_UEZONESUB_001_OK_02_02_01() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var HttpMessage v_response; var charstring v_subscription_id; // 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_post( PICS_ROOT_API & PX_LOC_API_ZONES_SUB_URI, v_headers, m_http_message_body_json( m_body_json_zone_status_subscription( m_zone_status_subscription( PX_AREA_SUB_CALLBACK_URI, -, PX_ZONE_ID, -, -, -, PX_UPPER_NUM_USER_THRESHOLD, PX_LOWER_NUM_USER_THRESHOLD )))))); 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( mw_body_json_zone_status_notification( mw_zone_status_notification( // FIXME )))))) -> value v_response { tc_ac.stop; // Check HTTP Location header if (f_check_headers(v_response.response.header) == false) { log("*** " & testcasename() & ": FAIL: IUT failed in Distance subscription ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } else { var charstring_list v_header_location; f_get_header(v_response.response.header, "Location", v_header_location); v_subscription_id := regexp( v_header_location[0], "?+" & PX_LOC_API_ZONES_SUB_URI & "/(?*)", 0 ); log("*** " & testcasename() & ": PASS: IUT successfully responds with a zoneLocationEventSubscription, SubscriptionId: ", v_subscription_id," ***"); 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_delete_zone_status_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEZONESUB_001_OK_02_02_01 /** * @desc Check that the IUT acknowledges the creation of UE zone subscription request when commanded by a MEC Application - UserNumEvent constraint */ testcase TC_MEC_MEC013_SRV_UEZONESUB_001_OK_02_02_02() runs on HttpComponent system HttpTestAdapter { // Local variables var ZoneStatusNotification v_zone_status_notification; var charstring v_subscription_id; // 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_notif_up(); // Test adapter configuration // Preamble f_create_zone_status_subscription(v_zone_status_notification, v_subscription_id, omit, PX_UPPER_NUM_USER_THRESHOLD, PX_LOWER_NUM_USER_THRESHOLD); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort_notif.receive( mw_http_request( mw_http_request_post( -, -, mw_http_message_body_json( mw_body_json_zone_status_notification( v_zone_status_notification ))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a zoneLocationEventNotification ***"); 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_delete_zone_status_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEZONESUB_001_OK_02_02_02 /** * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - Neither callbackReference nor websockNotifConfig provided */ testcase TC_MEC_MEC013_SRV_UEZONESUB_001_BR() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers 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_post( PICS_ROOT_API & PX_LOC_API_ZONES_SUB_URI, v_headers, m_http_message_body_json( m_body_json_zone_location_event_subscription( m_zone_location_event_subscription( "", PX_CLIENT_ID, PX_ZONE_ID )))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_400_bad_request )) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error 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 // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEZONESUB_001_BR /** * @desc Check that the IUT acknowledges the change of UE area subscription request when commanded by a MEC Application */ testcase TC_MEC_MEC013_SRV_UEZONESUB_002_OK_01() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var ZoneLocationEventNotification v_zone_location_event_notification; var charstring v_subscription_id; // 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_create_zone_location_event_subscription(v_zone_location_event_notification, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_put( PICS_ROOT_API & PX_LOC_API_ZONES_SUB_URI & v_subscription_id, v_headers, m_http_message_body_json( m_body_json_zone_location_event_subscription( m_zone_location_event_subscription( PX_UE_NEW_SUB_CALLBACK_URI, PX_CLIENT_ID, PX_ZONE_ID )))))); 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_zone_location_event_subscription( mw_zone_location_event_subscription( PX_UE_NEW_SUB_CALLBACK_URI, PX_CLIENT_ID, PX_ZONE_ID )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully updates the zoneLocationEventSubscription ***"); 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_delete_zone_location_event_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEZONESUB_002_OK_01 /** * @desc Check that the IUT acknowledges the change of UE area subscription request when commanded by a MEC Application */ testcase TC_MEC_MEC013_SRV_UEZONESUB_002_OK_02() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var ZoneStatusNotification v_zone_status_notification; var charstring v_subscription_id; // 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_create_zone_status_subscription(v_zone_status_notification, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_post( PICS_ROOT_API & PX_LOC_API_ZONES_SUB_URI & v_subscription_id, v_headers, m_http_message_body_json( m_body_json_zone_status_subscription( m_zone_status_subscription( PX_UE_NEW_SUB_CALLBACK_URI, -, PX_ZONE_ID )))))); 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_zone_status_subscription( mw_zone_status_subscription( PX_UE_NEW_SUB_CALLBACK_URI, -, PX_ZONE_ID )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully updates with a zoneStatusSubscription ***"); 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_delete_zone_status_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEZONESUB_002_OK_02 /** * @desc Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application */ testcase TC_MEC_MEC013_SRV_UEZONESUB_002_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers 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_put( PICS_ROOT_API & PX_LOC_API_ZONES_SUB_URI & PX_NON_EXISTENT_SUBSCRIPTION_ID, v_headers, m_http_message_body_json( m_body_json_zone_location_event_subscription( m_zone_location_event_subscription( PX_UE_NEW_SUB_CALLBACK_URI, PX_CLIENT_ID, PX_ZONE_ID )))))); 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 the correct error 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 // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEZONESUB_002_NF /** * @desc Check that the IUT acknowledges the cancellation of UE area change notifications when commanded by a MEC Application */ testcase TC_MEC_MEC013_SRV_UEZONESUB_003_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var ZoneLocationEventNotification v_zone_location_event_notification; var charstring v_subscription_id; // 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_create_zone_location_event_subscription(v_zone_location_event_notification, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_delete( PICS_ROOT_API & PX_LOC_API_ZONES_SUB_URI & "/" & v_subscription_id, v_headers ))); 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 204 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 // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEZONESUB_003_OK /** * @desc Check that the IUT acknowledges the cancellation of UE information change notifications when commanded by a MEC Application */ testcase TC_MEC_MEC013_SRV_UEZONESUB_003_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers 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_delete( PICS_ROOT_API & PX_LOC_API_ZONES_SUB_URI & "/" & PX_NON_EXISTENT_SUBSCRIPTION_ID, 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 404 Not Found ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC013_SRV_UEZONESUB_003_NF } // End of group ueZoneSub } // End of module AtsMec_LocationAPI_TestCases