/** * @author ETSI / TTF T012 / 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 002, Draft ETSI GS MEC 028 V2.3.1 (2022-07) */ module AtsMec_WlanInformationAPI_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/WlanInformationAPI import from WlanInformationAPI_TypesAndValues all; import from WlanInformationAPI_Pics all; import from WlanInformationAPI_Pixits all; import from WlanInformationAPI_Templates all; import from WlanInformationAPI_Functions 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 list of WLAN Access Point */ testcase TC_MEC_MEC028_SRV_WAI_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_WLAN_INFORMATION_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_WLAN_INFORMATION_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_WLAN_QUERIES_URI & "/ap/ap_information", 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_ap_info_list )))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of ApInfo ***"); 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_MEC028_SRV_WAI_001_OK /** * @desc Check that the IUT responds with the list of WLAN Access Point filtered by the macId provided as query parameter */ testcase TC_MEC_MEC028_SRV_WAI_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_WLAN_INFORMATION_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_WLAN_INFORMATION_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_WLAN_QUERIES_URI & "/ap/ap_information?filter=(eq," & PX_WLAN_FILTER_FIELD & "," & PX_WLAN_FILTER_VALUE & ")", 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_ap_info_list )))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of ApInfo ***"); 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_MEC028_SRV_WAI_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_MEC028_SRV_WAI_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_WLAN_INFORMATION_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_WLAN_INFORMATION_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_WLAN_QUERIES_URI & "/apId/ap_information?filter=(ee," & PX_WLAN_FILTER_FIELD & "," & PX_WLAN_FILTER_VALUE & ")", // Invalid requery 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_cf_01_http_down(); } // End of testcase TC_MEC_MEC028_SRV_WAI_002_BR /** * @desc Check that the IUT responds with the list of Station Point */ testcase TC_MEC_MEC028_SRV_WAI_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_WLAN_INFORMATION_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_WLAN_INFORMATION_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_WLAN_QUERIES_URI & "/sta/sta_information", 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_sta_info_list )))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a StaInfo 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_cf_01_http_down(); } // End of testcase TC_MEC_MEC028_SRV_WAI_003_OK /** * @desc Check that the IUT responds with the list of Station Point filtered by the macId provided as query parameter */ testcase TC_MEC_MEC028_SRV_WAI_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_WLAN_INFORMATION_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_WLAN_INFORMATION_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_WLAN_QUERIES_URI & "/sta/sta_information?filter=(eq," & PX_WLAN_FILTER_FIELD & "," & PX_WLAN_FILTER_VALUE & ")", 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_sta_info_list )))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a StaInfo 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_cf_01_http_down(); } // End of testcase TC_MEC_MEC028_SRV_WAI_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_MEC028_SRV_WAI_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_WLAN_INFORMATION_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_WLAN_INFORMATION_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_WLAN_QUERIES_URI & "/staId/sta_information?filter=(ee," & PX_WLAN_FILTER_FIELD & "," & PX_WLAN_FILTER_VALUE & ")", // Invalid requery 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_cf_01_http_down(); } // End of testcase TC_MEC_MEC028_SRV_WAI_004_BR /** * @desc Check that the IUT responds with the requested list of subscription */ testcase TC_MEC_MEC028_SRV_WAI_005_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var AssocStaSubscription v_assoc_sta_subscription, v_assoc_sta_subscription_1; var Json.String v_subscription_id, v_subscription_id_1; // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_WLAN_INFORMATION_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Test adapter configuration // Preamble f_create_assoc_sta_subscription(v_assoc_sta_subscription, v_subscription_id); f_create_assoc_sta_subscription(v_assoc_sta_subscription, v_subscription_id_1); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_ME_WLAN_URI_SUB, 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_wlan_subscription_link_list( mw_subscription_link_list( -, { *, mw_subscription( v_assoc_sta_subscription.links.self_.href, "AssocStaSubscription" ), mw_subscription( v_assoc_sta_subscription_1.links.self_.href, "AssocStaSubscription" ), * } )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of 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_delete_assoc_sta_subscription(v_subscription_id); f_delete_assoc_sta_subscription(v_subscription_id_1); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC028_SRV_WAI_005_OK /** * @desc Check that the IUT responds with the requested list of subscription when the MEC Platform is queried using a filter on subscription type */ testcase TC_MEC_MEC028_SRV_WAI_006_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var AssocStaSubscription v_assoc_sta_subscription; var Json.String v_subscription_id // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_WLAN_INFORMATION_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Test adapter configuration // Preamble f_create_assoc_sta_subscription(v_assoc_sta_subscription, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_ME_WLAN_URI_SUB & "subscription_type=assoc_sta", 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_wlan_subscription_link_list( mw_subscription_link_list( -, { *, mw_subscription( v_assoc_sta_subscription.links.self_.href, "AssocStaSubscription" ), * } )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of AssocStaSubscription ***"); 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_assoc_sta_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC028_SRV_WAI_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_MEC028_SRV_WAI_006_BR() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var AssocStaSubscription v_assoc_sta_subscription; var Json.String v_subscription_id // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_WLAN_INFORMATION_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Test adapter configuration // Preamble f_create_assoc_sta_subscription(v_assoc_sta_subscription, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_ME_WLAN_URI & "/subscriptions/assoc_sta", 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_assoc_sta_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC028_SRV_WAI_006_BR /** * @desc Check that the IUT responds with an error when a request with not existing parameters is sent */ testcase TC_MEC_MEC028_SRV_WAI_006_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_WLAN_INFORMATION_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_WLAN_INFORMATION_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_WLAN_URI_SUB, 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_MEC028_SRV_WAI_006_NF /** * @desc Check that the IUT responds with a Notification Subscription */ testcase TC_MEC_MEC028_SRV_WAI_007_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var HttpMessage v_response; var Json.String v_subscription_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_WLAN_INFORMATION_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_WLAN_URI_SUB, v_headers, m_http_message_body_json( m_body_json_assoc_sta_subscription( m_assoc_sta_subscription( PX_ASSOC_STA_SUBSCRIPTION_CALLBACK, m_ap_identity( PX_MAC_ID ), -, -, -, 10, // notificationPeriod - Table 6.3.2-1: Attributes of the AssocStaSubscription Note 2 -, m_time_stamp( f_get_current_timestamp_utc() / 1000 + 30 // Expiry time: T + 30 seconds ))))))); 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_assoc_sta_subscription( mw_assoc_sta_subscription( PX_ASSOC_STA_SUBSCRIPTION_CALLBACK, -, -, -, ? )))))) -> 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 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_ME_WLAN_URI_SUB & "/(?*)", 0 ); log("*** " & testcasename() & ": PASS: IUT successfully responds to the subscription, 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_assoc_sta_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC028_SRV_WAI_007_OK /** * @desc Check that the IUT responds with an error when an invalid Subscription request is sent */ testcase TC_MEC_MEC028_SRV_WAI_007_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_WLAN_INFORMATION_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_WLAN_INFORMATION_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_WLAN_URI_SUB, v_headers, m_http_message_body_json( m_body_json_assoc_sta_subscription( m_assoc_sta_subscription_invalid( PX_ASSOC_STA_SUBSCRIPTION_CALLBACK, m_ap_identity( PX_MAC_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_MEC028_SRV_WAI_007_BR /** * @desc Check that the IUT responds with an error when a request with not existing parameters is sent */ testcase TC_MEC_MEC028_SRV_WAI_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_WLAN_INFORMATION_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_WLAN_INFORMATION_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_WLAN_URI_SUB & "&filter=(eq,ap/macId,00:01:02:03:04:04)", v_headers, m_http_message_body_json( m_body_json_assoc_sta_subscription( m_assoc_sta_subscription( PX_ASSOC_STA_SUBSCRIPTION_CALLBACK, m_ap_identity( PX_MAC_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_MEC028_SRV_WAI_007_NF /** * @desc Check that the IUT responds with the list of Subscription */ testcase TC_MEC_MEC028_SRV_WAI_008_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var AssocStaSubscription v_assoc_sta_subscription; var Json.String v_subscription_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_WLAN_INFORMATION_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Test adapter configuration // Preamble f_create_assoc_sta_subscription(v_assoc_sta_subscription, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_ME_WLAN_URI_SUB & "/" & 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_assoc_sta_subscription( mw_assoc_sta_subscription( v_assoc_sta_subscription.callbackReference, -, -, -, v_assoc_sta_subscription.links )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with an AssocStaSubscription ***"); 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_assoc_sta_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC028_SRV_WAI_008_OK /** * @desc Check that the IUT responds with an error when a request for existing subscription with incorrect parameters is sent */ testcase TC_MEC_MEC028_SRV_WAI_008_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_WLAN_INFORMATION_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_WLAN_INFORMATION_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_WLAN_URI & "/subscriptions/unknown", 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 an AssocStaSubscription ***"); 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_MEC028_SRV_WAI_008_NF /** * @desc Check that the IUT responds with a Notification Subscription when it is modified */ testcase TC_MEC_MEC028_SRV_WAI_009_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var AssocStaSubscription v_assoc_sta_subscription; var Json.String v_subscription_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_WLAN_INFORMATION_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Test adapter configuration // Preamble f_create_assoc_sta_subscription(v_assoc_sta_subscription, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_put( PICS_ROOT_API & PX_ME_WLAN_URI_SUB & "/" & v_subscription_id, v_headers, m_http_message_body_json( m_body_json_assoc_sta_subscription( m_assoc_sta_subscription( v_assoc_sta_subscription.callbackReference, m_ap_identity( PX_MAC_ID ), -, -, v_assoc_sta_subscription.links, 12, m_time_stamp( f_get_current_timestamp_utc() / 1000 + 30 // Expiry time: T + 30 seconds ))))))); 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_assoc_sta_subscription( mw_assoc_sta_subscription( v_assoc_sta_subscription.callbackReference, ?, -, -, v_assoc_sta_subscription.links )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds to the AssocStatSubscription update ***"); 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_assoc_sta_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC028_SRV_WAI_009_OK /** * @desc Check that the IUT responds with an error when an invalid field is set in the subscription modification request */ testcase TC_MEC_MEC028_SRV_WAI_009_BR() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var AssocStaSubscription v_assoc_sta_subscription; var Json.String v_subscription_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_WLAN_INFORMATION_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Test adapter configuration // Preamble f_create_assoc_sta_subscription(v_assoc_sta_subscription, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_put( PICS_ROOT_API & PX_ME_WLAN_URI_SUB & "/" & v_subscription_id, v_headers, m_http_message_body_json( m_body_json_assoc_sta_subscription( m_assoc_sta_subscription( "", // No callback reference m_ap_identity( PX_MAC_ID ), -, -, v_assoc_sta_subscription.links, 12, m_time_stamp( f_get_current_timestamp_utc() / 1000 + 30 // Expiry time: T + 30 seconds ))))))); 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 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_assoc_sta_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC028_SRV_WAI_009_BR /** * @desc Check that the IUT responds with an error when an unknown subscription modification request */ testcase TC_MEC_MEC028_SRV_WAI_009_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var AssocStaSubscription v_assoc_sta_subscription; var Json.String v_subscription_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_WLAN_INFORMATION_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Test adapter configuration // Preamble f_create_assoc_sta_subscription(v_assoc_sta_subscription, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_put( PICS_ROOT_API & PX_ME_WLAN_URI_SUB & "/unknown", v_headers, m_http_message_body_json( m_body_json_assoc_sta_subscription( m_assoc_sta_subscription( v_assoc_sta_subscription.callbackReference, m_ap_identity( PX_MAC_ID ), -, -, v_assoc_sta_subscription.links, 12, m_time_stamp( f_get_current_timestamp_utc() / 1000 + 30 // Expiry time: T + 30 seconds ))))))); 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 to the AssocStatSubscription update ***"); 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_assoc_sta_subscription(v_subscription_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC028_SRV_WAI_009_NF /** * @desc Check that the IUT responds with 204 when an existing subscription is correctly deleted */ testcase TC_MEC_MEC028_SRV_WAI_010_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var AssocStaSubscription v_assoc_sta_subscription; var Json.String v_subscription_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_WLAN_INFORMATION_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Test adapter configuration // Preamble f_create_assoc_sta_subscription(v_assoc_sta_subscription, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_delete( PICS_ROOT_API & PX_ME_WLAN_URI_SUB & 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 an AssocStaSubscription ***"); 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_MEC028_SRV_WAI_010_OK /** * @desc Check that the IUT responds with an error when an not existing subscription cannot be deleted */ testcase TC_MEC_MEC028_SRV_WAI_010_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_WLAN_INFORMATION_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_WLAN_INFORMATION_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_ME_WLAN_URI_SUB & "unknown", 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 an AssocStaSubscription ***"); 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_MEC028_SRV_WAI_010_NF /** * @desc Check that the IUT sends a notification about WLAN event notification if the MEC service has an associated subscription and the event is generated */ testcase TC_MEC_MEC028_SRV_WAI_011_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var AssocStaSubscription v_assoc_sta_subscription; var Json.String v_subscription_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_WLAN_INFORMATION_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_assoc_sta_subscription(v_assoc_sta_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( -, -, mw_http_message_body_json( mw_body_json_assoc_sta_subscription( mw_assoc_sta_subscription( PX_ASSOC_STA_SUBSCRIPTION_CALLBACK, -, -, -, ? )))))) { 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 sends notification ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_wait.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement // Postamble f_delete_assoc_sta_subscription(v_subscription_id); f_cf_01_http_notif_down(); } // End of testcase TC_MEC_MEC028_SRV_WAI_011_OK /** * @desc Check that the IUT responds with the list of WLAN Access Point */ testcase TC_MEC_MEC028_SRV_WAI_012_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_WLAN_INFORMATION_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_WLAN_INFORMATION_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_WLAN_QUERIES_URI & "/queries/measurements", 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_wlan_measurement_config_link_list )))) -> value v_response { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of measurement config ***"); 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_MEC028_SRV_WAI_012_OK /** * @desc Check that the IUT responds with a new measurement configuration */ testcase TC_MEC_MEC028_SRV_WAI_013_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var HttpMessage v_response; var Json.String v_measurement_config_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_WLAN_INFORMATION_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_WLAN_URI_MEAS, v_headers, m_http_message_body_json( m_body_json_wlan_measurement_config( m_measurement_config( -, { m_sta_identity( PX_MAC_ID, {PX_SSID}, -, {PX_IP_ADDRESS} ) }, PX_MEASUREMENT_ID, m_measurement_info(1000, 10) )))))); 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_wlan_measurement_config( mw_measurement_config( ?, {mw_sta_identity(PX_MAC_ID, {PX_SSID}, -, {PX_IP_ADDRESS} )}, PX_MEASUREMENT_ID, mw_measurement_info )))))) -> value v_response { tc_ac.stop; v_measurement_config_id := regexp( oct2char(unichar2oct(v_response.response.body.json_body.measurementConfig.links.self_.href)), "?+" & PX_ME_WLAN_URI_MEAS & "/" & "(?*)", 0 ); log("*** " & testcasename() & ": PASS: IUT successfully responds with the new measurement config ***"); 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_measurement_config(v_measurement_config_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC028_SRV_WAI_013_OK /** * @desc Check that the IUT responds with an error when an invalid request is sent */ testcase TC_MEC_MEC028_SRV_WAI_013_BR() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; // Test control if (not(PICS_MEC_PLAT) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_WLAN_INFORMATION_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_WLAN_URI_MEAS, v_headers, m_http_message_body_json( m_body_json_wlan_measurement_config( m_measurement_config( -, { m_sta_identity( PX_MAC_ID & ":00", // Invalid MAC address {PX_SSID}, -, {PX_IP_ADDRESS} ) }, PX_MEASUREMENT_ID, m_measurement_info(1000, 10) )))))); 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 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_MEC028_SRV_WAI_013_BR /** * @desc Check that the IUT responds with the specified measurement configuration */ testcase TC_MEC_MEC028_SRV_WAI_014_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var MeasurementConfig v_measurement_config; var Json.String v_measurement_config_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_WLAN_INFORMATION_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Test adapter configuration // Preamble f_create_measurement_config(v_measurement_config, v_measurement_config_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_ME_WLAN_QUERIES_URI & "/measurements" & "/" & v_measurement_config_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_wlan_measurement_config( mw_measurement_config( ?, { mw_sta_identity( PX_MAC_ID, {PX_SSID}, -, {PX_IP_ADDRESS} ) }, PX_MEASUREMENT_ID, mw_measurement_info )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with the new measurement config ***"); 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_measurement_config(v_measurement_config_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC028_SRV_WAI_014_OK /** * @desc Check that the IUT responds with an error when an invalid request is sent */ testcase TC_MEC_MEC028_SRV_WAI_014_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var MeasurementConfig v_measurement_config; var Json.String v_measurement_config_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_WLAN_INFORMATION_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Test adapter configuration // Preamble f_create_measurement_config(v_measurement_config, v_measurement_config_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_ME_WLAN_QUERIES_URI & "/measurements"& "/" & v_measurement_config_id & "_Invalid", 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 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_measurement_config(v_measurement_config_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC028_SRV_WAI_014_NF /** * @desc Check that the IUT responds with the modified measurement configuration */ testcase TC_MEC_MEC028_SRV_WAI_015_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var MeasurementConfig v_measurement_config; var Json.String v_measurement_config_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_WLAN_INFORMATION_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Test adapter configuration // Preamble f_create_measurement_config(v_measurement_config, v_measurement_config_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_put( PICS_ROOT_API & PX_ME_WLAN_URI_MEAS & "/" & v_measurement_config_id, v_headers, m_http_message_body_json( m_body_json_wlan_measurement_config( m_measurement_config( -, { m_sta_identity( PX_MAC_ID, {PX_SSID}, -, {PX_IP_ADDRESS} ) }, PX_MEASUREMENT_ID, m_measurement_info(2000, 20) )))))); 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_wlan_measurement_config( mw_measurement_config( ?, {mw_sta_identity( PX_MAC_ID, {PX_SSID}, -, {PX_IP_ADDRESS} )}, PX_MEASUREMENT_ID, mw_measurement_info(2000, 20) )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with the new measurement config ***"); 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_measurement_config(v_measurement_config_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC028_SRV_WAI_015_OK /** * @desc Check that the IUT responds with an error when an invalid request is sent */ testcase TC_MEC_MEC028_SRV_WAI_015_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var MeasurementConfig v_measurement_config; var Json.String v_measurement_config_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_WLAN_INFORMATION_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Test adapter configuration // Preamble f_create_measurement_config(v_measurement_config, v_measurement_config_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_put( PICS_ROOT_API & PX_ME_WLAN_URI_MEAS & "/" & v_measurement_config_id & "_Invalid", v_headers, m_http_message_body_json( m_body_json_wlan_measurement_config( m_measurement_config( -, { m_sta_identity( PX_MAC_ID, {PX_SSID}, -, {PX_IP_ADDRESS} ) }, PX_MEASUREMENT_ID, m_measurement_info(2000, 20) )))))); 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 new measurement config ***"); 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_measurement_config(v_measurement_config_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC028_SRV_WAI_015_NF /** * @desc Check that the IUT responds with with 204 when requested to delete the specified measurement configuration */ testcase TC_MEC_MEC028_SRV_WAI_016_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var MeasurementConfig v_measurement_config; var Json.String v_measurement_config_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_WLAN_INFORMATION_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Test adapter configuration // Preamble f_create_measurement_config(v_measurement_config, v_measurement_config_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_delete( PICS_ROOT_API & PX_ME_WLAN_URI_MEAS & "/" & v_measurement_config_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 the new measurement config ***"); 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_MEC028_SRV_WAI_016_OK /** * @desc Check that the IUT responds with an error when an invalid request is sent */ testcase TC_MEC_MEC028_SRV_WAI_016_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var MeasurementConfig v_measurement_config; var Json.String v_measurement_config_id; // Test control if (not(PICS_MEC_PLAT) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_WLAN_INFORMATION_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Test adapter configuration // Preamble f_create_measurement_config(v_measurement_config, v_measurement_config_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_delete( PICS_ROOT_API & PX_ME_WLAN_URI_MEAS & "/" & v_measurement_config_id & "_invalid", 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_measurement_config(v_measurement_config_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC028_SRV_WAI_016_NF } // End of group me_app_role } // End of module AtsMec_WlanInformationAPI_TestCases