/** * @author ETSI / TTF T012 * @version $URL:$ * $ID:$ * @desc This module provides the MEC test cases. * @copyright ETSI Copyright Notification * No part may be reproduced except as authorized by written permission. * The copyright and the foregoing restriction extend to reproduction in all media. * All rights reserved. * @see ETSI GS MEC 002, Draft ETSI GS MEC 016 V2.2.1 (2020-04) */ module AtsMec_DeviceApplicationInterfaceAPI_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 LibItsHttp_TypesAndValues all; import from LibItsHttp_Functions all; import from LibItsHttp_Templates all; import from LibItsHttp_JsonTemplates all; import from LibItsHttp_TestSystem all; // LibMec/DeviceApplicationInterface import from DeviceApplicationInterfaceAPI_TypesAndValues all; import from DeviceApplicationInterfaceAPI_Pics all; import from DeviceApplicationInterfaceAPI_Pixits all; import from DeviceApplicationInterfaceAPI_Templates all; import from DeviceApplicationInterfaceAPI_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 user applications when requested by an UE Application * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v2.2.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeApplications.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPS_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_DEVICE_APPLICATION_INTERFACE_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_DEVICE_APPLICATION_INTERFACE_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_DEVICE_APP_LIST_URI, v_headers ) ) ); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_ok( mw_http_message_body_json( mw_body_json_device_info_app_list )))) -> value v_response { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of Application ***"); 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_MEC016_MEO_UEAPPS_001_OK /** * @desc Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v2.2.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeApplications.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPS_001_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; // Test control if (not(PICS_MEC_PLAT) or not(PICS_DEVICE_APPLICATION_INTERFACE_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_DEVICE_APPLICATION_INTERFACE_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_DEVICE_APP_LIST_URI & "appName", 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_MEC016_MEO_UEAPPS_001_NF /** * @desc Check that the IUT responds with the list of user applications when requested by an UE Application * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v2.2.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeApplications.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPS_002_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var HttpMessage v_response; // Test control if (not(PICS_MEC_PLAT) or not(PICS_DEVICE_APPLICATION_INTERFACE_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_DEVICE_APPLICATION_INTERFACE_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_DEVICE_APP_LIST_URI & "?appName=" & PX_DEVICE_APP_NAME, 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_device_info_app_list )))) -> value v_response { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of Application ***"); 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_MEC016_MEO_UEAPPS_002_OK /** * @desc Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v2.2.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeApplications.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPS_002_BR() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; // Test control if (not(PICS_MEC_PLAT) or not(PICS_DEVICE_APPLICATION_INTERFACE_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_DEVICE_APPLICATION_INTERFACE_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_DEVICE_APP_LIST_URI & "appName", 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_MEC016_MEO_UEAPPS_002_BR /** * @desc Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v2.2.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeApplications.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPS_002_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; // Test control if (not(PICS_MEC_PLAT) or not(PICS_DEVICE_APPLICATION_INTERFACE_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_DEVICE_APPLICATION_INTERFACE_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_DEVICE_APP_LIST_URI & "appName", 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_MEC016_MEO_UEAPPS_002_NF /** * @desc Check that the IUT acknowledges the creation of the application context when requested by an UE Application * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v2.2.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeAppsContext.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPCTX_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_DEVICE_APPLICATION_INTERFACE_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_DEVICE_APPLICATION_INTERFACE_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_DEVICE_APP_CTX_URI, v_headers, m_http_message_body_json( m_body_json_device_info_app_context( m_device_app_context( PX_ASSOCIATE_DEV_APPID, m_app_context_info( PX_APPD_ID, PX_APP_NAME, PX_APP_PROVIDER, PX_APPD_VERSION ), PX_DEVICE_APP_CALLBACK ) ) ) ) ) ); 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_device_info_app_context( mw_device_app_context( -, PX_ASSOCIATE_DEV_APPID, mw_app_context_info, PX_DEVICE_APP_CALLBACK )))))) -> value v_response { tc_ac.stop; // TODO Check presence of Location HTTP header log("*** " & testcasename() & ": PASS: IUT successfully responds with an Application Context ***"); 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_context(v_response.response.body.json_body.appContext_device_info); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC016_MEO_UEAPPCTX_001_OK /** * @desc Check that the IUT responds with an error when a request with incorrect URL is sent by a MEC Application * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v2.2.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeAppsContext.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPCTX_001_BR() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; // Test control if (not(PICS_MEC_PLAT) or not(PICS_DEVICE_APPLICATION_INTERFACE_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_DEVICE_APPLICATION_INTERFACE_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_DEVICE_APP_CTX_URI & "Invalid", v_headers, m_http_message_body_json( m_body_json_device_info_app_context( m_device_app_context( PX_ASSOCIATE_DEV_APPID, m_app_context_info( PX_APPD_ID, PX_APP_NAME, PX_APP_PROVIDER, PX_APPD_VERSION ), PX_DEVICE_APP_CALLBACK ) ) ) ) ) ); 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 an Application Contexta 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_MEC016_MEO_UEAPPCTX_001_BR /** * @desc Check that the IUT responds with an error when a request with incorrect URL is sent by a MEC Application * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v2.2.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeAppsContext.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPCTX_001_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; // Test control if (not(PICS_MEC_PLAT) or not(PICS_DEVICE_APPLICATION_INTERFACE_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_DEVICE_APPLICATION_INTERFACE_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_DEVICE_APP_CTX_URI, v_headers, m_http_message_body_json( m_body_json_device_info_app_context( m_device_app_context( PX_ASSOCIATE_DEV_APPID, m_app_context_info( PX_APPD_ID, PX_UNKNOWN_APP_NAME, PX_APP_PROVIDER, PX_APPD_VERSION ), PX_DEVICE_APP_CALLBACK ) ) ) ) ) ); 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 Application Contexta 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_MEC016_MEO_UEAPPCTX_001_NF /** * @desc Check that the IUT acknowledges the creation of the application context when requested by an UE Application * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v2.2.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeAppsContext.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPCTX_002_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var AppContext v_device_info_app_context; var HttpMessage v_response; // Test control if (not(PICS_MEC_PLAT) or not(PICS_DEVICE_APPLICATION_INTERFACE_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_DEVICE_APPLICATION_INTERFACE_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Test adapter configuration // Preamble f_create_application_context(v_device_info_app_context); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_put( PICS_ROOT_API & PX_DEVICE_APP_CTX_URI & "/" & v_device_info_app_context.contextId, v_headers, m_http_message_body_json( m_body_json_device_info_app_context( m_device_app_context( PX_ASSOCIATE_DEV_APPID, m_app_context_info( PX_APPD_ID, PX_APP_NAME, PX_APP_PROVIDER, PX_APPD_VERSION ), PX_DEVICE_NEW_APP_CALLBACK ) ) ) ) ) ); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_204_no_content )) -> value v_response { tc_ac.stop; // TODO Check presence of Location HTTP header log("*** " & testcasename() & ": PASS: IUT successfully updates the Application Context ***"); 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_context(v_device_info_app_context); f_cf_01_http_down(); } // End of testcase TC_MEC_MEC016_MEO_UEAPPCTX_002_OK /** * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v2.2.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeAppsContext.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPCTX_002_BR() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var AppContext v_device_info_app_context; var HttpMessage v_response; // Test control if (not(PICS_MEC_PLAT) or not(PICS_DEVICE_APPLICATION_INTERFACE_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_DEVICE_APPLICATION_INTERFACE_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Test adapter configuration // Preamble f_create_application_context(v_device_info_app_context); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_put( PICS_ROOT_API & PX_DEVICE_APP_CTX_URI & "/" & v_device_info_app_context.contextId, v_headers, m_http_message_body_json( m_body_json_device_info_app_context( m_device_app_context( PX_INVALID_ASSOCIATE_DEV_APPID, m_app_context_info( PX_APPD_ID, PX_APP_NAME, PX_APP_PROVIDER, PX_APPD_VERSION ), PX_DEVICE_NEW_APP_CALLBACK ) ) ) ) ) ); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_400_bad_request )) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a correct error code ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC016_MEO_UEAPPCTX_002_BR /** * @desc Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v2.2.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeAppsContext.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPCTX_002_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; // Test control if (not(PICS_MEC_PLAT) or not(PICS_DEVICE_APPLICATION_INTERFACE_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_DEVICE_APPLICATION_INTERFACE_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Test adapter configuration // Preamble f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_put( PICS_ROOT_API & PX_DEVICE_APP_CTX_URI & "/" & PX_UNKNOWN_APP_CONTEXT_ID, v_headers, m_http_message_body_json( m_body_json_device_info_app_context( m_device_app_context( PX_ASSOCIATE_DEV_APPID, m_app_context_info( PX_APPD_ID, PX_APP_NAME, PX_APP_PROVIDER, PX_APPD_VERSION ), PX_DEVICE_NEW_APP_CALLBACK ) ) ) ) ) ); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_404_not_found )) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a 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_MEC016_MEO_UEAPPCTX_002_NF /** * @desc Check that the IUT deletes the application context when commanded by an UE Application * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v2.2.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeAppsContext.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPCTX_003_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; var AppContext v_device_info_app_context; // Test control if (not(PICS_MEC_PLAT) or not(PICS_DEVICE_APPLICATION_INTERFACE_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_DEVICE_APPLICATION_INTERFACE_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } // Test component configuration f_cf_01_http_up(); // Test adapter configuration // Preamble f_create_application_context(v_device_info_app_context); f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( m_http_request_delete( PICS_ROOT_API & PX_DEVICE_APP_CTX_URI & "/" & PX_UNKNOWN_APP_CONTEXT_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 a correct error code ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC016_MEO_UEAPPCTX_003_OK /** * @desc Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v2.2.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeAppsContext.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPCTX_003_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; // Test control if (not(PICS_MEC_PLAT) or not(PICS_DEVICE_APPLICATION_INTERFACE_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_DEVICE_APPLICATION_INTERFACE_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_DEVICE_APP_CTX_URI & "/" & PX_UNKNOWN_APP_CONTEXT_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 a correct error code ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { log("*** " & testcasename() & ": INCONC: Expected message not received ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement // Postamble f_cf_01_http_down(); } // End of testcase TC_MEC_MEC016_MEO_UEAPPCTX_003_NF /** * @desc Check that the IUT sends the locations available for instantiation of a specific user application when requested by an UE Application * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v2.2.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeApplicationsLocation.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPLOC_001_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; // Test control if (not(PICS_MEC_PLAT) or not(PICS_DEVICE_APPLICATION_INTERFACE_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_DEVICE_APPLICATION_INTERFACE_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_DEVICE_APP_LIST_URI, v_headers, m_http_message_body_json( m_body_json_device_info_app_location_availability( m_application_location_availability( PX_ASSOCIATE_DEV_APPID, m_application_location_availability_info( PX_APPD_ID, PX_APP_NAME, PX_APP_PROVIDER, PX_APPD_VERSION ) ) ) ) ) ) ); 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( m_body_json_device_info_app_location_availability( mw_application_location_availability( PX_ASSOCIATE_DEV_APPID, mw_application_location_availability_info )))))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of Application ***"); 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_MEC016_MEO_UEAPPLOC_001_OK /** * @desc Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v2.2.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeApplicationsLocation.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPLOC_001_BR() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; // Test control if (not(PICS_MEC_PLAT) or not(PICS_DEVICE_APPLICATION_INTERFACE_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_DEVICE_APPLICATION_INTERFACE_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_DEVICE_APP_LIST_URI & "_invalid", v_headers, m_http_message_body_json( m_body_json_device_info_app_location_availability( m_application_location_availability( PX_ASSOCIATE_DEV_APPID, m_application_location_availability_info( PX_APPD_ID, PX_APP_NAME, PX_APP_PROVIDER, PX_APPD_VERSION ) ) ) ) ) ) ); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_400_bad_request )) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of Application ***"); 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_MEC016_MEO_UEAPPLOC_001_BR /** * @desc Check that the IUT responds with an error when a request with incorrect URL is sent by a MEC Application * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v2.2.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeApplicationsLocation.tplan2 */ testcase TC_MEC_MEC016_MEO_UEAPPLOC_001_NF() runs on HttpComponent system HttpTestAdapter { // Local variables var Headers v_headers; // Test control if (not(PICS_MEC_PLAT) or not(PICS_DEVICE_APPLICATION_INTERFACE_API_SUPPORTED)) { log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_DEVICE_APPLICATION_INTERFACE_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_DEVICE_APP_LIST_URI, v_headers, m_http_message_body_json( m_body_json_device_info_app_location_availability( m_application_location_availability( PX_ASSOCIATE_DEV_APPID, m_application_location_availability_info( PX_APPD_ID, PX_APP_NAME, PX_APP_PROVIDER, PX_APPD_VERSION ) ) ) ) ) ) ); f_selfOrClientSyncAndVerdict(c_prDone, e_success); // Test Body tc_ac.start; alt { [] httpPort.receive( mw_http_response( mw_http_response_404_not_found )) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of Application ***"); 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_MEC016_MEO_UEAPPLOC_001_NF } // End of group me_app_role } // End of module AtsMec_DeviceApplicationInterfaceAPI_TestCases