/** * @author ETSI / TTF T012 * @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 015, Draft ETSI GS MEC 015 V2.1.1 (2020-06) */ module AtsMec_MultiAccessSteeringInfoAPI_TestCases { // JSON import from Json all; // Libcommon import from LibCommon_Time all; import from LibCommon_VerdictControl all; 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/TrafficManagementAPI import from TrafficManagementAPI_TypesAndValues all; import from TrafficManagementAPI_Templates all; import from TrafficManagementAPI_Functions all; import from TrafficManagementAPI_Pics all; import from TrafficManagementAPI_Pixits all; // LibMec import from LibMec_Templates all; import from LibMec_Functions all; import from LibMec_Pics all; import from LibMec_Pixits all; group me_app_role { /** * @desc Check that the IUT responds with the Multi-access Traffic Steering information when queried by a MEC Application */ testcase TC_MEC_MEC015_SRV_MTS_001_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; // Test control if (not(PICS_MEC_PLAT) or not(PICS_MULTI_ACCESS_TRAFFIC_STEERING_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_MULTI_ACCESS_TRAFFIC_STEERING_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_MTS_INFO_URI, v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_ok( mw_http_message_body_json( mw_body_json_mts_capability_info( mw_mts_capability_info ))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of MtsCapabilityInfo ***"); 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_MEC015_SRV_MTS_001_OK /** * @desc Check that the IUT responds with the list of configured Multi-access Traffic Steering when queried by a MEC Application - none */ testcase TC_MEC_MEC015_SRV_MTS_002_OK_01() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var charstring v_mts_session_id_1, v_mts_session_id_2; var MtsSessionInfo v_mts_session_info_1, v_mts_session_info_2; // Test control if (not(PICS_MEC_PLAT) or not(PICS_MULTI_ACCESS_TRAFFIC_STEERING_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_MULTI_ACCESS_TRAFFIC_STEERING_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Test adapter configuration // Preamble f_create_mts_session_info_resource(PX_APP_INSTANCE_ID, v_mts_session_id_1, v_mts_session_info_1); f_create_mts_session_info_resource(PX_APP_INSTANCE_ID_2, v_mts_session_id_2, v_mts_session_info_2); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_ME_MTS_SESSIONS_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_mts_session_info_list( { *, mw_mts_session_info( v_mts_session_info_1.appInsId, v_mts_session_info_1.requestType, -, -, -, v_mts_session_info_1.sessionId ), mw_mts_session_info( v_mts_session_info_2.appInsId, v_mts_session_info_2.requestType, -, -, -, v_mts_session_info_2.sessionId ), * } ))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with an MtsSessionInfo list ***"); 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_mts_session_info_resource(PX_APP_INSTANCE_ID, v_mts_session_id_1); f_delete_mts_session_info_resource(PX_APP_INSTANCE_ID_2, v_mts_session_id_2); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC015_SRV_MTS_002_OK_01 /** * @desc Check that the IUT responds with the list of configured Multi-access Traffic Steering when queried by a MEC Application - app_instance_id */ testcase TC_MEC_MEC015_SRV_MTS_002_OK_02() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var charstring v_mts_session_id var MtsSessionInfo v_mts_session_info; // Test control if (not(PICS_MEC_PLAT) or not(PICS_MULTI_ACCESS_TRAFFIC_STEERING_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_MULTI_ACCESS_TRAFFIC_STEERING_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Test adapter configuration // Preamble f_create_mts_session_info_resource(PX_APP_INSTANCE_ID, v_mts_session_id, v_mts_session_info); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_ME_MTS_SESSIONS_URI & "?app_instance_id=" & oct2char(unichar2oct(v_mts_session_info.appInsId, "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_mts_session_info( mw_mts_session_info( v_mts_session_info.appInsId, v_mts_session_info.requestType, -, -, -, v_mts_session_id )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with an MtsSessionInfo list ***"); 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_mts_session_info_resource(PX_APP_INSTANCE_ID, v_mts_session_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC015_SRV_MTS_002_OK_02 /** * @desc Check that the IUT responds with the list of configured Multi-access Traffic Steering when queried by a MEC Application - app_name */ testcase TC_MEC_MEC015_SRV_MTS_002_OK_03() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var charstring v_mts_session_id var MtsSessionInfo v_mts_session_info; // Test control if (not(PICS_MEC_PLAT) or not(PICS_MULTI_ACCESS_TRAFFIC_STEERING_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_MULTI_ACCESS_TRAFFIC_STEERING_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Test adapter configuration // Preamble f_create_mts_session_info_resource(PX_APP_INSTANCE_ID, v_mts_session_id, v_mts_session_info); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_ME_MTS_SESSIONS_URI & "?app_name=" & oct2char(unichar2oct(v_mts_session_info.appName, "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_mts_session_info( mw_mts_session_info( v_mts_session_info.appInsId, v_mts_session_info.requestType, -, -, -, v_mts_session_id, v_mts_session_info.appName )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with an MtsSessionInfo list ***"); 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_mts_session_info_resource(PX_APP_INSTANCE_ID, v_mts_session_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC015_SRV_MTS_002_OK_03 /** * @desc Check that the IUT responds with the list of configured Multi-access Traffic Steering when queried by a MEC Application - sessionId */ testcase TC_MEC_MEC015_SRV_MTS_002_OK_04() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var charstring v_mts_session_id var MtsSessionInfo v_mts_session_info; // Test control if (not(PICS_MEC_PLAT) or not(PICS_MULTI_ACCESS_TRAFFIC_STEERING_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_MULTI_ACCESS_TRAFFIC_STEERING_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Test adapter configuration // Preamble f_create_mts_session_info_resource(PX_APP_INSTANCE_ID, v_mts_session_id, v_mts_session_info); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_ME_MTS_SESSIONS_URI & "?session_id=" & oct2char(unichar2oct(v_mts_session_info.sessionId, "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_mts_session_info( mw_mts_session_info( v_mts_session_info.appInsId, v_mts_session_info.requestType, -, -, -, v_mts_session_info.sessionId, v_mts_session_info.appName )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with an MtsSessionInfo list ***"); 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_mts_session_info_resource(PX_APP_INSTANCE_ID, v_mts_session_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC015_SRV_MTS_002_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_MEC015_SRV_MTS_002_BR() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; // Test control if (not(PICS_MEC_PLAT) or not(PICS_MULTI_ACCESS_TRAFFIC_STEERING_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_MULTI_ACCESS_TRAFFIC_STEERING_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_MTS_SESSIONS_URI & "?appInsId=" & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")), // 'appInsId=' is a wrong parameter 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( mw_http_message_body_json( mw_body_json_problem_details( mw_problem_details( -, -, 400 )))))) { 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_MEC015_SRV_MTS_002_BR /** * @desc Check that the IUT responds with an error when a request with an unknown resource URI is sent by a MEC Application */ testcase TC_MEC_MEC015_SRV_MTS_002_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var charstring v_mts_session_id var MtsSessionInfo v_mts_session_info; // Test control if (not(PICS_MEC_PLAT) or not(PICS_MULTI_ACCESS_TRAFFIC_STEERING_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_MULTI_ACCESS_TRAFFIC_STEERING_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Test adapter configuration // Preamble f_create_mts_session_info_resource(PX_APP_INSTANCE_ID, v_mts_session_id, v_mts_session_info); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_ME_MTS_SESSIONS_URI & "?app_instance_id=" & oct2char(unichar2oct(PX_UNKNOWN_APP_INSTANCE_ID, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_404_not_found( mw_http_message_body_json( mw_body_json_problem_details( mw_problem_details( -, -, 404 )))))) { 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_mts_session_info_resource(PX_APP_INSTANCE_ID, v_mts_session_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC015_SRV_MTS_002_NF /** * @desc Check that the IUT creates a MTS session when queried by a MEC Application */ testcase TC_MEC_MEC015_SRV_MTS_003_OK_01() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var HttpMessage v_response; var charstring v_mts_session_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_MULTI_ACCESS_TRAFFIC_STEERING_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_MULTI_ACCESS_TRAFFIC_STEERING_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_ME_MTS_SESSIONS_URI, v_headers, m_http_message_body_json( m_body_json_mts_session_info( m_mts_session_info( PX_APP_INSTANCE_ID, APPLICATION_SPECIFIC_MTS_SESSION, // Request type m_qosd, // QoS LowCost, // MtsMode Downlink // TrafficDirection )))))); 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_mts_session_info( mw_mts_session_info( PX_APP_INSTANCE_ID )))))) -> value v_response { tc_ac.stop; if (f_check_headers(valueof(v_response.response.header)) == false) { log("*** " & testcasename() & ": FAIL: Header 'Location' was not present in the response headers ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } else { var charstring_list v_header_location; f_get_header(valueof(v_response.response.header), "Location", v_header_location); v_mts_session_id := regexp( v_header_location[0], "?+" & PX_ME_MTS_SESSIONS_URI & "/(?*)", 0 ); log("*** " & testcasename() & ": PASS: IUT successfully responds with a MtsSessionInfo, v_mts_session_id: ", v_mts_session_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_mts_session_info_resource(PX_APP_INSTANCE_ID, v_mts_session_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC015_SRV_MTS_003_OK_01 /** * @desc Check that the IUT creates a MTS session when queried by a MEC Application */ testcase TC_MEC_MEC015_SRV_MTS_003_OK_02() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var HttpMessage v_response; var charstring v_mts_session_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_MULTI_ACCESS_TRAFFIC_STEERING_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_MULTI_ACCESS_TRAFFIC_STEERING_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_ME_MTS_SESSIONS_URI, v_headers, m_http_message_body_json( m_body_json_mts_session_info( m_mts_session_info( PX_APP_INSTANCE_ID, FLOW_SPECIFIC_MTS_SESSION, // Request type m_qosd, // QoS LowCost, // MtsMode Downlink, // TrafficDirection -, -, { m_flow_filter("10.10.10.10", 1010) } // FIXME Use PIXITs )))))); 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_mts_session_info( mw_mts_session_info( PX_APP_INSTANCE_ID, FLOW_SPECIFIC_MTS_SESSION )))))) -> value v_response { tc_ac.stop; if (f_check_headers(valueof(v_response.response.header)) == false) { log("*** " & testcasename() & ": FAIL: Header 'Location' was not present in the response headers ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_error); } else { var charstring_list v_header_location; f_get_header(valueof(v_response.response.header), "Location", v_header_location); v_mts_session_id := regexp( v_header_location[0], "?+" & PX_ME_MTS_SESSIONS_URI & "/(?*)", 0 ); log("*** " & testcasename() & ": PASS: IUT successfully responds with a MtsSessionInfo, v_mts_session_id: ", v_mts_session_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_mts_session_info_resource(PX_APP_INSTANCE_ID, v_mts_session_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC015_SRV_MTS_003_OK_02 /** * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application */ testcase TC_MEC_MEC015_SRV_MTS_003_BR() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; // Test control if (not(PICS_MEC_PLAT) or not(PICS_MULTI_ACCESS_TRAFFIC_STEERING_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_MULTI_ACCESS_TRAFFIC_STEERING_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_ME_MTS_SESSIONS_URI, v_headers, m_http_message_body_json( m_body_json_mts_session_info( m_mts_session_info( PX_APP_INSTANCE_ID, APPLICATION_SPECIFIC_MTS_SESSION, // Request type m_qosd, // QoS LowCost, // MtsMode Downlink, // TrafficDirection -, -, { m_flow_filter("10.10.10.10", 1010) } // // MEC015 Clause 7.2.5 Type: MtsSessionInfo Table 7.2.5-1: Elements of MtsSessionInfo, flowFilter shall be omit )))))); 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_MEC015_SRV_MTS_003_BR /** * @desc Check that the IUT responds with a configured Multi-access Traffic Steering session when queried by a MEC Application */ testcase TC_MEC_MEC015_SRV_MTS_004_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var charstring v_mts_session_id; var MtsSessionInfo v_mts_session_info; // Test control if (not(PICS_MEC_PLAT) or not(PICS_MULTI_ACCESS_TRAFFIC_STEERING_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_MULTI_ACCESS_TRAFFIC_STEERING_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Test adapter configuration // Preamble f_create_mts_session_info_resource(PX_APP_INSTANCE_ID, v_mts_session_id, v_mts_session_info); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_ME_MTS_SESSIONS_URI & "/" & v_mts_session_id, v_headers ))); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_ok( mw_http_message_body_json( mw_body_json_mts_session_info( mw_mts_session_info( v_mts_session_info.appInsId, v_mts_session_info.requestType, -, -, -, v_mts_session_info.sessionId )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a BwInfo ***"); 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_mts_session_info_resource(PX_APP_INSTANCE_ID, v_mts_session_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC015_SRV_MTS_004_OK /** * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application */ testcase TC_MEC_MEC015_SRV_MTS_004_BR() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var charstring v_mts_session_id; var MtsSessionInfo v_mts_session_info; // Test control if (not(PICS_MEC_PLAT) or not(PICS_MULTI_ACCESS_TRAFFIC_STEERING_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_MULTI_ACCESS_TRAFFIC_STEERING_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Test adapter configuration // Preamble f_create_mts_session_info_resource(PX_APP_INSTANCE_ID, v_mts_session_id, v_mts_session_info); f_init_default_headers_list(-, -, v_headers); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & "mts/v0/mts_sessions/" & PX_UNKNOWN_APP_INSTANCE_ID, // Wrong version number v_headers ) ) ); tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_404_not_found( mw_http_message_body_json( mw_body_json_problem_details( mw_problem_details( -, -, 404 )))))) { 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_mts_session_info_resource(PX_APP_INSTANCE_ID, v_mts_session_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC015_SRV_MTS_004_BR /** * @desc Check that the IUT responds with an error when a request with an unknown resource URI is sent by a MEC Application */ testcase TC_MEC_MEC015_SRV_MTS_004_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var charstring v_mts_session_id; var MtsSessionInfo v_mts_session_info; // Test control if (not(PICS_MEC_PLAT) or not(PICS_MULTI_ACCESS_TRAFFIC_STEERING_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_MULTI_ACCESS_TRAFFIC_STEERING_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Test adapter configuration // Preamble f_create_mts_session_info_resource(PX_APP_INSTANCE_ID, v_mts_session_id, v_mts_session_info); f_init_default_headers_list(-, -, v_headers); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_ME_MTS_SESSIONS_URI & "/" & PX_UNKNOWN_APP_INSTANCE_ID, v_headers ) ) ); tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_404_not_found( mw_http_message_body_json( mw_body_json_problem_details( mw_problem_details( -, -, 404 )))))) { 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_mts_session_info_resource(PX_APP_INSTANCE_ID, v_mts_session_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC015_SRV_MTS_004_NF /** * @desc Check that the IUT updates the information about an individual MTS session when commanded by a MEC Application */ testcase TC_MEC_MEC015_SRV_MTS_005_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var charstring v_mts_session_id; var MtsSessionInfo v_mts_session_info; // Test control if (not(PICS_MEC_PLAT) or not(PICS_MULTI_ACCESS_TRAFFIC_STEERING_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_MULTI_ACCESS_TRAFFIC_STEERING_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Test adapter configuration // Preamble f_create_mts_session_info_resource(PX_APP_INSTANCE_ID, v_mts_session_id, v_mts_session_info); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_put( PICS_ROOT_API & PX_ME_MTS_SESSIONS_URI & "/" & v_mts_session_id, v_headers, m_http_message_body_json( m_body_json_mts_session_info( m_mts_session_info( PX_APP_INSTANCE_ID, APPLICATION_SPECIFIC_MTS_SESSION, // Request type m_qosd_1, // QoS LowCost, // MtsMode Downlink // TrafficDirection )))))); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_ok( mw_http_message_body_json( mw_body_json_mts_session_info( mw_mts_session_info( PX_APP_INSTANCE_ID, APPLICATION_SPECIFIC_MTS_SESSION, // Request type mw_qosd_1, // QoS LowCost, // MtsMode Downlink // TrafficDirection )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with an updated MtsSessionInfo ***"); 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_mts_session_info_resource(PX_APP_INSTANCE_ID, v_mts_session_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC015_SRV_MTS_005_OK /** * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application */ testcase TC_MEC_MEC015_SRV_MTS_005_BR() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var charstring v_mts_session_id; var MtsSessionInfo v_mts_session_info; // Test control if (not(PICS_MEC_PLAT) or not(PICS_MULTI_ACCESS_TRAFFIC_STEERING_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_MULTI_ACCESS_TRAFFIC_STEERING_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Test adapter configuration // Preamble f_create_mts_session_info_resource(PX_APP_INSTANCE_ID, v_mts_session_id, v_mts_session_info); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_put( PICS_ROOT_API & PX_ME_MTS_SESSIONS_URI & "/" & v_mts_session_id, v_headers, m_http_message_body_json( m_body_json_mts_session_info( m_mts_session_info( // MEC015 Clause 7.2.5 Type: MtsSessionInfo Table 7.2.5-1: Elements of MtsSessionInfo, flowFilter shall be omit PX_APP_INSTANCE_ID, FLOW_SPECIFIC_MTS_SESSION, // Request type m_qosd_1, // QoS LowCost, // MtsMode Downlink // TrafficDirection )))))); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_400_bad_request( mw_http_message_body_json( mw_body_json_problem_details( mw_problem_details( -, -, 400 )))))) { 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_mts_session_info_resource(PX_APP_INSTANCE_ID, v_mts_session_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC015_SRV_MTS_005_BR /** * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application */ testcase TC_MEC_MEC015_SRV_MTS_005_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; // Test control if (not(PICS_MEC_PLAT) or not(PICS_MULTI_ACCESS_TRAFFIC_STEERING_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_MULTI_ACCESS_TRAFFIC_STEERING_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); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body httpPort.send( m_http_request( m_http_request_put( PICS_ROOT_API & PX_ME_MTS_SESSIONS_URI & "/PX_UNKNOWN_APP_INSTANCE_ID", v_headers, m_http_message_body_json( m_body_json_mts_session_info( m_mts_session_info( PX_APP_INSTANCE_ID, APPLICATION_SPECIFIC_MTS_SESSION, // Request type m_qosd_1, // QoS LowCost, // MtsMode Downlink // TrafficDirection )))))); tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_404_not_found( mw_http_message_body_json( mw_body_json_problem_details( mw_problem_details( -, -, 404 )))))) { 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_MEC015_SRV_MTS_005_NF /** * @desc Check that the IUT deregisters a MTS session when commanded by a MEC Application */ testcase TC_MEC_MEC015_SRV_MTS_006_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var charstring v_mts_session_id; var MtsSessionInfo v_mts_session_info; // Test control if (not(PICS_MEC_PLAT) or not(PICS_MULTI_ACCESS_TRAFFIC_STEERING_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_MULTI_ACCESS_TRAFFIC_STEERING_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Test adapter configuration // Preamble f_create_mts_session_info_resource(PX_APP_INSTANCE_ID, v_mts_session_id, v_mts_session_info); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_delete( PICS_ROOT_API & PX_ME_MTS_SESSIONS_URI & "/" & v_mts_session_id, v_headers ))); // 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 to deletion ***"); 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_MEC015_SRV_MTS_006_OK /** * @desc Check that the IUT responds with an error when a request with an unknown resource URI is sent by a MEC Application */ testcase TC_MEC_MEC015_SRV_MTS_006_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var charstring v_mts_session_id; var MtsSessionInfo v_mts_session_info; // Test control if (not(PICS_MEC_PLAT) or not(PICS_MULTI_ACCESS_TRAFFIC_STEERING_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_MULTI_ACCESS_TRAFFIC_STEERING_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Test adapter configuration // Preamble f_create_mts_session_info_resource(PX_APP_INSTANCE_ID, v_mts_session_id, v_mts_session_info); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_delete( PICS_ROOT_API & PX_ME_MTS_SESSIONS_URI & "/" & PX_UNKNOWN_APP_INSTANCE_ID, v_headers ))); // 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 to deletion ***"); 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_mts_session_info_resource(PX_APP_INSTANCE_ID, v_mts_session_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC015_SRV_MTS_006_NF } // End of group me_app_role } // End of module AtsMec_MultiAccessSteeringInfoAPI_TestCases