/** * @author ETSI / STF569 * @version $URL:$ * $ID:$ * @desc This module provides the MEC test cases. * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. * The copyright and the foregoing restriction extend to reproduction in all media. * All rights reserved. * @see ETSI GS MEC 003, ETSI GS MEC 029 V2.2.1 */ module AtsMec_FixedAccessInformationServiceAPI_TestCases { // 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_FixedAccessInformationServiceAPI import from FixedAccessInformationServiceAPI_TypesAndValues all; import from FixedAccessInformationServiceAPI_Templates all; import from FixedAccessInformationServiceAPI_Functions all; import from FixedAccessInformationServiceAPI_Pics all; import from FixedAccessInformationServiceAPI_Pixits all; // LibMec import from LibMec_Templates all; import from LibMec_Functions all; import from LibMec_Pics all; import from LibMec_Pixits all; /* * Fixed Access Information Service (FAIS) */ group fixedAccessInfoService { /** * @desc Check that the IUT responds with the current status of the fixed access information when queried by a MEC Application */ testcase TC_MEC_MEC029_SRV_FAIS_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_FAI_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } // Preamble f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PX_FAI_FA_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_fai_fa_info( mw_fa_info ))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a FaInfo ***"); 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_MEC029_SRV_FAIS_001_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_MEC029_SRV_FAIS_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_FAI_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_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( PX_FAI_FA_INFO_URI & "?if=1", 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 ProblemDetails set to 400 Bad Request ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC029_SRV_FAIS_001_BR /** * @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_MEC029_SRV_FAIS_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_FAI_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_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_FAI_FA_INFO_URI & "?interface=666", 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_MEC029_SRV_FAIS_001_NF /** * @desc Check that the IUT responds with the current status of the device information when queried by a MEC Application */ testcase TC_MEC_MEC029_SRV_FAIS_002_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_FAI_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_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_FAI_DEVICE_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_fai_device_info( mw_device_info ))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a DeviceInfo ***"); 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_MEC029_SRV_FAIS_002_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_MEC029_SRV_FAIS_002_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_FAI_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_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_FAI_DEVICE_INFO_URI & "?dev=__any_value__", 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 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_MEC029_SRV_FAIS_002_BR /** * @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_MEC029_SRV_FAIS_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_FAI_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_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_FAI_DEVICE_INFO_URI & "?gwId=" & oct2char(unichar2oct(PX_NON_EXISTING_FAI_GW_ID[0], "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_MEC029_SRV_FAIS_002_NF /** * @desc CCheck that the IUT responds with the current status of the cable line information when queried by a MEC Application */ testcase TC_MEC_MEC029_SRV_FAIS_003_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_FAI_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_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_FAI_CABLE_LINE_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_fai_cable_line_info( mw_cable_line_info ))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a CableLineInfo ***"); 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_MEC029_SRV_FAIS_003_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_MEC029_SRV_FAIS_003_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_FAI_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_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_FAI_CABLE_LINE_INFO_URI & "?cm=__any_value__", 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 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_MEC029_SRV_FAIS_003_BR /** * @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_MEC029_SRV_FAIS_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_FAI_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_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_FAI_CABLE_LINE_INFO_URI & "?cmId=" & oct2char(unichar2oct(PX_NON_EXISTING_FAI_CM_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_MEC029_SRV_FAIS_003_NF /** * @desc Check that the IUT responds with the current status of the optical network information when queried by a MEC Application */ testcase TC_MEC_MEC029_SRV_FAIS_004_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_FAI_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_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_FAI_OPTICAL_NW_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_fai_pon_info( mw_pon_info ))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a PonInfo ***"); 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_MEC029_SRV_FAIS_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_MEC029_SRV_FAIS_004_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_FAI_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_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_FAI_OPTICAL_NW_INFO_URI & "?onu=__any_value__", 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 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_MEC029_SRV_FAIS_004_BR /** * @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_MEC029_SRV_FAIS_004_NF() 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_FAI_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_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_FAI_OPTICAL_NW_INFO_URI & "?onuId=" & oct2char(unichar2oct(PX_NON_EXISTING_FAI_ONU_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_MEC029_SRV_FAIS_004_NF /** * @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 */ testcase TC_MEC_MEC029_SRV_FAIS_005_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_FAI_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_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_FAI_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_fai_subscription_link_list( mw_subscription_link_list ))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a SubscriptionLinkList ***"); 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_MEC029_SRV_FAIS_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_MEC029_SRV_FAIS_005_BR() 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_FAI_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_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_FAI_SUB_URI & "?subscription=__any_value", 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 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_MEC029_SRV_FAIS_005_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_MEC029_SRV_FAIS_005_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_FAI_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_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_FAI_SUB_URI & "/" & oct2char(unichar2oct(PX_NON_EXISTING_FAI_SUB_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 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_MEC029_SRV_FAIS_005_NF /** * @desc Check that the IUT acknowledges the subscription by a MEC Application to notifications on Optical Network Unit alarm events */ testcase TC_MEC_MEC029_SRV_FAIS_006_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var HttpMessage v_response; var OnuAlarmSubscription v_onu_alarm_subscription; var charstring v_subscription_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_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_FAI_SUB_URI, v_headers, m_http_message_body_json( m_body_json_fai_onu_alarm_subscription( m_onu_alarm_subscription( PX_ONU_ALARM_SUB_CALLBACK_URI, m_filter_criteria_onu_alarm )))))); 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_fai_onu_alarm_subscription( mw_onu_alarm_subscription( PX_ONU_ALARM_SUB_CALLBACK_URI )))))) -> 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_FAI_SUB_URI & "/(?*)", 0 ); log("*** " & testcasename() & ": PASS: IUT successfully responds with a onuAlarmSubscription, 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_onu_alarm_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC029_SRV_FAIS_006_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_MEC029_SRV_FAIS_006_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_FAI_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_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_FAI_SUB_URI, v_headers, m_http_message_body_json( m_body_json_fai_onu_alarm_subscription( m_onu_alarm_subscription_bad_request( PX_ONU_ALARM_SUB_CALLBACK_URI, m_filter_criteria_onu_alarm )))))); 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_MEC029_SRV_FAIS_006_BR /** * @desc Check that the IUT responds with the information on a given subscription when queried by a MEC Application */ testcase TC_MEC_MEC029_SRV_FAIS_007_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var OnuAlarmSubscription v_onu_alarm_subscription; var charstring v_subscription_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Test adapter configuration // Preamble f_create_onu_alarm_subscription(v_onu_alarm_subscription, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_FAI_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_fai_onu_alarm_subscription( mw_onu_alarm_subscription ))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a OnuAlarmSubscription ***"); 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_onu_alarm_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC029_SRV_FAIS_007_OK /** * @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_MEC029_SRV_FAIS_007_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_FAI_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_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_FAI_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 a 404 Not Found ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC029_SRV_FAIS_007_NF /** * @desc Check that the IUT updates an existing subscription when commanded by a MEC Application */ testcase TC_MEC_MEC029_SRV_FAIS_008_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var OnuAlarmSubscription v_onu_alarm_subscription; var charstring v_subscription_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Test adapter configuration // Preamble f_create_onu_alarm_subscription(v_onu_alarm_subscription, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_put( PICS_ROOT_API & PX_FAI_SUB_URI & "/" & v_subscription_id, v_headers, m_http_message_body_json( m_body_json_fai_onu_alarm_subscription( m_onu_alarm_subscription( PX_ONU_ALARM_SUB_CALLBACK_URI, m_filter_criteria_onu_alarm )))))); 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_fai_onu_alarm_subscription( mw_onu_alarm_subscription ))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a userTrackingSubscription ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement // Postamble f_delete_onu_alarm_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC029_SRV_FAIS_008_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_MEC029_SRV_FAIS_008_BR() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var OnuAlarmSubscription v_onu_alarm_subscription; var charstring v_subscription_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Test adapter configuration // Preamble f_create_onu_alarm_subscription(v_onu_alarm_subscription, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_put( PICS_ROOT_API & PX_FAI_SUB_URI & "/" & v_subscription_id, v_headers, m_http_message_body_json( m_body_json_fai_onu_alarm_subscription( m_onu_alarm_subscription_bad_request( PX_ONU_ALARM_SUB_CALLBACK_URI, m_filter_criteria_onu_alarm )))))); 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_delete_onu_alarm_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC029_SRV_FAIS_008_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_MEC029_SRV_FAIS_008_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var OnuAlarmSubscription v_onu_alarm_subscription; var charstring v_subscription_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Test adapter configuration // Preamble f_create_onu_alarm_subscription(v_onu_alarm_subscription, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_put( PICS_ROOT_API & PX_FAI_SUB_URI & oct2char(unichar2oct(PX_NON_EXISTENT_SUBSCRIPTION_ID, "UTF-8")), v_headers, m_http_message_body_json( m_body_json_fai_onu_alarm_subscription( m_onu_alarm_subscription( PX_ONU_ALARM_SUB_CALLBACK_URI, m_filter_criteria_onu_alarm )))))); 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 HTTP error 404 ***"); 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_onu_alarm_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC029_SRV_FAIS_008_NF /** * @desc Check that the IUT responds with an error when a request sent by a MEC Application doesn't comply with a required condition */ testcase TC_MEC_MEC029_SRV_FAIS_008_PF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var OnuAlarmSubscription v_onu_alarm_subscription; var charstring v_subscription_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Test adapter configuration // Preamble f_create_onu_alarm_subscription(v_onu_alarm_subscription, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_put( PICS_ROOT_API & PX_FAI_SUB_URI & "/" & v_subscription_id, v_headers, m_http_message_body_json( m_body_json_fai_onu_alarm_subscription( m_onu_alarm_subscription( PX_ONU_ALARM_SUB_CALLBACK_URI, m_filter_criteria_onu_alarm )))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_412_precondition_failed )) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a ProblemDetails set to 412 Precondition Failed ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement // Postamble f_delete_onu_alarm_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC029_SRV_FAIS_008_PF /** * @desc Check that the IUT acknowledges the cancellation of UE location change notifications when commanded by a MEC Application */ testcase TC_MEC_MEC029_SRV_FAIS_009_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var OnuAlarmSubscription v_onu_alarm_subscription; var charstring v_subscription_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Test adapter configuration // Preamble f_create_onu_alarm_subscription(v_onu_alarm_subscription, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_delete( PICS_ROOT_API & PX_FAI_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_MEC029_SRV_FAIS_009_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_MEC029_SRV_FAIS_009_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var OnuAlarmSubscription v_onu_alarm_subscription; var charstring v_subscription_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Test adapter configuration // Preamble f_create_onu_alarm_subscription(v_onu_alarm_subscription, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_delete( PICS_ROOT_API & PX_FAI_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 no 404 Not Found ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement // Postamble f_delete_onu_alarm_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC029_SRV_FAIS_009_NF /** * @desc Check that the IUT sends notification on expiry of Fixed Access Information event subscription to a MEC Application */ testcase TC_MEC_MEC029_SRV_FAIS_010_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var DevInfoSubscription v_dev_info_subscription; var charstring v_subscription_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_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_dev_info_subscription(v_dev_info_subscription, v_subscription_id); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_wait.start; alt { [] httpPort_notif.receive( mw_http_request( mw_http_request_post( PX_FAI_SUB_URI, -, mw_http_message_body_json( mw_body_json_fai_dev_info_subscription( mw_dev_info_subscription( PX_DEV_ALARM_SUB_CALLBACK_URI )))))) { tc_wait.stop; 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 DevInfoSubscription ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_wait.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement // Postamble f_delete_dev_info_subscription(v_subscription_id); f_cf_01_http_notif_down(); } // End of testcase TC_MEC_MEC029_SRV_FAIS_010_OK /** * @desc Check that the IUT acknowledges the subscription by a MEC Application to notifications on Optical Network Unit alarm events */ testcase TC_MEC_MEC029_SRV_FAIS_011_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var OnuAlarmSubscription v_onu_alarm_subscription; var charstring v_subscription_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_FAI_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_FAI_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Test adapter configuration // Preamble f_create_onu_alarm_subscription(v_onu_alarm_subscription, v_subscription_id); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_wait.start; alt { [] httpPort_notif.receive( mw_http_request( mw_http_request_post( PX_FAI_SUB_URI, -, mw_http_message_body_json( mw_body_json_fai_onu_alarm_subscription( mw_onu_alarm_subscription( PX_DEV_ALARM_SUB_CALLBACK_URI )))))) { tc_wait.stop; 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 DevInfoSubscription ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_wait.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement // Postamble f_delete_onu_alarm_subscription(v_subscription_id); f_cf_01_http_notif_down(); } // End of testcase TC_MEC_MEC029_SRV_FAIS_011_OK } // End of group fixedAccessInfoService } // End of module AtsMec_FixedAccessInformationServiceAPI_TestCases