diff --git a/ttcn/AtsMec/AtsMec_Ams_TestCases.ttcn b/ttcn/AtsMec/AtsMec_Ams_TestCases.ttcn index 8955d72a5096f33d7b13d8864676bd77815d8885..2e0005e3681536bc5ed4923587d8b46e3e18c3da 100644 --- a/ttcn/AtsMec/AtsMec_Ams_TestCases.ttcn +++ b/ttcn/AtsMec/AtsMec_Ams_TestCases.ttcn @@ -299,6 +299,528 @@ } // End of testcase TP_MEC_SRV_AMS_002_BR } // End of group appMobilityServices + + + group individualAppMobilityService{ + + /** + * @desc Check that the AMS service returns information about this individual application mobility service + * @see ETSI GS MEC 021 2.0.10, clause 8.4.3.1 + */ + testcase TP_MEC_SRV_AMS_011_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines v_headers; + var HttpMessage v_response; + + // 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 & oct2char(unichar2oct(PX_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_ok( + mw_http_message_body_json( + mw_body_json_app_mobility_service_info( + mw_app_mobility_service_info( + -, + PX_APP_MOBILITY_SERVICE_ID + )))))) -> value v_response { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a AppMobilityServiceInfo***"); + 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 + } // End of testcase TP_MEC_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 + * @see ETSI GS MEC 021 2.0.10, clause 8.4.3.1 + */ + testcase TP_MEC_SRV_AMS_011_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines 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 & "/" & 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 a 404 Not Found ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + } // End of testcase TP_MEC_SRV_AMS_011_NF + + + + /** + * @desc Check that the AMS service modifies the individual application mobility service when requested + * @see ETSI GS MEC 021 2.0.10, clause 8.4.3.2 + */ + testcase TP_MEC_SRV_AMS_012_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines v_headers; + var HttpMessage v_response; + + // 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_put( + "/" & PICS_ROOT_API & PX_ME_APP_AMS_URI & oct2char(unichar2oct(PX_APP_MOBILITY_SERVICE_ID, "UTF-8")), + v_headers, + m_http_message_body_json( + m_body_json_ams_registration_request( + m_registration_request( + 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_ok( + mw_http_message_body_json( + mw_body_json_app_mobility_service_info( + mw_app_mobility_service_info({ + *, + mw_app_mobility_registration_info( + mw_service_consumer_id( + PX_APP_INS_ID, + - + ), + -, + - + ), + *}, + - + ) + ) + ) + ))) -> value v_response { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a AppMobilityServiceInfo***"); + 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 + } // End of testcase TP_MEC_SRV_AMS_012_OK + + /** + * @desc Check that the AMS service sends an error when receives a request to modify a not existing individual application mobility service + * @see ETSI GS MEC 021 2.0.10, clause 8.4.3.2 + */ + testcase TP_MEC_SRV_AMS_012_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines 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_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_request( + m_registration_request( + 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_404_not_found( + ))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a 404 Not Found ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + } // End of testcase TP_MEC_SRV_AMS_012_NF + + /** + * @desc Check that the AMS service sends an error when receives a request to modify a individual application mobility service using bad parameters + * @see ETSI GS MEC 021 2.0.10, clause 8.4.3.2 + */ + testcase TP_MEC_SRV_AMS_012_BR() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines 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_put( + "/" & PICS_ROOT_API & PX_ME_APP_AMS_URI & "/" & oct2char(unichar2oct(PX_APP_MOBILITY_SERVICE_ID, "UTF-8")), + v_headers, + m_http_message_body_json( + m_body_json_ams_registration_request_with_error( + m_registration_request_with_error( + m_service_consumer_id_with_error( + 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 a 400 Bad Request ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + } // End of testcase TP_MEC_SRV_AMS_012_BR + + + /** + * @desc Check that the AMS service de-register the individual application mobility service and delete the resource + * that represents the individual application mobility service + * @see ETSI GS MEC 021 2.0.10, clause 8.4.3.5 + */ + testcase TP_MEC_SRV_AMS_013_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines v_headers; + var HttpMessage v_response; + + // 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_delete( + "/" & PICS_ROOT_API & PX_ME_APP_AMS_URI & oct2char(unichar2oct(PX_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_204_no_content( + ))) -> value v_response { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a 204 No Content ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + } // End of testcase TP_MEC_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 + * @see ETSI GS MEC 021 2.0.10, clause 8.4.3.5 + */ + testcase TP_MEC_SRV_AMS_013_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines 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_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 responds with a 404 Not Found ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + } // End of testcase TP_MEC_SRV_AMS_013_NF + + } + + group appMobilityServiceDeregisterTask { + + /** + * @desc Check that the AMS service deregister an individual application mobility service on expiry of the timer associated with the service + * @see ETSI GS MEC 021 2.0.10, clause 8.5.3.4 + */ + testcase TP_MEC_SRV_AMS_014_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines v_headers; + var HttpMessage v_response; + + // 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 & oct2char(unichar2oct(PX_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_ok( + mw_http_message_body_json( + mw_body_json_app_mobility_service_info( + mw_app_mobility_service_info({ + *, + mw_app_mobility_registration_info( + mw_service_consumer_id( + PX_APP_INS_ID, + - + ), + -, + - + ), + *}, + - + ) + ) + ) + ))) -> value v_response { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a AppMobilityServiceInfo***"); + 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 + } // End of testcase TP_MEC_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 + * @see ETSI GS MEC 021 2.0.10, clause 8.5.3.4 + */ + testcase TP_MEC_SRV_AMS_014_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines v_headers; + var HttpMessage v_response; + + // 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 & 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( + ))) -> value v_response { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a 404 Not Found***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + } // End of testcase TP_MEC_SRV_AMS_012_OK + + + } group appMobilityServicesSubscriptions { diff --git a/ttcn/LibMec/Ams/ttcn/Ams_Pixits.ttcn b/ttcn/LibMec/Ams/ttcn/Ams_Pixits.ttcn index 3c96472470178cdd67b588ebe55adb6ad703c9fb..9874e63f5e20f51a34b8c297999976086568f8b8 100644 --- a/ttcn/LibMec/Ams/ttcn/Ams_Pixits.ttcn +++ b/ttcn/LibMec/Ams/ttcn/Ams_Pixits.ttcn @@ -16,6 +16,8 @@ module Ams_Pixits { modulepar JSON.String PX_NON_EXISTENT_SUBSCRIPTION_ID := "NON_EXISTENT_SUBSCRIPTION_ID" + modulepar JSON.String PX_NON_EXISTENT_APP_MOBILITY_SERVICE_ID := "PX_NON_EXISTENT_APP_MOBILITY_SERVICE_ID" + modulepar JSON.String PX_CALLBACK_REFERENCE := "http://127.0.0.1/callback" modulepar charstring PX_CALLBACK_URI := "http://127.0.0.1/callback" diff --git a/ttcn/LibMec/Ams/ttcn/Ams_Templates.ttcn b/ttcn/LibMec/Ams/ttcn/Ams_Templates.ttcn index 329232ebf5da702ea49a1cfc0adf518b1ec5927f..a4ed7daac7655c986d38a0b44522974af808e448 100644 --- a/ttcn/LibMec/Ams/ttcn/Ams_Templates.ttcn +++ b/ttcn/LibMec/Ams/ttcn/Ams_Templates.ttcn @@ -55,6 +55,14 @@ module Ams_Templates { mepId := p_mepId } + template (omit) ServiceConsumerIdWithError m_service_consumer_id_with_error( + in template (omit) String p_appId := omit, + in template (omit) String p_mepId := omit + ) := { + appId := p_appId, + mepId := p_mepId + } + template (omit) ServiceConsumer m_service_consumer_error( in template (omit) String p_appInstance := omit, in template (omit) String p_mepId := omit @@ -82,6 +90,17 @@ module Ams_Templates { } + template (omit) RegistrationRequestWithError m_registration_request_with_error ( + in template (omit) ServiceConsumerIdWithError p_service_consumer_id_with_error := omit, + in template (omit) DeviceInformations p_device_info := omit, + in template (omit) UInt32 p_expire_time := omit + ) := { + serviceConsumerIdWithError := p_service_consumer_id_with_error, + deviceInformation := p_device_info, + expiryTime := p_expire_time + } + + template (omit) RegistrationRequest m_registration_request_error ( in template (omit) ServiceConsumer p_service_consumer := omit, in template (omit) DeviceInformations p_device_info := omit, diff --git a/ttcn/LibMec/Ams/ttcn/Ams_TypesAndValues.ttcn b/ttcn/LibMec/Ams/ttcn/Ams_TypesAndValues.ttcn index ef4fa83b7ee406719c0552325763a42d09c333d9..70d5600fbfc70f52d77ba4add7bbeb2415527ca3 100644 --- a/ttcn/LibMec/Ams/ttcn/Ams_TypesAndValues.ttcn +++ b/ttcn/LibMec/Ams/ttcn/Ams_TypesAndValues.ttcn @@ -28,12 +28,24 @@ type record RegistrationRequest { } +type record RegistrationRequestWithError { + ServiceConsumerIdWithError serviceConsumerIdWithError, + DeviceInformations deviceInformation optional, + UInt32 expiryTime optional +} + + type record of ServiceConsumerId ServiceConsumerIds; type record ServiceConsumerId { String appInstanceId optional, String mepId optional } +type record ServiceConsumerIdWithError { + String appId optional, + String mepId optional +} + // Erroneous parameter: appInstance should be appInstanceId type record of ServiceConsumer ServiceConsumers; type record ServiceConsumer { diff --git a/ttcn/patch_lib_http/LibItsHttp_JsonMessageBodyTypes.ttcn b/ttcn/patch_lib_http/LibItsHttp_JsonMessageBodyTypes.ttcn index 29fa3a998576e08134aa6f88f63a99c462794880..35d628749ad5894774de4ef05f5aff5fd1bf0d89 100644 --- a/ttcn/patch_lib_http/LibItsHttp_JsonMessageBodyTypes.ttcn +++ b/ttcn/patch_lib_http/LibItsHttp_JsonMessageBodyTypes.ttcn @@ -109,7 +109,7 @@ module LibItsHttp_JsonMessageBodyTypes { AppLCM_TypesAndValues.Notification lcmNotification, AppContext appContext, AppInfo appInfo, - + Ams_TypesAndValues.RegistrationRequestWithError registrationRequestWithError_ams, UEAppInterfaceAPI_TypesAndValues.ProblemDetails problemDetails_ue_app_ctxt, universal charstring raw } with { diff --git a/ttcn/patch_lib_http/LibItsHttp_JsonTemplates.ttcn b/ttcn/patch_lib_http/LibItsHttp_JsonTemplates.ttcn index ee6edac3531fce983f58e02fd5d0bde902182382..fb0723ba3effd1e9012009785512ef469431d16d 100644 --- a/ttcn/patch_lib_http/LibItsHttp_JsonTemplates.ttcn +++ b/ttcn/patch_lib_http/LibItsHttp_JsonTemplates.ttcn @@ -357,6 +357,11 @@ group ams_api { registrationRequest_ams := p_registrationRequest } // End of template m_body_json_ue_identity_problem_details + template (value) JsonBody m_body_json_ams_registration_request_with_error( + in template (value) Ams_TypesAndValues.RegistrationRequestWithError p_registrationRequestWithError + ) := { + registrationRequestWithError_ams := p_registrationRequestWithError + } // End of template m_body_json_ue_identity_problem_details template (present) JsonBody mw_body_json_ams_subscriptions( template (present) Ams_TypesAndValues.MobilityProcedureSubscription p_amsSubscriptionLinkList := ?