/** * @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, Draft ETSI GS MEC 021 V2.1.1 */ module AtsMec_ApplicationMobiltyServiceAPI_TestCases { // JSON import from Json all; // Libcommon import from LibCommon_BasicTypesAndValues 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_ApplicationMobiltyServiceAPI import from ApplicationMobilityServiceAPI_TypesAndValues all; import from ApplicationMobilityServiceAPI_Templates all; import from ApplicationMobilityServiceAPI_Functions all; import from ApplicationMobilityServiceAPI_Pics all; import from ApplicationMobilityServiceAPI_Pixits all; // LibMec import from LibMec_TypesAndValues all; import from LibMec_Templates all; import from LibMec_Functions all; import from LibMec_Pics all; import from LibMec_Pixits all; group appMobilityServices { /** * @desc Check that the AMS service returns information about the registered application mobility services when requested */ testcase TC_MEC_MEC021_SRV_AMS_001_OK_01() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var RegistrationInfo v_registration_info_1; var RegistrationInfo v_registration_info_2; // Test control if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Preamble f_create_application_mobility_services(-, v_registration_info_1); f_create_application_mobility_services(PX_APP_INS_ID_2, v_registration_info_2); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_ME_APP_AMS_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_ams_registration_info_list( { *, v_registration_info_1, v_registration_info_2, * } ))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of RegistrationInfo ***"); 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_application_mobility_services(v_registration_info_1.appMobilityServiceId); f_delete_application_mobility_services(v_registration_info_2.appMobilityServiceId); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC021_SRV_AMS_001_OK_01 /** * @desc Check that the AMS service returns information about the a specific registered application mobility service when requested - filter */ testcase TC_MEC_MEC021_SRV_AMS_001_OK_02() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var RegistrationInfo v_registration_info_1; var RegistrationInfo v_registration_info_2; // Test control if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Preamble f_create_application_mobility_services(-, v_registration_info_1); f_create_application_mobility_services(PX_APP_INS_ID_2, v_registration_info_2); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_ME_APP_AMS_URI & "?filter=(eq,appMobilityServiceId," & v_registration_info_1.appMobilityServiceId & ")", v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_ok( mw_http_message_body_json( mw_body_json_ams_registration_info_list( { *, v_registration_info_1, * } ))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of RegistrationInfo ***"); 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_application_mobility_services(v_registration_info_1.appMobilityServiceId); f_delete_application_mobility_services(v_registration_info_2.appMobilityServiceId); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC021_SRV_AMS_001_OK_02 /** * @desc Check that the AMS service returns information about the a specific registered application mobility service when requested - filter */ testcase TC_MEC_MEC021_SRV_AMS_001_OK_03() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var RegistrationInfo v_registration_info_1; var RegistrationInfo v_registration_info_2; // Test control if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Preamble f_create_application_mobility_services(-, v_registration_info_1); f_create_application_mobility_services(PX_APP_INS_ID_2, v_registration_info_2); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_ME_APP_AMS_URI & "?filter=(eq,serviceConsumerId[appInstanceId]," & PX_APP_INS_ID_2 & ")", v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_ok( mw_http_message_body_json( mw_body_json_ams_registration_info_list( { *, v_registration_info_2, * } ))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of RegistrationInfo ***"); 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_application_mobility_services(v_registration_info_1.appMobilityServiceId); f_delete_application_mobility_services(v_registration_info_2.appMobilityServiceId); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC021_SRV_AMS_001_OK_03 /** * @desc Check that the AMS service returns information about the a specific registered application mobility service when requested - exclude_fields */ testcase TC_MEC_MEC021_SRV_AMS_001_OK_04() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var RegistrationInfo v_registration_info_1; var RegistrationInfo v_registration_info_2; // Test control if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Preamble f_create_application_mobility_services(-, v_registration_info_1); f_create_application_mobility_services(PX_APP_INS_ID_2, v_registration_info_2); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_ME_APP_AMS_URI & "?filter=(eq,appMobilityServiceId," & v_registration_info_1.appMobilityServiceId & "&exclude_fields=[deviceInformation])", v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_ok( mw_http_message_body_json( mw_body_json_ams_registration_info_list( { *, mw_registration_info( v_registration_info_1.appMobilityServiceId, mw_service_consumer_id( PX_APP_INS_ID, PX_MEP_ID )), * } ))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of RegistrationInfo ***"); 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_application_mobility_services(v_registration_info_1.appMobilityServiceId); f_delete_application_mobility_services(v_registration_info_2.appMobilityServiceId); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC021_SRV_AMS_001_OK_04 /** * @desc Check that the AMS service returns information about the registered application mobility services when requested - No registered application mobility service */ testcase TC_MEC_MEC021_SRV_AMS_001_OK_05() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; // Test control if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Preamble f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_ME_APP_AMS_URI, v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_ok_no_body )) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with an empty body ***"); 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_MEC021_SRV_AMS_001_OK_05 /** * @desc Check that the AMS service returns an error when receives a query about a registered application mobility service with wrong parameters */ testcase TC_MEC_MEC021_SRV_AMS_001_BR() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var RegistrationInfo v_registration_info_1; var RegistrationInfo v_registration_info_2; // Test control if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Preamble f_create_application_mobility_services(-, v_registration_info_1); f_create_application_mobility_services(PX_APP_INS_ID_2, v_registration_info_2); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_ME_APP_AMS_URI & "?appMobilityService=" & "?filter=(appMobilityServiceId,eq," & v_registration_info_1.appMobilityServiceId & ")", // Wrong syntax v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_400_bad_request( mw_http_message_body_json( mw_body_json_problem_details( mw_problem_details( -, -, 400 )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with 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_delete_application_mobility_services(v_registration_info_1.appMobilityServiceId); f_delete_application_mobility_services(v_registration_info_2.appMobilityServiceId); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC021_SRV_AMS_001_BR /** * @desc Check that the AMS service creates a new application mobility services when requested */ testcase TC_MEC_MEC021_SRV_AMS_002_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var HttpMessage v_response; var Json.String v_app_mobility_service_id; // Test control if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Preamble f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_post( PICS_ROOT_API & PX_ME_APP_AMS_URI, v_headers, m_http_message_body_json( m_body_json_ams_registration_info( m_registration_info( -, m_service_consumer_id( PX_APP_INS_ID ))))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_201_created( mw_http_message_body_json( mw_body_json_ams_registration_info( mw_registration_info( ?, mw_service_consumer_id( PX_APP_INS_ID ))))))) -> value v_response { tc_ac.stop; v_app_mobility_service_id := v_response.response.body.json_body.registrationInfo.appMobilityServiceId; log("*** " & testcasename() & ": PASS: IUT successfully responds with a v_app_mobility_service_id ", v_app_mobility_service_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_application_mobility_services(v_app_mobility_service_id); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC021_SRV_AMS_002_OK /** * @desc Check that the AMS service sends an error when it receives a malformed request to create a new application mobility service */ testcase TC_MEC_MEC021_SRV_AMS_002_BR() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var HttpMessage v_response; var Json.String v_app_mobility_service_id; // Test control if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Preamble f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_post( PICS_ROOT_API & PX_ME_APP_AMS_URI, v_headers, m_http_message_body_json( m_body_json_ams_registration_info( m_registration_info( PX_APP_INS_ID, // Wrong field value: Shall be absent in POST requests, and present otherwise m_service_consumer_id( PX_APP_INS_ID ))))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_400_bad_request( mw_http_message_body_json( mw_body_json_problem_details( mw_problem_details( -, -, 400 )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a Problem Details when bad request is performed ***"); 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_MEC021_SRV_AMS_002_BR } // End of group appMobilityServices group appMobilityServicesSubscriptions { /** * @desc Check that the AMS service returns information about the available subscriptions when requested */ testcase TC_MEC_MEC021_SRV_AMS_003_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var MobilityProcedureSubscription v_mobility_procedure_subscription; var charstring v_subscription_id; // Test control if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Preamble f_create_mobility_procedure_subscription(v_mobility_procedure_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_APP_AMS_SUBS & "?subscriptionType=" & v_mobility_procedure_subscription.subscriptionType, v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_ok( mw_http_message_body_json( mw_body_json_ams_subscriptions( mw_subscription_link_list( v_mobility_procedure_subscription.links, mw_subscription( -, v_mobility_procedure_subscription.subscriptionType ))))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with the list of subscriptions type MobilityProcedureSubscription ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement // Postamble f_delete_mobility_procedure_subscription(v_subscription_id); f_cf_01_http_down(); } // END TC_MEC_MEC021_SRV_AMS_003_OK /** * @desc Check that the AMS service sends an error when it receives a malformed query about the available subscriptions */ testcase TC_MEC_MEC021_SRV_AMS_003_BR() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; // Test control if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Preamble f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_ME_APP_AMS_SUBS & "?subscriptionType=info_app_adj", // Wrong parameter v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_400_bad_request )) { 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 TC_MEC_MEC021_SRV_AMS_003_BR /** * @desc Check that the AMS service creates a notification subscriptions when requested */ testcase TC_MEC_MEC021_SRV_AMS_004_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var HttpMessage v_response; var charstring v_subscription_id; // Test control if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Preamble f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_post( PICS_ROOT_API & PX_ME_APP_AMS_SUBS, v_headers, m_http_message_body_json( m_body_json_ams_mobility_procedure_subscription( m_mobility_procedure_subscription( PX_CALLBACK_REFERENCE, m_filter_criteria )))))); 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_ams_mobility_procedure_subscription( mw_mobility_procedure_subscription( PX_CALLBACK_REFERENCE, mw_filter_criteria, mw_links )))))) -> 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_ME_APP_AMS_SUBS & "/(?*)", 0 ); log("*** " & testcasename() & ": PASS: IUT successfully responds with a AMS Subscription and 201 Created status code, 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_mobility_procedure_subscription(v_subscription_id); f_cf_01_http_down(); } // End of TC_MEC_MEC021_SRV_AMS_004_OK /** * @desc Check that the AMS service sends an error when it receives a malformed request to create a notification subscription */ testcase TC_MEC_MEC021_SRV_AMS_004_BR() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var MobilityProcedureSubscription v_mobility_procedure_subscription; var charstring v_subscription_id; // Test control if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Preamble f_create_mobility_procedure_subscription(v_mobility_procedure_subscription, v_subscription_id); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_post( PICS_ROOT_API & PX_ME_APP_AMS_SUBS, v_headers, m_http_message_body_json( m_body_json_ams_mobility_procedure_subscription( m_mobility_procedure_subscription_error( PX_CALLBACK_REFERENCE, m_filter_criteria )))))); 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_mobility_procedure_subscription(v_subscription_id); f_cf_01_http_down(); } // End of TC_MEC_MEC021_SRV_AMS_004_BR /** * @desc Check that the AMS service returns information about a given subscription when requested */ testcase TC_MEC_MEC021_SRV_AMS_005_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var MobilityProcedureSubscription v_mobility_procedure_subscription; var charstring v_subscription_id; // Test control if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Preamble f_create_mobility_procedure_subscription(v_mobility_procedure_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_APP_AMS_SUBS & "/" & 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_ams_mobility_procedure_subscription( v_mobility_procedure_subscription ))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct 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_mobility_procedure_subscription(v_subscription_id); f_cf_01_http_down(); } // End of TC_MEC_MEC021_SRV_AMS_005_OK /** * @desc Check that the AMS service returns an error when receives a query about a not existing subscription */ testcase TC_MEC_MEC021_SRV_AMS_005_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var MobilityProcedureSubscription v_mobility_procedure_subscription; var charstring v_subscription_id; // Test control if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Preamble f_create_mobility_procedure_subscription(v_mobility_procedure_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_APP_AMS_SUBS & "/" & PX_NON_EXISTENT_SUBSCRIPTION_ID, v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_404_not_found )) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement // Postamble f_delete_mobility_procedure_subscription(v_subscription_id); f_cf_01_http_down(); } // End of TC_MEC_MEC021_SRV_AMS_005_NF /** * @desc Check that the AMS service deletes a given subscription when requested */ testcase TC_MEC_MEC021_SRV_AMS_006_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var MobilityProcedureSubscription v_mobility_procedure_subscription; var charstring v_subscription_id; // Test control if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Preamble f_create_mobility_procedure_subscription(v_mobility_procedure_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_APP_AMS_SUBS & "/" & 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 the correct 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 TC_MEC_MEC021_SRV_AMS_006_OK /** * @desc Check that the AMS service sends an error when it receives a delete request for a not existing subscription */ testcase TC_MEC_MEC021_SRV_AMS_006_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var MobilityProcedureSubscription v_mobility_procedure_subscription; var charstring v_subscription_id; // Test control if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Preamble f_create_mobility_procedure_subscription(v_mobility_procedure_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_APP_AMS_SUBS & "/" & PX_NON_EXISTENT_SUBSCRIPTION_ID, v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_404_not_found )) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement // Postamble f_delete_mobility_procedure_subscription(v_subscription_id); f_cf_01_http_down(); } // End of TC_MEC_MEC021_SRV_AMS_006_NF /** * @desc Check that the AMS service modifies a given subscription when requested */ testcase TC_MEC_MEC021_SRV_AMS_007_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var MobilityProcedureSubscription v_mobility_procedure_subscription; var charstring v_subscription_id; // Test control if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Preamble f_create_mobility_procedure_subscription(v_mobility_procedure_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_APP_AMS_SUBS & "/" & v_subscription_id, v_headers, m_http_message_body_json( m_body_json_ams_mobility_procedure_subscription( m_mobility_procedure_subscription( PX_CALLBACK_REFERENCE, m_filter_criteria( PX_APP_INS_ID ))))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_ok( mw_http_message_body_json( mw_body_json_ams_mobility_procedure_subscription( m_mobility_procedure_subscription( PX_CALLBACK_REFERENCE, m_filter_criteria( PX_APP_INS_ID ))))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully updates successfully the 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_mobility_procedure_subscription(v_subscription_id); f_cf_01_http_down(); } // End of TC_MEC_MEC021_SRV_AMS_007_OK /** * @desc Check that the AMS service sends an error when it receives a malformed modify request for a given subscription */ testcase TC_MEC_MEC021_SRV_AMS_007_BR() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var MobilityProcedureSubscription v_mobility_procedure_subscription; var charstring v_subscription_id; // Test control if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Preamble f_create_mobility_procedure_subscription(v_mobility_procedure_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_APP_AMS_SUBS & "/" & v_subscription_id, v_headers, m_http_message_body_json( m_body_json_ams_mobility_procedure_subscription( m_mobility_procedure_subscription_error( PX_CALLBACK_REFERENCE, m_filter_criteria( PX_APP_INS_ID ))))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_400_bad_request )) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with the correct error code ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement // Postamble f_delete_mobility_procedure_subscription(v_subscription_id); f_cf_01_http_down(); } // End of TC_MEC_MEC021_SRV_AMS_007_BR /** * @desc Check that the AMS service sends an error when it receives a modify request for a not existing subscription */ testcase TC_MEC_MEC021_SRV_AMS_007_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var MobilityProcedureSubscription v_mobility_procedure_subscription; var charstring v_subscription_id; // Test control if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Preamble f_create_mobility_procedure_subscription(v_mobility_procedure_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_APP_AMS_SUBS & "/" & PX_NON_EXISTENT_SUBSCRIPTION_ID, v_headers, m_http_message_body_json( m_body_json_ams_mobility_procedure_subscription( m_mobility_procedure_subscription( PX_CALLBACK_REFERENCE, m_filter_criteria( PX_APP_INS_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_delete_mobility_procedure_subscription(v_subscription_id); f_cf_01_http_down(); } // End of TC_MEC_MEC021_SRV_AMS_007_NF } // End of group appMobilityServicesSubscriptions group ams_notifications { /** * @desc Check that the AMS service sends an AMS notification about a mobility procedure if the AMS service has an associated subscription and the event is generated */ testcase TC_MEC_MEC021_SRV_AMS_008_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var MobilityProcedureSubscription v_mobility_procedure_subscription; var charstring v_subscription_id; // Test control if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_notif_up(); // Preamble f_create_mobility_procedure_subscription(v_mobility_procedure_subscription, v_subscription_id); action("Trigger a mobility procedure event"); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_wait.start; alt { [] httpPort_notif.receive( mw_http_request( mw_http_request_post( -, -, mw_http_message_body_json( mw_body_json_mobility_procedure_notification( mw_mobility_procedure_notification( v_mobility_procedure_subscription.links )))))) { tc_wait.stop; // Send 204 No Content f_init_default_headers_list(-, -, v_headers); httpPort_notif.send(m_http_response(m_http_response_204_no_content(v_headers))); log("*** " & testcasename() & ": PASS: IUT successfully sends mobility procedure notification ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_wait.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement // Postamble f_delete_mobility_procedure_subscription(v_subscription_id); f_cf_01_http_notif_down(); } // End of TC_MEC_MEC021_SRV_AMS_008_OK /** * @desc Check that the AMS service sends an AMS notification about adjacent application instances if the AMS service has an associated subscription and the event is generated */ testcase TC_MEC_MEC021_SRV_AMS_009_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var AdjacentAppInfoSubscription v_adjacent_appInfo_subscription; var charstring v_subscription_id; // Test control if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_notif_up(); // Preamble f_create_adjacent_appInfo_subscription(v_adjacent_appInfo_subscription, v_subscription_id); action("Trigger a mobility procedure event"); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_wait.start; alt { [] httpPort_notif.receive( mw_http_request( mw_http_request_post( -, -, mw_http_message_body_json( mw_body_json_adjacent_app_info_notification( mw_adjacent_app_info_notification( v_adjacent_appInfo_subscription.links )))))) { tc_wait.stop; // Send 204 No Content f_init_default_headers_list(-, -, v_headers); httpPort_notif.send(m_http_response(m_http_response_204_no_content(v_headers))); log("*** " & testcasename() & ": PASS: IUT successfully sends adjacent appInfo 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_adjacent_appInfo_subscription(v_subscription_id); f_cf_01_http_notif_down(); } // End of TC_MEC_MEC021_SRV_AMS_009_OK /** * @desc Check that the AMS service sends an AMS notification on subscription expiration if the AMS service has an associated subscription and the event is generated */ testcase TC_MEC_MEC021_SRV_AMS_010_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var MobilityProcedureSubscription v_mobility_procedure_subscription; var charstring v_subscription_id; // Test control if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_notif_up(); // Preamble f_create_mobility_procedure_subscription(v_mobility_procedure_subscription, v_subscription_id); action("Trigger a mobility procedure event"); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_wait.start; alt { [] httpPort_notif.receive( mw_http_request( mw_http_request_post( -, -, mw_http_message_body_json( mw_body_json_mobility_procedure_notification( mw_mobility_procedure_notification( v_mobility_procedure_subscription.links )))))) { tc_wait.stop; // Send 204 No Content f_init_default_headers_list(-, -, v_headers); httpPort_notif.send(m_http_response(m_http_response_204_no_content(v_headers))); log("*** " & testcasename() & ": INFO: IUT successfully sends mobility procedure notification ***"); repeat; } [] httpPort_notif.receive( mw_http_request( mw_http_request_post( -, -, mw_http_message_body_json( mw_body_json_expire_notification( mw_expire_notification ))))) { tc_wait.stop; log("*** " & testcasename() & ": PASS: IUT successfully sends expiry 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_mobility_procedure_subscription(v_subscription_id); } // End of TC_MEC_MEC021_SRV_AMS_009_OK } // End of group ams_notifications group individualAppMobilityService { /** * @desc Check that the AMS service returns information about this individual application mobility service */ testcase TC_MEC_MEC021_SRV_AMS_011_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var RegistrationInfo v_registration_info_1; var RegistrationInfo v_registration_info_2; // Test control if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Preamble f_create_application_mobility_services(PX_APP_INS_ID, v_registration_info_1); f_create_application_mobility_services(PX_APP_INS_ID_2, v_registration_info_2); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_ME_APP_AMS_URI & oct2char(unichar2oct(v_registration_info_1.appMobilityServiceId, "UTF-8")), v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_ok( mw_http_message_body_json( mw_body_json_ams_registration_info( v_registration_info_1 ))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a the correct RegistrationInfo ***"); 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_application_mobility_services(v_registration_info_1.appMobilityServiceId); f_delete_application_mobility_services(v_registration_info_2.appMobilityServiceId); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC021_SRV_AMS_011_OK /** * @desc Check that the AMS service sends an error when receives a query about a not existing individual application mobility service */ testcase TC_MEC_MEC021_SRV_AMS_011_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var RegistrationInfo v_registration_info_1; var RegistrationInfo v_registration_info_2; // Test control if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Preamble f_create_application_mobility_services(PX_APP_INS_ID, v_registration_info_1); f_create_application_mobility_services(PX_APP_INS_ID_2, v_registration_info_2); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_ME_APP_AMS_URI & oct2char(unichar2oct(PX_NON_EXISTENT_APP_MOBILITY_SERVICE_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 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_application_mobility_services(v_registration_info_1.appMobilityServiceId); f_delete_application_mobility_services(v_registration_info_2.appMobilityServiceId); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC021_SRV_AMS_011_NF /** * @desc Check that the AMS service modifies the individual application mobility service when requested */ testcase TC_MEC_MEC021_SRV_AMS_012_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var RegistrationInfo v_registration_info_1; var RegistrationInfo v_registration_info_2; // Test control if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Preamble f_create_application_mobility_services(PX_APP_INS_ID, v_registration_info_1); f_create_application_mobility_services(PX_APP_INS_ID_2, v_registration_info_2); v_registration_info_1.serviceConsumerId.appInstanceId := PX_APP_INS_ID_NEW; f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_put( PICS_ROOT_API & PX_ME_APP_AMS_URI & oct2char(unichar2oct(v_registration_info_1.appMobilityServiceId, "UTF-8")), v_headers, m_http_message_body_json( m_body_json_ams_registration_info( v_registration_info_1 ))))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_ok( mw_http_message_body_json( mw_body_json_ams_registration_info( v_registration_info_1 ))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully updates with a the correct RegistrationInfo ***"); 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_application_mobility_services(v_registration_info_1.appMobilityServiceId); f_delete_application_mobility_services(v_registration_info_2.appMobilityServiceId); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC021_SRV_AMS_012_OK /** * @desc Check that the AMS service sends an error when receives a request to modify a individual application mobility service using bad parameters */ testcase TC_MEC_MEC021_SRV_AMS_012_BR() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var RegistrationInfo v_registration_info_1; var RegistrationInfo v_registration_info_2; var Json.String v_appMobilityServiceId; // Test control if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Preamble f_create_application_mobility_services(PX_APP_INS_ID, v_registration_info_1); f_create_application_mobility_services(PX_APP_INS_ID_2, v_registration_info_2); v_appMobilityServiceId := v_registration_info_1.appMobilityServiceId; f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_put( PICS_ROOT_API & PX_ME_APP_AMS_URI & oct2char(unichar2oct(v_registration_info_1.appMobilityServiceId, "UTF-8")), v_headers, m_http_message_body_json( m_body_json_ams_registration_info( v_registration_info_1 ))))); 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 updates with a 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_application_mobility_services(v_appMobilityServiceId); f_delete_application_mobility_services(v_registration_info_2.appMobilityServiceId); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC021_SRV_AMS_012_BR /** * @desc Check that the AMS service sends an error when receives a request to modify a not existing individual application mobility service */ testcase TC_MEC_MEC021_SRV_AMS_012_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var RegistrationInfo v_registration_info_1; var RegistrationInfo v_registration_info_2; // Test control if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Preamble f_create_application_mobility_services(PX_APP_INS_ID, v_registration_info_1); f_create_application_mobility_services(PX_APP_INS_ID_2, v_registration_info_2); v_registration_info_1.serviceConsumerId.appInstanceId := PX_APP_INS_ID_NEW; f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_put( PICS_ROOT_API & PX_ME_APP_AMS_URI & oct2char(unichar2oct(PX_NON_EXISTENT_APP_MOBILITY_SERVICE_ID, "UTF-8")), v_headers, m_http_message_body_json( m_body_json_ams_registration_info( v_registration_info_1 ))))); 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 updates with a 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_application_mobility_services(v_registration_info_1.appMobilityServiceId); f_delete_application_mobility_services(v_registration_info_2.appMobilityServiceId); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC021_SRV_AMS_012_NF /** * @desc Check that the AMS service de-register the individual application mobility service and delete the resource that represents the individual application mobility service */ testcase TC_MEC_MEC021_SRV_AMS_013_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var RegistrationInfo v_registration_info; // Test control if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Preamble f_create_application_mobility_services(PX_APP_INS_ID, v_registration_info); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_delete( PICS_ROOT_API & PX_ME_APP_AMS_URI & oct2char(unichar2oct(v_registration_info.appMobilityServiceId, "UTF-8")), 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 deletes the RegistrationInfo ***"); 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_MEC021_SRV_AMS_013_OK /** * @desc Check that the AMS service sends an error when is requested to delete the resource that represents the individual application mobility service */ testcase TC_MEC_MEC021_SRV_AMS_013_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var RegistrationInfo v_registration_info; // Test control if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Preamble f_create_application_mobility_services(PX_APP_INS_ID, v_registration_info); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_delete( PICS_ROOT_API & PX_ME_APP_AMS_URI & oct2char(unichar2oct(PX_NON_EXISTENT_APP_MOBILITY_SERVICE_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 de-registers the RegistrationInfo ***"); 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_MEC021_SRV_AMS_013_NF } // End of group individualAppMobilityService group appMobilityServiceDeregisterTask { /** * @desc Check that the AMS service deregister an individual application mobility service on expiry of the timer associated with the service */ testcase TC_MEC_MEC021_SRV_AMS_014_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var RegistrationInfo v_registration_info; // Test control if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Preamble f_create_application_mobility_services(PX_APP_INS_ID, v_registration_info); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_post( PICS_ROOT_API & PX_ME_APP_AMS_URI & oct2char(unichar2oct(v_registration_info.appMobilityServiceId, "UTF-8")) & "/deregisterTask", v_headers ))); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_ok( mw_http_message_body_json( mw_body_json_ams_registration_info_list( { *, v_registration_info, * } ))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully deregisters the registerInfo ***"); 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_MEC021_SRV_AMS_014_OK /** * @desc Check that the AMS service send an error when is requested to deregister a not existent individual application mobility service */ testcase TC_MEC_MEC021_SRV_AMS_014_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var RegistrationInfo v_registration_info; // Test control if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Preamble f_create_application_mobility_services(PX_APP_INS_ID, v_registration_info); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_post( PICS_ROOT_API & PX_ME_APP_AMS_URI & oct2char(unichar2oct(PX_NON_EXISTENT_APP_MOBILITY_SERVICE_ID, "UTF-8")) & "/deregisterTask", 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 deregisters the registerInfo ***"); 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_MEC021_SRV_AMS_014_NF } // End of group appMobilityServiceDeregisterTask group adjacentApplicationInstances { /** * @desc Check that the AMS service returns information about the registered application mobility services when requested */ testcase TC_MEC_MEC021_SRV_AMS_015_OK_01() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var AdjacentAppInstanceInfo v_adjacent_app_instance_info_1; var AdjacentAppInstanceInfo v_adjacent_app_instance_info_2; // Test control if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Preamble f_create_adjacent_app_instance_info(-, -, m_communication_interface({{ host := PX_HOST, port_ := PX_PORT }}), v_adjacent_app_instance_info_1); f_create_adjacent_app_instance_info(PX_APP_INS_ID_2, PX_APP_ID_2, m_communication_interface({{ host := PX_HOST, port_ := PX_PORT }}), v_adjacent_app_instance_info_2); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_get( PICS_ROOT_API & PX_ME_APP_AMS_QUERIES_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_ams_adjacent_app_instance_info_list( { *, v_adjacent_app_instance_info_1, v_adjacent_app_instance_info_2, * } ))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of RegistrationInfo ***"); 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_adjacent_app_instance_info(v_adjacent_app_instance_info_1.appInstanceId); f_delete_adjacent_app_instance_info(v_adjacent_app_instance_info_2.appInstanceId); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC021_SRV_AMS_015_OK_01 } // End of group adjacentApplicationInstances } // End of module AtsMec_ApplicationMobiltyServiceAPI_TestCases