diff --git a/ccsrc/externals/LibMec_ExternalFunctions.cc b/ccsrc/externals/LibMec_ExternalFunctions.cc new file mode 100644 index 0000000000000000000000000000000000000000..b3ea2f626eea6a9d6d16db9dd08047ccde4ea189 --- /dev/null +++ b/ccsrc/externals/LibMec_ExternalFunctions.cc @@ -0,0 +1,38 @@ +#include "LibMec_Functions.hh" +#include + +#include "base_time.hh" +#include "loggers.hh" + +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif +#define earthRadius 6378137.0L +#define rbis = ((double)(earthRadius * M_PI / 180)) + +namespace LibMec__Functions { + + /** + * @desc This external function gets the current time + * @return Timestamp - current time since 01/01/2004 in milliseconds + * @see fx_getCurrentTime() return TimestampIts + */ + INTEGER fx__getCurrentTime( +) { + INTEGER i; + i.set_long_long_val(base_time::get_instance().get_its_current_time_ms()); + loggers::get_instance().log_msg("<<< fx__getCurrentTime: ", i); + return i; + } + /** + * @desc This external function gets the current time since 01/01/1970 in UTC format + * @return The current time since 01/01/1970 in UTC format + * @see fx_getCurrentTimeUtc() return UInt64 + */ + INTEGER fx__get__current__time__utc() { + INTEGER i; + i.set_long_long_val(base_time::get_instance().get_current_time_ms()); + return i; + } + +} // end of Namespace diff --git a/etc/AtsMec/AtsMec.cfg b/etc/AtsMec/AtsMec.cfg index 2195f0817f8eeb495cac624e27a98ae5367168c1..b6d57148745d83d0d40d9ec293f48ec11f4d757c 100644 --- a/etc/AtsMec/AtsMec.cfg +++ b/etc/AtsMec/AtsMec.cfg @@ -13,6 +13,8 @@ LibCommon_Sync.PX_TSHUT_DOWN_TIME_LIMIT := 30.0; LibItsHttp_Pics.PICS_HEADER_HOST := "192.168.1.34" LibItsHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json" +LibItsHttp_Pics.PICS_USE_TOKEN_HEADER := true +#LibItsHttp_Pics.PICS_TOKEN_HEADER := "Basic WrongToken" LibMec_Pics.PICS_MEC_PLAT := true LibMec_Pics.PICS_SERVICES := true diff --git a/ttcn/AtsMec/AtsMec_Ams_TestCases.ttcn b/ttcn/AtsMec/AtsMec_Ams_TestCases.ttcn index a9c39b9f7dd0ec7f36e2d1f57a619bd078a38a1d..8955d72a5096f33d7b13d8864676bd77815d8885 100644 --- a/ttcn/AtsMec/AtsMec_Ams_TestCases.ttcn +++ b/ttcn/AtsMec/AtsMec_Ams_TestCases.ttcn @@ -9,138 +9,620 @@ * All rights reserved. * @see ETSI GS MEC 003, Draft ETSI GS MEC 013 V2.0.3 (2018-10) */ -module AtsMec_Ams_TestCases { - -// Libcommon -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_LocationAPI -import from Ams_Templates all; -import from Ams_Pics all; -import from Ams_Pixits all; - -// LibMec -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 - * @see ETSI GS MEC 021 2.0.8, clause 8.3.3.1 - */ - testcase TP_MEC_SRV_AMS_001_OK() runs on HttpComponent system HttpTestAdapter { - // Local variables + module AtsMec_Ams_TestCases { + + // Libcommon + import from LibCommon_BasicTypesAndValues 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_LocationAPI + import from Ams_Templates all; + import from Ams_Pics all; + import from Ams_Pixits all; + + // LibMec + 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 + * @see ETSI GS MEC 021 2.0.8, clause 8.3.3.1 + */ + testcase TP_MEC_SRV_AMS_001_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, + 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, + PX_MEP_ID + ) + ) + } + )))))) -> value v_response { + tc_ac.stop; + + if (f_check_headers(valueof(v_response.response.header)) == true) { + log("*** " & testcasename() & ": PASS: IUT successfully responds with a AppTerminationNotificationSubscription ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } else { + log("*** " & testcasename() & ": FAIL: Header 'Location' was not present in the response headers ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + } + [] 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_001_OK + + /** + * @desc Check that the AMS service returns an error when receives a query about a registered application mobility service with wrong parameters + * @see ETSI GS MEC 021 2.0.8, clause 8.3.3.1 + */ + testcase TP_MEC_SRV_AMS_001_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_get( + "/" & PICS_ROOT_API & PX_ME_APP_AMS_URI & "?appMobilityService=" & 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_400_bad_request( + mw_http_message_body_json( + mw_body_json_ams_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 + + } // End of testcase TP_MEC_SRV_AMS_001_BR + + + /** + * @desc Check that the AMS service creates a new application mobility services when requested + * @see ETSI GS MEC 021 2.0.8, clause 8.3.3.4 + */ + testcase TP_MEC_SRV_AMS_002_OK() runs on HttpComponent system HttpTestAdapter { + var HeaderLines v_headers; + 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_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_201_created( + mw_http_message_body_json( + mw_body_json_app_mobility_service_info( + mw_app_mobility_service_info( + mw_registration_info( + mw_service_consumer_id( + PX_APP_INS_ID, + - + ), + -, + - + ), + PX_APP_MOBILITY_SERVICE_ID + ) + ) + ) + ) + ) + ) + + { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a AppMobilityServiceInfo and status code set to 201 Created ***"); + 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_002_OK + + /** + * @desc Check that the AMS service sends an error when it receives a malformed request to create a new application mobility service + * @see ETSI GS MEC 021 2.0.8, clause 8.3.3.4 + */ + testcase TP_MEC_SRV_AMS_002_BR() runs on HttpComponent system HttpTestAdapter { + var HeaderLines v_headers; + 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_request( + m_registration_request_error( + m_service_consumer_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( + mw_http_message_body_json( + mw_body_json_ams_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 + + } // End of testcase TP_MEC_SRV_AMS_002_BR + } // End of group appMobilityServices + + group appMobilityServicesSubscriptions { + + /** + * @desc Check that the AMS service returns information about the available subscriptions when requested. + * Permitted SUBSCRIPTION_TYPE are: + * - MobilityProcedureSubscription + * - AdjacentAppInfoSubscription + * @see ETSI GS MEC 021 2.0.8, clause 8.6.3.1 + */ + testcase TP_MEC_SRV_AMS_003_OK() runs on HttpComponent system HttpTestAdapter { + var HeaderLines v_headers; + 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( + //@TODO: How can we convert enums in strings? + "/" & PICS_ROOT_API & PX_ME_APP_AMS_SUBS & "?subscriptionType=" & int2str(enum2int(PX_SUBSCRIPTION_TYPE)), + 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_ams_subscription( + PX_SUBSCRIPTION_TYPE, + -, + -, + -, + - + ) + ) + ) + ) + ) + ) + { + 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 + + } // END TP_MEC_SRV_AMS_003_OK + + /** + * @desc Check that the AMS service sends an error when it receives a malformed query about the available subscriptions + * @see ETSI GS MEC 021 2.0.8, clause 8.6.3.1 + */ + testcase TP_MEC_SRV_AMS_003_BR() runs on HttpComponent system HttpTestAdapter { + var HeaderLines v_headers; + 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 & "?subscriptionTyp=" & int2str(enum2int(PX_SUBSCRIPTION_TYPE)), + 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_ams_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 + + } // END of TP_MEC_SRV_AMS_003_BR + + /** + * @desc Check that the AMS service creates a notification subscriptions when requested. + * Permitted SUBSCRIPTION_TYPE are: + * - MobilityProcedureSubscription + * - AdjacentAppInfoSubscription + * @see ETSI GS MEC 021 2.0.8, clause 8.6.3.4 + */ + testcase TP_MEC_SRV_AMS_004_OK() runs on HttpComponent system HttpTestAdapter { + var HeaderLines v_headers; + 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_subscriptions( + m_ams_subscription( + PX_SUBSCRIPTION_TYPE, + PX_CALLBACK_REFERENCE, + -, + -, + - + ) + ) + ) + ) + ) + ); + 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_subscriptions( + mw_ams_subscription( + PX_SUBSCRIPTION_TYPE, + PX_CALLBACK_REFERENCE, + -, + -, + - + ) + ) + ) + ) + ) + ) + { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a AMS Subscription and 201 Created status 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 + + } // End of TP_MEC_SRV_AMS_004_OK + + /** + * @desc Check that the AMS service sends an error when it receives a malformed request to create a notification subscription + * Permitted SUBSCRIPTION_TYPE are: + * - MobilityProcedureSubscription + * - AdjacentAppInfoSubscription + * @see ETSI GS MEC 021 2.0.8, clause 8.6.3.4 + */ + testcase TP_MEC_SRV_AMS_004_BR() runs on HttpComponent system HttpTestAdapter { 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, - v_headers - ))); + 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_subscriptions( + m_ams_subscription_error( + PX_SUBSCRIPTION_TYPE, + PX_CALLBACK_REFERENCE, + -, + -, + - + ) + ) + ) + ) + ) + ); 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, - PX_MEP_ID - ) - ) - } - )))))) -> value v_response { + mw_http_response( + mw_http_response_400_bad_request( + mw_http_message_body_json( + mw_body_json_ams_problem_details( + mw_problem_details( + -, -, 400 + ) + ) + ) + ) + ) + ) + { tc_ac.stop; - - if (f_check_headers(v_response.response.header) == true) { - log("*** " & testcasename() & ": PASS: IUT successfully responds with a AppTerminationNotificationSubscription ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } else { - log("*** " & testcasename() & ": FAIL: Header 'Location' was not present in the response headers ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_error); - } + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a Problem Details and 400 Bad request status 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 - } // End of testcase TP_MEC_SRV_AMS_001_OK - - /** - * @desc Check that the AMS service returns an error when receives a query about a registered application mobility service with wrong parameters - * @see ETSI GS MEC 021 2.0.8, clause 8.3.3.1 - */ - testcase TP_MEC_SRV_AMS_001_BR() runs on HttpComponent system HttpTestAdapter { - // Local variables + + } // End of TP_MEC_SRV_AMS_004_BR + + /** + * @desc Check that the AMS service returns information about a given subscription when requested. + * Permitted SUBSCRIPTION_TYPE are: + * - MobilityProcedureSubscription + * - AdjacentAppInfoSubscription + * @see ETSI GS MEC 021 2.0.8, clause 8.7.3.1 + */ + testcase TP_MEC_SRV_AMS_005_OK() runs on HttpComponent system HttpTestAdapter { 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 & "?appMobilityService=" & oct2char(unichar2oct(PX_APP_MOBILITY_SERVICE_ID, "UTF-8")), - v_headers - ))); + m_http_request( + m_http_request_get( + "/" & PICS_ROOT_API & PX_ME_APP_AMS_SUBS & "/" & oct2char(unichar2oct(PX_SUBSCRIPTION_ID, "UTF-8")), + v_headers + ) + ) + ); f_selfOrClientSyncAndVerdict(c_prDone, e_success); - + // Test Body tc_ac.start; alt { [] httpPort.receive( - mw_http_response( - mw_http_response_400_bad_request( - mw_http_message_body_json( - mw_body_json_ams_problem_details( - mw_problem_details( - -, - -, - 400 - )))))) { + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_ams_subscriptions( + mw_ams_subscription(PX_SUBSCRIPTION_TYPE, -, -, -, -) + ) + ) + ) + ) + ) + { tc_ac.stop; - - log("*** " & testcasename() & ": PASS: IUT successfully responds with a ProblemDetails set to 400 Bad Request ***"); + + log("*** " & testcasename() & ": PASS: IUT successfully responds with the list of subscriptions type MobilityProcedureSubscription ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { @@ -148,167 +630,123 @@ group appMobilityServices { f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); } } // End of 'alt' statement - - } // End of testcase TP_MEC_SRV_AMS_001_BR - + + } // End of TP_MEC_SRV_AMS_005_OK - /** - * @desc Check that the AMS service creates a new application mobility services when requested - * @see ETSI GS MEC 021 2.0.8, clause 8.3.3.4 - */ - testcase TP_MEC_SRV_AMS_002_OK() runs on HttpComponent system HttpTestAdapter { - var HeaderLines v_headers; - 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_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_201_created( - mw_http_message_body_json( - mw_body_json_app_mobility_service_info( - mw_app_mobility_service_info( - mw_registration_info( - mw_service_consumer_id( - PX_APP_INS_ID, - - - ), - -, - - - ), - PX_APP_MOBILITY_SERVICE_ID - ) - ) - ) - ) - ) - ) - - { - tc_ac.stop; - - log("*** " & testcasename() & ": PASS: IUT successfully responds with a AppMobilityServiceInfo and status code set to 201 Created ***"); - 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_002_OK - - /** - * @desc Check that the AMS service sends an error when it receives a malformed request to create a new application mobility service - * @see ETSI GS MEC 021 2.0.8, clause 8.3.3.4 - */ - testcase TP_MEC_SRV_AMS_002_BR() runs on HttpComponent system HttpTestAdapter { - var HeaderLines v_headers; - 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_request( - m_registration_request_error( - m_service_consumer_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( - mw_http_message_body_json( - mw_body_json_ams_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); + /** + * @desc Check that the AMS service returns an error when receives a query about a not existing subscription + * @see ETSI GS MEC 021 2.0.8, clause 8.7.3.1 + */ + testcase TP_MEC_SRV_AMS_005_NF() runs on HttpComponent system HttpTestAdapter { + var HeaderLines v_headers; + if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)){ + log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***"); + setverdict(inconc); + stop; } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: Expected message not received ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + + // 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 & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_SUBSCRIPTION_ID, "UTF-8")), + v_headers + ) + ) + ); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found( + mw_http_message_body_json( + mw_body_json_ams_problem_details( + mw_problem_details( + -, -, 404 + ) + ) + ) + ) + ) + ) + { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a ProblemDetails set to 404 Not Found ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + } // End of TP_MEC_SRV_AMS_005_NF + + /** + * @desc Check that the AMS service deletes a given subscription when requested + * @see ETSI GS MEC 021 2.0.8, clause 8.7.3.5 + */ + testcase TP_MEC_SRV_AMS_006_OK() runs on HttpComponent system HttpTestAdapter { + var HeaderLines v_headers; + if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)){ + log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***"); + setverdict(inconc); + stop; } - } // End of 'alt' statement - - } // End of testcase TP_MEC_SRV_AMS_002_BR -} // End of group appMobilityServices -group appMobilityServicesSubscriptions { + // 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_SUBS & "/" & oct2char(unichar2oct(PX_SUBSCRIPTION_ID, "UTF-8")), + v_headers + ) + ) + ); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_204_no_content( + ) + ) + ) + { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with 204 No Content on deletion 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 TP_MEC_SRV_AMS_006_OK + /** - * @desc Check that the AMS service returns information about the available subscriptions when requested. - * Permitted SUBSCRIPTION_TYPE are: - * - MobilityProcedureSubscription - * - AdjacentAppInfoSubscription - * @see ETSI GS MEC 021 2.0.8, clause 8.6.3.1 - */ - testcase TP_MEC_SRV_AMS_003_OK() runs on HttpComponent system HttpTestAdapter { + * @desc Check that the AMS service sends an error when it receives a delete request for a not existing subscription + * @see ETSI GS MEC 021 2.0.8, clause 8.7.3.5 + */ + testcase TP_MEC_SRV_AMS_006_NF() runs on HttpComponent system HttpTestAdapter { var HeaderLines v_headers; if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)){ log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***"); @@ -324,9 +762,8 @@ group appMobilityServicesSubscriptions { f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( - m_http_request_get( - //@TODO: How can we convert enums in strings? - "/" & PICS_ROOT_API & PX_ME_APP_AMS_SUBS & "?subscriptionType=" & int2str(enum2int(PX_SUBSCRIPTION_TYPE)), + m_http_request_delete( + "/" & PICS_ROOT_API & PX_ME_APP_AMS_SUBS & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_SUBSCRIPTION_ID, "UTF-8")), v_headers ) ) @@ -336,27 +773,86 @@ group appMobilityServicesSubscriptions { // 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_ams_subscription( - PX_SUBSCRIPTION_TYPE, - -, - -, - -, - - - ) - ) - ) - ) - ) - ) + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found( + mw_http_message_body_json( + mw_body_json_ams_problem_details( + ) + ) + ) + ) + ) + { + 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 TP_MEC_SRV_AMS_006_NF + + /** + * @desc Check that the AMS service modifies a given subscription when requested. + * Permitted SUBSCRIPTION_TYPE are: + * - MobilityProcedureSubscription + * - AdjacentAppInfoSubscription + * @see ETSI GS MEC 021 2.0.8, clause 8.7.3.2 + */ + testcase TP_MEC_SRV_AMS_007_OK() runs on HttpComponent system HttpTestAdapter { + var HeaderLines v_headers; + 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_SUBS & "/" & oct2char(unichar2oct(PX_SUBSCRIPTION_ID, "UTF-8")), + v_headers, + m_http_message_body_json( + m_body_json_ams_subscriptions( + m_ams_subscription( + PX_SUBSCRIPTION_TYPE, PX_CALLBACK_REFERENCE, -, -, - + ) + ) + ) + ) + ) + ); + 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_ams_subscription(PX_SUBSCRIPTION_TYPE, -, -, -, -) + ) + ) + ) + ) + ) { tc_ac.stop; - log("*** " & testcasename() & ": PASS: IUT successfully responds with the list of subscriptions type MobilityProcedureSubscription ***"); + log("*** " & testcasename() & ": PASS: IUT successfully responds with a AppMobilityServiceInfo ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { @@ -365,13 +861,16 @@ group appMobilityServicesSubscriptions { } } // End of 'alt' statement - } // END TP_MEC_SRV_AMS_003_OK + } // End of TP_MEC_SRV_AMS_007_OK - /** - * @desc Check that the AMS service sends an error when it receives a malformed query about the available subscriptions - * @see ETSI GS MEC 021 2.0.8, clause 8.6.3.1 - */ - testcase TP_MEC_SRV_AMS_003_BR() runs on HttpComponent system HttpTestAdapter { + /** + * @desc Check that the AMS service sends an error when it receives a malformed modify request for a given subscription. + * Permitted SUBSCRIPTION_TYPE are: + * - MobilityProcedureSubscription + * - AdjacentAppInfoSubscription + * @see ETSI GS MEC 021 2.0.8, clause 8.7.3.2 + */ + testcase TP_MEC_SRV_AMS_007_BR() runs on HttpComponent system HttpTestAdapter { var HeaderLines v_headers; if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)){ log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***"); @@ -387,9 +886,18 @@ group appMobilityServicesSubscriptions { f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( - m_http_request_get( - "/" & PICS_ROOT_API & PX_ME_APP_AMS_SUBS & "?subscriptionTyp=" & int2str(enum2int(PX_SUBSCRIPTION_TYPE)), - v_headers + m_http_request_put( + "/" & PICS_ROOT_API & PX_ME_APP_AMS_SUBS & "/" & oct2char(unichar2oct(PX_SUBSCRIPTION_ID, "UTF-8")), + v_headers, + m_http_message_body_json( + m_body_json_ams_registration_request( + m_registration_request( + m_service_consumer_error(PX_APP_INS_ID, -), + -, + - + ) + ) + ) ) ) ); @@ -403,9 +911,6 @@ group appMobilityServicesSubscriptions { mw_http_response_400_bad_request( mw_http_message_body_json( mw_body_json_ams_problem_details( - mw_problem_details( - -, -, 400 - ) ) ) ) @@ -414,7 +919,7 @@ group appMobilityServicesSubscriptions { { tc_ac.stop; - log("*** " & testcasename() & ": PASS: IUT successfully responds with a ProblemDetails set to 400 Bad Request ***"); + log("*** " & testcasename() & ": PASS: IUT successfully responds with a 400 Bad Request ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { @@ -423,16 +928,13 @@ group appMobilityServicesSubscriptions { } } // End of 'alt' statement - } // END of TP_MEC_SRV_AMS_003_BR - - /** - * @desc Check that the AMS service creates a notification subscriptions when requested. - * Permitted SUBSCRIPTION_TYPE are: - * - MobilityProcedureSubscription - * - AdjacentAppInfoSubscription - * @see ETSI GS MEC 021 2.0.8, clause 8.6.3.4 - */ - testcase TP_MEC_SRV_AMS_004_OK() runs on HttpComponent system HttpTestAdapter { + } // End of TP_MEC_SRV_AMS_007_BR + + /** + * @desc Check that the AMS service sends an error when it receives a modify request for a not existing subscription + * @see ETSI GS MEC 021 2.0.8, clause 8.7.3.2 + */ + testcase TP_MEC_SRV_AMS_007_NF() runs on HttpComponent system HttpTestAdapter { var HeaderLines v_headers; if (not(PICS_AMS) or not(PICS_AMS_API_SUPPORTED)){ log("*** " & testcasename() & ": PICS_AMS required for executing the TC ***"); @@ -448,17 +950,13 @@ group appMobilityServicesSubscriptions { f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( - m_http_request_post( - "/" & PICS_ROOT_API & PX_ME_APP_AMS_SUBS, + m_http_request_put( + "/" & PICS_ROOT_API & PX_ME_APP_AMS_SUBS & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_SUBSCRIPTION_ID, "UTF-8")), v_headers, m_http_message_body_json( m_body_json_ams_subscriptions( m_ams_subscription( - PX_SUBSCRIPTION_TYPE, - PX_CALLBACK_REFERENCE, - -, - -, - - + PX_SUBSCRIPTION_TYPE, PX_CALLBACK_REFERENCE, -, -, - ) ) ) @@ -472,16 +970,9 @@ group appMobilityServicesSubscriptions { alt { [] httpPort.receive( mw_http_response( - mw_http_response_201_created( + mw_http_response_404_not_found( mw_http_message_body_json( - mw_body_json_ams_subscriptions( - mw_ams_subscription( - PX_SUBSCRIPTION_TYPE, - PX_CALLBACK_REFERENCE, - -, - -, - - - ) + mw_body_json_ams_problem_details( ) ) ) @@ -490,7 +981,7 @@ group appMobilityServicesSubscriptions { { tc_ac.stop; - log("*** " & testcasename() & ": PASS: IUT successfully responds with a AMS Subscription and 201 Created status code ***"); + log("*** " & testcasename() & ": PASS: IUT successfully responds with a 404 Not Found ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } [] tc_ac.timeout { @@ -499,704 +990,216 @@ group appMobilityServicesSubscriptions { } } // End of 'alt' statement - } // End of TP_MEC_SRV_AMS_004_OK - - /** - * @desc Check that the AMS service sends an error when it receives a malformed request to create a notification subscription - * Permitted SUBSCRIPTION_TYPE are: - * - MobilityProcedureSubscription - * - AdjacentAppInfoSubscription - * @see ETSI GS MEC 021 2.0.8, clause 8.6.3.4 - */ - testcase TP_MEC_SRV_AMS_004_BR() runs on HttpComponent system HttpTestAdapter { - var HeaderLines v_headers; - 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_subscriptions( - m_ams_subscription_error( - PX_SUBSCRIPTION_TYPE, - PX_CALLBACK_REFERENCE, - -, - -, - - - ) - ) - ) - ) - ) - ); - 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_ams_problem_details( - mw_problem_details( - -, -, 400 - ) - ) - ) - ) - ) - ) - { - tc_ac.stop; - - log("*** " & testcasename() & ": PASS: IUT successfully responds with a Problem Details and 400 Bad request status 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 - - } // End of TP_MEC_SRV_AMS_004_BR + } // End of TP_MEC_SRV_AMS_007_NF - /** - * @desc Check that the AMS service returns information about a given subscription when requested. - * Permitted SUBSCRIPTION_TYPE are: - * - MobilityProcedureSubscription - * - AdjacentAppInfoSubscription - * @see ETSI GS MEC 021 2.0.8, clause 8.7.3.1 - */ - testcase TP_MEC_SRV_AMS_005_OK() runs on HttpComponent system HttpTestAdapter { - var HeaderLines v_headers; - 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 & "/" & oct2char(unichar2oct(PX_SUBSCRIPTION_ID, "UTF-8")), - v_headers - ) - ) - ); - f_selfOrClientSyncAndVerdict(c_prDone, e_success); - - // Test Body - tc_ac.start; - alt { - [] httpPort.receive( - mw_http_response( - mw_http_response_ok( - mw_http_message_body_json( - mw_body_json_ams_subscriptions( - mw_ams_subscription(PX_SUBSCRIPTION_TYPE, -, -, -, -) - ) - ) - ) - ) - ) - { - 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 - - } // End of TP_MEC_SRV_AMS_005_OK - - /** - * @desc Check that the AMS service returns an error when receives a query about a not existing subscription - * @see ETSI GS MEC 021 2.0.8, clause 8.7.3.1 - */ - testcase TP_MEC_SRV_AMS_005_NF() runs on HttpComponent system HttpTestAdapter { - var HeaderLines v_headers; - 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 & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_SUBSCRIPTION_ID, "UTF-8")), - v_headers - ) - ) - ); - f_selfOrClientSyncAndVerdict(c_prDone, e_success); - - // Test Body - tc_ac.start; - alt { - [] httpPort.receive( - mw_http_response( - mw_http_response_404_not_found( - mw_http_message_body_json( - mw_body_json_ams_problem_details( - mw_problem_details( - -, -, 404 - ) - ) - ) - ) - ) - ) - { - tc_ac.stop; - - log("*** " & testcasename() & ": PASS: IUT successfully responds with a ProblemDetails set to 404 Not Found ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); - } - [] tc_ac.timeout { - log("*** " & testcasename() & ": INCONC: Expected message not received ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); - } - } // End of 'alt' statement - - } // End of TP_MEC_SRV_AMS_005_NF - /** - * @desc Check that the AMS service deletes a given subscription when requested - * @see ETSI GS MEC 021 2.0.8, clause 8.7.3.5 - */ - testcase TP_MEC_SRV_AMS_006_OK() runs on HttpComponent system HttpTestAdapter { - var HeaderLines v_headers; - 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_SUBS & "/" & oct2char(unichar2oct(PX_SUBSCRIPTION_ID, "UTF-8")), - v_headers - ) - ) - ); - f_selfOrClientSyncAndVerdict(c_prDone, e_success); - - // Test Body - tc_ac.start; - alt { - [] httpPort.receive( - mw_http_response( - mw_http_response_204_no_content( - ) - ) - ) - { - tc_ac.stop; - - log("*** " & testcasename() & ": PASS: IUT successfully responds with 204 No Content on deletion 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 TP_MEC_SRV_AMS_006_OK - - /** - * @desc Check that the AMS service sends an error when it receives a delete request for a not existing subscription - * @see ETSI GS MEC 021 2.0.8, clause 8.7.3.5 - */ - testcase TP_MEC_SRV_AMS_006_NF() runs on HttpComponent system HttpTestAdapter { - var HeaderLines v_headers; - 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_SUBS & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_SUBSCRIPTION_ID, "UTF-8")), - v_headers - ) - ) - ); - f_selfOrClientSyncAndVerdict(c_prDone, e_success); - - // Test Body - tc_ac.start; - alt { - [] httpPort.receive( - mw_http_response( - mw_http_response_404_not_found( - mw_http_message_body_json( - mw_body_json_ams_problem_details( - ) - ) - ) - ) - ) - { - 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 TP_MEC_SRV_AMS_006_NF - - /** - * @desc Check that the AMS service modifies a given subscription when requested. - * Permitted SUBSCRIPTION_TYPE are: - * - MobilityProcedureSubscription - * - AdjacentAppInfoSubscription - * @see ETSI GS MEC 021 2.0.8, clause 8.7.3.2 - */ - testcase TP_MEC_SRV_AMS_007_OK() runs on HttpComponent system HttpTestAdapter { - var HeaderLines v_headers; - 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_SUBS & "/" & oct2char(unichar2oct(PX_SUBSCRIPTION_ID, "UTF-8")), - v_headers, - m_http_message_body_json( - m_body_json_ams_subscriptions( - m_ams_subscription( - PX_SUBSCRIPTION_TYPE, PX_CALLBACK_REFERENCE, -, -, - - ) - ) - ) - ) - ) - ); - 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_ams_subscription(PX_SUBSCRIPTION_TYPE, -, -, -, -) - ) - ) - ) - ) - ) - { - 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 TP_MEC_SRV_AMS_007_OK - - /** - * @desc Check that the AMS service sends an error when it receives a malformed modify request for a given subscription. - * Permitted SUBSCRIPTION_TYPE are: - * - MobilityProcedureSubscription - * - AdjacentAppInfoSubscription - * @see ETSI GS MEC 021 2.0.8, clause 8.7.3.2 - */ - testcase TP_MEC_SRV_AMS_007_BR() runs on HttpComponent system HttpTestAdapter { - var HeaderLines v_headers; - 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_SUBS & "/" & oct2char(unichar2oct(PX_SUBSCRIPTION_ID, "UTF-8")), - v_headers, - m_http_message_body_json( - m_body_json_ams_registration_request( - m_registration_request( - m_service_consumer_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( - mw_http_message_body_json( - mw_body_json_ams_problem_details( - ) - ) - ) - ) - ) - { - 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 TP_MEC_SRV_AMS_007_BR - - /** - * @desc Check that the AMS service sends an error when it receives a modify request for a not existing subscription - * @see ETSI GS MEC 021 2.0.8, clause 8.7.3.2 - */ - testcase TP_MEC_SRV_AMS_007_NF() runs on HttpComponent system HttpTestAdapter { - var HeaderLines v_headers; - 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_SUBS & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_SUBSCRIPTION_ID, "UTF-8")), - v_headers, - m_http_message_body_json( - m_body_json_ams_subscriptions( - m_ams_subscription( - PX_SUBSCRIPTION_TYPE, PX_CALLBACK_REFERENCE, -, -, - - ) - ) - ) - ) - ) - ); - f_selfOrClientSyncAndVerdict(c_prDone, e_success); - - // Test Body - tc_ac.start; - alt { - [] httpPort.receive( - mw_http_response( - mw_http_response_404_not_found( - mw_http_message_body_json( - mw_body_json_ams_problem_details( - ) - ) - ) - ) - ) - { - 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 TP_MEC_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 - * @see ETSI GS MEC 021 2.0.8, clause 7.4.2 - */ - testcase TP_MEC_SRV_AMS_008_OK() runs on HttpComponent system HttpTestAdapter { - // Local variables - var HeaderLines v_headers; - - // Test control - if (not(PICS_AMS) or not(PICS_AMS_NOTIFICATIONS)) { - log("*** " & testcasename() & ": PICS_AMS and PICS_AMS_NOTIFICATIONS required for executing the TC ***"); - setverdict(inconc); - stop; - } - - // Test component configuration - f_cf_01_http_notif_up(); - - // Test adapter configuration - - // Preamble - f_init_default_headers_list(-, -, v_headers); - 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( - PX_CALLBACK_URI, - -, - mw_http_message_body_json( - mw_body_json_mobility_procedure_notification( - mw_mobility_procedure_notification( - -, - PX_CALLBACK_REFERENCE, - -, - -, - - - ) - ) - ) - ) - ) - ) { - tc_wait.stop; - log("*** " & testcasename() & ": INFO: IUT successfully sends mobility procedure notification ***"); - - // Send 204 No Content - 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_cf_01_http_notif_down(); - } // End of TP_MEC_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 - * @see ETSI GS MEC 021 2.0.8, clause 7.4.3 - */ - testcase TP_MEC_SRV_AMS_009_OK() runs on HttpComponent system HttpTestAdapter { - // Local variables - var HeaderLines v_headers; - - // Test control - if (not(PICS_AMS) or not(PICS_AMS_NOTIFICATIONS)) { - log("*** " & testcasename() & ": PICS_AMS and PICS_AMS_NOTIFICATIONS required for executing the TC ***"); - setverdict(inconc); - stop; - } - - // Test component configuration - f_cf_01_http_notif_up(); - - // Test adapter configuration - - // Preamble - f_init_default_headers_list(-, -, v_headers); - action("Trigger a adjacent application info event"); - f_selfOrClientSyncAndVerdict(c_prDone, e_success); - - // Test Body - tc_wait.start; - alt { - [] httpPort_notif.receive( - mw_http_request( - mw_http_request_post( - PX_CALLBACK_URI, - -, - mw_http_message_body_json( - mw_body_json_adjacent_application_info_notification( - mw_adjacent_application_info_notification( - -, - PX_CALLBACK_REFERENCE, - -, - -, - - - ) - ) - ) - ) - ) - ) { - tc_wait.stop; - log("*** " & testcasename() & ": INFO: IUT successfully sends adjacent application info notification ***"); - - // Send 204 No Content - httpPort_notif.send(m_http_response(m_http_response_204_no_content(v_headers))); - - log("*** " & testcasename() & ": PASS: IUT successfully sends adjacent application info 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 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 + * @see ETSI GS MEC 021 2.0.8, clause 7.4.2 + */ + testcase TP_MEC_SRV_AMS_008_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines v_headers; + + // Test control + if (not(PICS_AMS) or not(PICS_AMS_NOTIFICATIONS)) { + log("*** " & testcasename() & ": PICS_AMS and PICS_AMS_NOTIFICATIONS required for executing the TC ***"); + setverdict(inconc); + stop; } - } // End of 'alt' statement - - // Postamble - f_cf_01_http_notif_down(); - } - - - /** - * @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 - * @see ETSI GS MEC 021 2.0.8, clause 7.4.4 - */ - testcase TP_MEC_SRV_AMS_010_OK() runs on HttpComponent system HttpTestAdapter { - // Local variables - var HeaderLines v_headers; - - // Test control - if (not(PICS_AMS) or not(PICS_AMS_NOTIFICATIONS)) { - log("*** " & testcasename() & ": PICS_AMS and PICS_AMS_NOTIFICATIONS required for executing the TC ***"); - setverdict(inconc); - stop; - } - - // Test component configuration - f_cf_01_http_notif_up(); - - // Test adapter configuration - - // Preamble - f_init_default_headers_list(-, -, v_headers); - action("Trigger a expire notification event"); - f_selfOrClientSyncAndVerdict(c_prDone, e_success); - - // Test Body - tc_wait.start; - alt { - [] httpPort_notif.receive( - mw_http_request( - mw_http_request_post( - PX_CALLBACK_URI, - -, - mw_http_message_body_json( - mw_body_json_expire_notification( - mw_expire_notification( - -, - -, - timeStamp // @TODO how can I express timestamp in TTNC? - ) - ) - ) - ) - ) - ) { - tc_wait.stop; - log("*** " & testcasename() & ": INFO: IUT successfully sends adjacent application info notification ***"); - - // Send 204 No Content - httpPort_notif.send(m_http_response(m_http_response_204_no_content(v_headers))); - - log("*** " & testcasename() & ": PASS: IUT successfully sends adjacent applicationinfo notification ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + + // Test component configuration + f_cf_01_http_notif_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + 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( + PX_CALLBACK_URI, + -, + mw_http_message_body_json( + mw_body_json_mobility_procedure_notification( + mw_mobility_procedure_notification( + -, + PX_CALLBACK_REFERENCE, + -, + -, + - + ) + ) + ) + ) + ) + ) { + tc_wait.stop; + log("*** " & testcasename() & ": INFO: IUT successfully sends mobility procedure notification ***"); + + // Send 204 No Content + 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_cf_01_http_notif_down(); + } // End of TP_MEC_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 + * @see ETSI GS MEC 021 2.0.8, clause 7.4.3 + */ + testcase TP_MEC_SRV_AMS_009_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines v_headers; + + // Test control + if (not(PICS_AMS) or not(PICS_AMS_NOTIFICATIONS)) { + log("*** " & testcasename() & ": PICS_AMS and PICS_AMS_NOTIFICATIONS required for executing the TC ***"); + setverdict(inconc); + stop; } - [] tc_wait.timeout { - log("*** " & testcasename() & ": INCONC: Expected message not received ***"); - f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + + // Test component configuration + f_cf_01_http_notif_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + action("Trigger a adjacent application info event"); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_wait.start; + alt { + [] httpPort_notif.receive( + mw_http_request( + mw_http_request_post( + PX_CALLBACK_URI, + -, + mw_http_message_body_json( + mw_body_json_adjacent_application_info_notification( + mw_adjacent_application_info_notification( + -, + PX_CALLBACK_REFERENCE, + -, + -, + - + ) + ) + ) + ) + ) + ) { + tc_wait.stop; + log("*** " & testcasename() & ": INFO: IUT successfully sends adjacent application info notification ***"); + + // Send 204 No Content + httpPort_notif.send(m_http_response(m_http_response_204_no_content(v_headers))); + + log("*** " & testcasename() & ": PASS: IUT successfully sends adjacent application info 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_cf_01_http_notif_down(); + } + + + /** + * @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 + * @see ETSI GS MEC 021 2.0.8, clause 7.4.4 + */ + testcase TP_MEC_SRV_AMS_010_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines v_headers; + var UInt64 v_timestamp; + + // Test control + if (not(PICS_AMS) or not(PICS_AMS_NOTIFICATIONS)) { + log("*** " & testcasename() & ": PICS_AMS and PICS_AMS_NOTIFICATIONS required for executing the TC ***"); + setverdict(inconc); + stop; } - } // End of 'alt' statement - - // Postamble - f_cf_01_http_notif_down(); - } - - - - } // End of group ams_notifications - + + // Test component configuration + f_cf_01_http_notif_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + action("Trigger a expire notification event"); + v_timestamp := f_get_current_timestamp_utc(); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_wait.start; + alt { + [] httpPort_notif.receive( + mw_http_request( + mw_http_request_post( + PX_CALLBACK_URI, + -, + mw_http_message_body_json( + mw_body_json_expire_notification( + mw_expire_notification( + -, + -, + { seconds := v_timestamp / 1000, nanoSeconds := 1000 * v_timestamp mod 1000 } + ) + ) + ) + ) + ) + ) { + tc_wait.stop; + log("*** " & testcasename() & ": INFO: IUT successfully sends adjacent application info notification ***"); + + // Send 204 No Content + httpPort_notif.send(m_http_response(m_http_response_204_no_content(v_headers))); + + log("*** " & testcasename() & ": PASS: IUT successfully sends adjacent applicationinfo 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_cf_01_http_notif_down(); + } + + + + } // End of group ams_notifications + } // End of module AtsMec_Ams_TestCases diff --git a/ttcn/AtsMec/AtsMec_BwManagementAPI_TestCases.ttcn b/ttcn/AtsMec/AtsMec_BwManagementAPI_TestCases.ttcn index 9ad64c77523a61ab59a5a7c79df1e2c98580ca22..44e3c4c16a3a7e65aa3509e930412edc58553fdc 100644 --- a/ttcn/AtsMec/AtsMec_BwManagementAPI_TestCases.ttcn +++ b/ttcn/AtsMec/AtsMec_BwManagementAPI_TestCases.ttcn @@ -7,7 +7,7 @@ * 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 013 V2.0.3 (2018-10) + * @see ETSI GS MEC 003, Draft ETSI GS MEC 016 V2.0.3 (2018-10) */ module AtsMec_BwManagementAPI_TestCases { diff --git a/ttcn/AtsMec/AtsMec_MeoPkgm_TestCases.ttcn b/ttcn/AtsMec/AtsMec_MeoPkgm_TestCases.ttcn index d08a9e2ec606b983323c9427b010dc3d27d8538e..43cf6c46d6b7f4fcb1761783a72fc7cf89d725a8 100644 --- a/ttcn/AtsMec/AtsMec_MeoPkgm_TestCases.ttcn +++ b/ttcn/AtsMec/AtsMec_MeoPkgm_TestCases.ttcn @@ -84,7 +84,7 @@ module AtsMec_PkgMgmt_mm1_TestCases { mw_http_response_ok( mw_http_message_body_json( mw_body_json_pkg_mgmt_response( - mw_package_management_list( + mw_package_management_list( -, PX_APP_PKG_NAME, PX_APP_PKG_VERSION, diff --git a/ttcn/AtsMec/AtsMec_RnisAPI_TestCases.ttcn b/ttcn/AtsMec/AtsMec_RnisAPI_TestCases.ttcn index ca60a24a5ea7bf8cbfbacd567b24c19740ad8d21..d4c0cce6aef3ef933a0085ee0b6e165cdf2658ef 100644 --- a/ttcn/AtsMec/AtsMec_RnisAPI_TestCases.ttcn +++ b/ttcn/AtsMec/AtsMec_RnisAPI_TestCases.ttcn @@ -1543,6 +1543,64 @@ module AtsMec_RnisAPI_TestCases { f_cf_01_http_notif_down(); } // End of testcase TC_MEC_SRV_RNIS_008_OK + /** + * @desc Check that the RNIS service sends an RNIS notification about 5G NR UE measurement report if the RNIS service has an associated subscription and the event is generated. + * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/RNIS/RnisNotifications.tplan2 + */ + testcase TC_MEC_SRV_RNIS_009_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines v_headers; + + // Test control + if (not(PICS_RNIS) or not(PICS_RNIS_NOTIFICATIONS)) { + log("*** " & testcasename() & ": PICS_RNIS and PICS_RNIS_NOTIFICATIONS required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_notif_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + action("Trigger a MeasRepUeNotification event"); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_wait.start; + alt { + [] httpPort_notif.receive( + mw_http_request( + mw_http_request_post( + PX_CALLBACK_URI, + -, + mw_http_message_body_json( + mw_body_json_s1_bearer_subscription( + mw_s1_bearer_subscription( + PX_CALLBACK_REFERENCE, + PX_LINKS_SELF, + -//mw_filter_criteria + )))))) { + tc_wait.stop; + + // Send 204 No Content + httpPort_notif.send(m_http_response(m_http_response_204_no_content(v_headers))); + + log("*** " & testcasename() & ": PASS: IUT successfully sends RAB release 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_cf_01_http_notif_down(); + } // End of testcase TC_MEC_SRV_RNIS_009_OK + } // End of group rnis_notifications } // End of module AtsMec_RnisAPI_TestCases diff --git a/ttcn/LibIts b/ttcn/LibIts index 8b156c8b0781f511dc4444742ee2eed9818aa865..25c8a9e788ccd0fb17ef38dbf12b1a7e9a6c0085 160000 --- a/ttcn/LibIts +++ b/ttcn/LibIts @@ -1 +1 @@ -Subproject commit 8b156c8b0781f511dc4444742ee2eed9818aa865 +Subproject commit 25c8a9e788ccd0fb17ef38dbf12b1a7e9a6c0085 diff --git a/ttcn/LibMec/AppLCM/ttcn/AppLCM_Templates.ttcn b/ttcn/LibMec/AppLCM/ttcn/AppLCM_Templates.ttcn index cac24e07b264e953e470caa47d9fd8a32e1f6658..7cf328c3b682fabd1054badf78368307e6a35c0b 100644 --- a/ttcn/LibMec/AppLCM/ttcn/AppLCM_Templates.ttcn +++ b/ttcn/LibMec/AppLCM/ttcn/AppLCM_Templates.ttcn @@ -13,7 +13,7 @@ module AppLCM_Templates { template (present) CreateAppInstanceRequest m_lifecycle_management_create ( in template (present) String p_appDId := ? ) := { - appDId := p_appDId + appDId := p_appDId } template (present) CreateAppInstanceRequestWithError m_lifecycle_management_create_with_error ( diff --git a/ttcn/LibMec/AppLCM/ttcn/AppLCM_TypesAndValues.ttcn b/ttcn/LibMec/AppLCM/ttcn/AppLCM_TypesAndValues.ttcn index 5b0265cf64d652f2fd1618a6aa72c9a1e94ee549..9261f161d85d225cf512ec07880106c61435c927 100644 --- a/ttcn/LibMec/AppLCM/ttcn/AppLCM_TypesAndValues.ttcn +++ b/ttcn/LibMec/AppLCM/ttcn/AppLCM_TypesAndValues.ttcn @@ -100,13 +100,13 @@ type record AppInstanceLcmOpOcc { type record SubscriptionRequest { - AnyURI callbackUri, - SubscriptionType subscriptionType + SubscriptionType subscriptionType, + AnyURI callbackUri } type record SubscriptionRequestWithError { - AnyURI callbackUriWithError, - SubscriptionType subscriptionType + SubscriptionType subscriptionType, + AnyURI callbackUriWithError } type record of SubscriptionInfo SubscriptionInfoList; diff --git a/ttcn/LibMec/MeoPkgm/ttcn/MeoPkgm_Templates.ttcn b/ttcn/LibMec/MeoPkgm/ttcn/MeoPkgm_Templates.ttcn index 58909e8d66953136c882d318134231f5b93d7f96..fcbff08601e60d199ad0fb7e032e212bd79802af 100644 --- a/ttcn/LibMec/MeoPkgm/ttcn/MeoPkgm_Templates.ttcn +++ b/ttcn/LibMec/MeoPkgm/ttcn/MeoPkgm_Templates.ttcn @@ -66,7 +66,7 @@ module MeoPkgm_Templates { in template (present) SubscriptionType p_subscription_type := ?, in template (present) AnyURI p_callbackUri := ? ) := { - subscriptionId := p_subscriptionId ifpresent, + subscriptionId := p_subscriptionId /* FIXME Error??? ifpresent*/, subscriptionType := p_subscription_type, callbackUri := p_callbackUri } diff --git a/ttcn/LibMec/MepmPkgm/ttcn/MepmPkgm_Templates.ttcn b/ttcn/LibMec/MepmPkgm/ttcn/MepmPkgm_Templates.ttcn index 15a25142bb3427988689376eecefb3525124c522..bcc016ffae990c0330e2b5738673412e0cf5c775 100644 --- a/ttcn/LibMec/MepmPkgm/ttcn/MepmPkgm_Templates.ttcn +++ b/ttcn/LibMec/MepmPkgm/ttcn/MepmPkgm_Templates.ttcn @@ -42,13 +42,12 @@ module MepmPkgm_Templates { in template (present) UsageState p_usageState := ? ) := { appPkgId := p_appPkgId , - appName := p_appName, appDId := p_appDId , + appName := p_appName, appDVersion := p_appDVersion, checksum := p_checksum , operationalState := p_operationalState, - usageState := p_usageState - + usageState := p_usageState } @@ -74,7 +73,7 @@ module MepmPkgm_Templates { in template (present) SubscriptionType p_subscription_type := ?, in template (present) AnyURI p_callbackUri := ? ) := { - subscriptionId := p_subscriptionId ifpresent, + subscriptionId := p_subscriptionId /*FIXME Error???ifpresent*/, subscriptionType := p_subscription_type, callbackUri := p_callbackUri } diff --git a/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Templates.ttcn b/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Templates.ttcn index c70bc23f74613705de9b24a41df98c109d8bdc37..7f21798c70be72a1edaf7281f2d7c7ee41684e18 100644 --- a/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Templates.ttcn +++ b/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Templates.ttcn @@ -305,6 +305,26 @@ module RnisAPI_Templates { s1UeInfo := p_s1UeInfo } // End of temlate mw_s1_bearer_info + template (omit) L2Meas m_l2_measa( + in template (omit )TimeStamp p_timestamp := omit, + in template (value) CellInfo p_cellInfo, + in template (value) CellUEInfo p_cellUEInfo + ) := { + timestamp := p_timestamp, + cellInfo := p_cellInfo, + cellUEInfo := p_cellUEInfo + } // End of template m_l2_measa + + template L2Meas mw_l2_measa( + template TimeStamp p_timestamp := *, + template CellInfo p_cellInfo := *, + template CellUEInfo p_cellUEInfo := * + ) := { + timestamp := p_timestamp, + cellInfo := p_cellInfo, + cellUEInfo := p_cellUEInfo + } // End of template mw_l2_measa + } // End of group info_request group sub_types { diff --git a/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_TypesAndValues.ttcn b/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_TypesAndValues.ttcn index e5ba61fe92e26b69edc3ee6079d20808f77e80ba..2004abdf95f2464babdd1e0f3884bd410e13bd6c 100644 --- a/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_TypesAndValues.ttcn @@ -30,7 +30,7 @@ module RnisAPI_TypesAndValues { } /** - * @desc + * @desc This type represents the information on Mobile Network(s), which a MEC application instance is associated to. * @member timeStamp * @member appInsId * @member ecgi @@ -42,7 +42,7 @@ module RnisAPI_TypesAndValues { } /** - * @desc + * @desc This type represents the information on existing E-RABs that are associated with a specific MEC application instance. * @member timeStamp * @member appInsId * @member requestId @@ -56,7 +56,7 @@ module RnisAPI_TypesAndValues { } /** - * @desc + * @desc This type represents the information on S1-U bearer. * @member timeStamp * @member appInsId * @member ecgi @@ -65,7 +65,19 @@ module RnisAPI_TypesAndValues { TimeStamp timeStamp optional, S1UeInfo s1UeInfo } - + + /** + * @desc This type represents the information on the Layer 2 measurements information from one or more eNBs that are associated with the requested MEC application instance. + * @member timestamp Time stamp + * @member cellInfo The per cell measurement information + * @member cellUEInfo The per cell per UE layer 2 measurements information + */ + type record L2Meas { + TimeStamp timestamp optional, + CellInfo cellInfo optional, + CellUEInfo cellUEInfo optional + } + /** * @desc The information on users per cell * @member tempUeId @@ -261,7 +273,95 @@ module RnisAPI_TypesAndValues { UInt32 erabGbrUl } type record of QosInformation_ QosInformation; - + + type integer UInt100 (0 .. 100) with {variant "unsigned 100 bit"}; + + /** + * @desc The per cell measurement information + * @member ecgi E-UTRAN CelI Global Identifier + * @member dl_gbr_prb_usage_cell indicates the PRB usage for downlink GBR traffic, as defined in ETSI TS 136 314 [i.11] and ETSI TS 136 423 [i.12]. + * @member ul_gbr_prb_usage_cell indicates (in percentage) the PRB usage for uplink GBR traffic, as defined in ETSI TS 136 314 [i.11] and ETSI TS 136 423 [i.12]. + * @member dl_nongbr_prb_usage_cell indicates (in percentage) the PRB usage for downlink non-GBR traffic, as defined in ETSI TS 136 314 [i.11] and ETSI TS 136 423 [i.12]. + * @member ul_nongbr_prb_usage_cell indicates (in percentage) the PRB usage for uplink non-GBR traffic, as defined in ETSI TS 136 314 [i.11] and ETSI TS 136 423 [i.12]. + * @member dl_total_prb_usage_cell indicates (in percentage) the PRB usage for total downlink traffic, as defined in ETSI TS 136 314 [i.11] and ETSI TS 136 423 [i.12]. + * @member ul_total_prb_usage_cell indicates (in percentage) the PRB usage for total uplink traffic, as defined in ETSI TS 136 314 [i.11] and ETSI TS 136 423 [i.12]. + * @member received_dedicated_preambles_cell indicates (in percentage) the received dedicated preamples, as defined in ETSI TS 136 314 [i.11]. + * @member received_randomly_selected_preambles_low_range_cellIt indicates (in percentage) the received randomly selected preambles in the low range, as defined in ETSI TS 136 314 [i.11]. + * @member received_randomly_selected_preambles_high_range_cell It indicates (in percentage) the received randomly selected preambles in the high range, as defined in ETSI TS 136 314 [i.11]. + * @member number_of_active_ue_dl_gbr_cell It indicates the number of active UEs with downlink GBR traffic, as defined in ETSI TS 136 314 [i.11]. + * @member number_of_active_ue_ul_gbr_cell It indicates the number of active UEs with uplink GBR traffic, as defined in ETSI TS 136 314 [i.x]. + * @member number_of_active_ue_dl_nongbr_cell It indicates the number of active UEs with downlink non-GBR traffic, as defined in ETSI TS 136 314 [i.11]. + * @member number_of_active_ue_ul_nongbr_cell It indicates the number of active UEs with uplink non-GBR traffic, as defined in ETSI TS 136 314 [i.11]. + * @member dl_gbr_pdr_cell It indicates the packet discard rate in percentage of the downlink GBR traffic in a cell, as defined in ETSI TS 136 314 [i.x]. + * @member ul_gbr_pdr_cell It indicates the packet discard rate in percentage of the uplink GBR traffic in a cell, as defined in ETSI TS 136 314 [i.11]. + * @member dl_nongbr_pdr_cell It indicates the packet discard rate in percentage of the downlink non-GBR traffic in a cell, as defined in ETSI TS 136 314 [i.x]. + * @member ul_nongbr_pdr_cell It indicates the packet discard rate in percentage of the uplink non-GBR traffic in a cell, as defined in ETSI TS 136 314 [i.11]. + */ + type record CellInfo_ { + Ecgi ecgi optional, + UInt100 dl_gbr_prb_usage_cell optional, + UInt100 ul_gbr_prb_usage_cell optional, + UInt100 dl_nongbr_prb_usage_cell optional, + UInt100 ul_nongbr_prb_usage_cell optional, + UInt100 dl_total_prb_usage_cell optional, + UInt100 ul_total_prb_usage_cell optional, + UInt100 received_dedicated_preambles_cell optional, + UInt100 received_randomly_selected_preambles_low_range_cell optional, + UInt100 received_randomly_selected_preambles_high_range_cell optional, + integer number_of_active_ue_dl_gbr_cell optional, + integer number_of_active_ue_ul_gbr_cell optional, + integer number_of_active_ue_dl_nongbr_cell optional, + integer number_of_active_ue_ul_nongbr_cell optional, + UInt100 dl_gbr_pdr_cell optional, + UInt100 ul_gbr_pdr_cell optional, + UInt100 dl_nongbr_pdr_cell optional, + UInt100 ul_nongbr_pdr_cell optional + } + type record of CellInfo_ CellInfo; + + /** + * @desc The per cell measurement information + * @member ecgi E-UTRAN CelI Global Identifier + * @member associateId Identifier to associate the information for a specific UE or flow. + * @member dl_gbr_delay_ue It indicates the packet delay of the downlink GBR traffic of a UE, as defined in ETSI TS 136 314 [i.11]. + * @member ul_gbr_delay_ue It indicates the packet delay of the uplink GBR traffic of a UE, as defined in ETSI TS 136 314 [i.11]. + * @member dl_nongbr_delay_ue It indicates the packet delay of the downlink non-GBR traffic of a UE, as defined in ETSI TS 136 314 [i.11]. + * @member ul_nongbr_delay_ue It indicates the packet delay of the uplink non-GBR traffic of a UE, as defined in ETSI TS 136 314 [i.11]. + * @member dl_gbr_pdr_ue It indicates the packet discard rate in percentage of the downlink GBR traffic of a UE, as defined in ETSI TS 136 314 [i.11]. + * @member ul_gbr_pdr_ue It indicates the packet discard rate in percentage of the uplink GBR traffic of a UE, as defined in ETSI TS 136 314 [i.11]. + * @member dl_nongbr_pdr_ue It indicates the packet discard rate in percentage of the downlink non-GBR traffic of a UE, as defined in ETSI TS 136 314 [i.11]. + * @member ul_nongbr_pdr_ue It indicates the packet discard rate in percentage of the uplink non-GBR traffic of a UE, as defined in ETSI TS 136 314 [i.11]. + * @member dl_gbr_throughput_ue It indicates the scheduled throughput of the downlink GBR traffic of a UE, as defined in ETSI TS 136 314 [i.11]. + * @member ul_gbr_throughput_ue It indicates the scheduled throughput of the uplink GBR traffic of a UE, as defined in ETSI TS 136 314 [i.11]. + * @member dl_nongbr_throughput_ue It indicates the scheduled throughput of the downlink non-GBR traffic of a UE, as defined in ETSI TS 136 314 [i.11]. + * @member ul_nongbr_throughput_ue It indicates the scheduled throughput of the uplink non-GBR traffic of a UE, as defined in ETSI TS 136 314 [i.11]. + * @member dl_gbr_data_volume_ue It indicates the data volume of the downlink GBR traffic of a UE, as defined in ETSI TS 136 314 [i.11]. + * @member ul_gbr_data_volume_ue It indicates the data volume of the uplink GBR traffic of a UE, as defined in ETSI TS 136 314 [i.11]. + * @member dl_nongbr_data_volume_ue It indicates the data volume of the downlink non-GBR traffic of a UE, as defined in ETSI TS 136 314 [i.11]. + * @member ul_nongbr_data_volume_ue It indicates the data volume of the uplink non-GBR traffic of a UE, as defined in ETSI TS 136 314 [i.11]. + */ + type record CellUEInfo_ { + Ecgi ecgi optional, + AssociateId associateId, + integer dl_gbr_delay_ue optional, + integer ul_gbr_delay_ue optional, + integer dl_nongbr_delay_ue optional, + integer ul_nongbr_delay_ue optional, + UInt100 dl_gbr_pdr_ue optional, + UInt100 ul_gbr_pdr_ue optional, + UInt100 dl_nongbr_pdr_ue optional, + UInt100 ul_nongbr_pdr_ue optional, + integer dl_gbr_throughput_ue optional, + integer ul_gbr_throughput_ue optional, + integer dl_nongbr_throughput_ue optional, + integer ul_nongbr_throughput_ue optional, + integer dl_gbr_data_volume_ue optional, + integer ul_gbr_data_volume_ue optional, + integer dl_nongbr_data_volume_ue optional, + integer ul_nongbr_data_volume_ue optional + } + type record of CellUEInfo_ CellUEInfo; + /** * @desc * @member links @@ -274,18 +374,6 @@ module RnisAPI_TypesAndValues { variant (links) "name as '_links'"; } - /** - * @desc - * @member callbackReference - * @member filterCriteria - * @member expiryDeadline - */ - type record MeasRepUeSubscriptionPost { - CallbackReference callbackReference, - FilterCriteriaAssocTri filterCriteria, - TimeStamp expiryDeadline optional - } - /** * @desc * @member callbackReference @@ -303,20 +391,6 @@ module RnisAPI_TypesAndValues { variant (links) "name as '_links'"; } - /** - * @desc - * @member callbackReference - * @member eventType - * @member s1BearerSubscriptionCriteria - * @member expiryDeadline - */ - type record S1BearerSubscriptionPost { - CallbackReference callbackReference, - EventType eventType, - S1BearerSubscriptionCriteria s1BearerSubscriptionCriteria, - TimeStamp expiryDeadline optional - } - /** * @desc * @member callbackReference @@ -350,22 +424,6 @@ module RnisAPI_TypesAndValues { variant (links) "name as '_links'"; } - /** - * @desc - * @member callbackReference - * @member links - * @member filterCriteria - * @member expiryDeadline - */ - type record RabEstSubscriptionPost { - CallbackReference callbackReference, - Link links, - FilterCriteriaAssocQci filterCriteria, - TimeStamp expiryDeadline optional - } with { - variant (links) "name as '_links'"; - } - /** * @desc * @member callbackReference @@ -383,18 +441,6 @@ module RnisAPI_TypesAndValues { variant (links) "name as '_links'"; } - /** - * @desc - * @member callbackReference - * @member filterCriteria - * @member expiryDeadline - */ - type record RabModSubscriptionPost { - CallbackReference callbackReference, - FilterCriteriaAssocQci filterCriteria, - TimeStamp expiryDeadline optional - } - /** * @desc * @member callbackReference @@ -412,18 +458,6 @@ module RnisAPI_TypesAndValues { variant (links) "name as '_links'"; } - /** - * @desc - * @member callbackReference - * @member filterCriteria - * @member expiryDeadline - */ - type record RabRelSubscriptionPost { - CallbackReference callbackReference, - FilterCriteriaAssocQci filterCriteria, - TimeStamp expiryDeadline optional - } - /** * @desc * @member callbackReference @@ -441,30 +475,6 @@ module RnisAPI_TypesAndValues { variant (links) "name as '_links'"; } - /** - * @desc - * @member callbackReference - * @member filterCriteria - * @member expiryDeadline - */ - type record CaReConfSubscriptionPost { - CallbackReference callbackReference, - FilterCriteriaAssoc filterCriteria, - TimeStamp expiryDeadline optional - } - - /** - * @desc - * @member callbackReference - * @member filterCriteria - * @member expiryDeadline - */ - type record CellChangeSubscriptionPost { - CallbackReference callbackReference, - FilterCriteriaAssocHo filterCriteria, - TimeStamp expiryDeadline optional - } - /** * @desc * @member callbackReference @@ -482,19 +492,6 @@ module RnisAPI_TypesAndValues { variant (links) "name as '_links'"; } - /** - * @desc - * @member callbackReference - * @member filterCriteria - * @member expiryDeadline - */ - type record MeasTaSubscriptionPost { - SubscriptionType subscriptionType, - CallbackReference callbackReference, - FilterCriteriaAssoc filterCriteria, - TimeStamp expiryDeadline optional - } - /** * @desc * @member callbackReference diff --git a/ttcn/LibMec/ttcn/LibMec_Functions.ttcn b/ttcn/LibMec/ttcn/LibMec_Functions.ttcn index 17f05f38501d82aecf4b38935eb51bf092821423..5c1971de7785bba0dc41becf35e2810a30422968 100644 --- a/ttcn/LibMec/ttcn/LibMec_Functions.ttcn +++ b/ttcn/LibMec/ttcn/LibMec_Functions.ttcn @@ -1,6 +1,7 @@ module LibMec_Functions { // Libcommon + import from LibCommon_BasicTypesAndValues all; import from LibCommon_Sync all; // LibMec @@ -19,6 +20,7 @@ module LibMec_Functions { import from LibItsHttp_TestSystem all; import from LibItsHttp_Templates all; import from LibItsHttp_JsonTemplates all; + import from LibItsHttp_Pics all; group preambles { @@ -112,6 +114,16 @@ module LibMec_Functions { } // End of group postambles + group external_functions { + + /** + * @desc Gets the current time since 01/01/1970 in UTC format + * @return The current time since 01/01/1970 in UTC format + */ + external function fx_get_current_time_utc() return UInt64; + + } // End of group external_functions + group helpers { /** @@ -198,6 +210,10 @@ module LibMec_Functions { return v_result; } // End of function f_check_user_register_state + function f_get_current_timestamp_utc() return UInt64 { + return fx_get_current_time_utc(); + } // End of function f_get_current_timestamp + } // End of group helpers group registration { @@ -324,13 +340,22 @@ module LibMec_Functions { log("*** " & testcasename() & ": FAIL: Unexpected binary response ***"); f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); } + [PICS_USE_TOKEN_HEADER == false] httpPort.receive( + mw_http_response( + mw_http_response_401_unauthorized + )) -> value v_response { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: Received HTTP error message in case of non authenticated HTTP request ***"); + f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); + } [] httpPort.receive( mw_http_response( mw_http_response_ko )) -> value v_response { tc_ac.stop; log("*** " & testcasename() & ": FAIL: Server error: " & int2str(v_response.response.statuscode) & "/" & v_response.response.statustext & " ***"); - f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); + f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); + // Do not repeat! } [] httpPort.receive(mw_http_response) -> value v_response { tc_ac.stop; diff --git a/ttcn/patch_lib_http/LibItsHttp_JsonMessageBodyTypes.ttcn b/ttcn/patch_lib_http/LibItsHttp_JsonMessageBodyTypes.ttcn index 97d971cb6381e3528ba8faee053b42562e601a9f..29fa3a998576e08134aa6f88f63a99c462794880 100644 --- a/ttcn/patch_lib_http/LibItsHttp_JsonMessageBodyTypes.ttcn +++ b/ttcn/patch_lib_http/LibItsHttp_JsonMessageBodyTypes.ttcn @@ -12,13 +12,13 @@ module LibItsHttp_JsonMessageBodyTypes { import from Ams_TypesAndValues all; // LibMec/AppEnablementAPI import from AppEnablementAPI_TypesAndValues all; - + // LibMec/GrantAPI import from Grant_TypesAndValues all; - + // LibMec/AppPkgAPI import from MeoPkgm_TypesAndValues all; - + // LibMec/AppEnablementAPI import from MepmPkgm_TypesAndValues all; - + // LibMec/AppLCMAPI import from AppLCM_TypesAndValues all; // LibMec/UEAppInterfaceAPI @@ -54,6 +54,7 @@ module LibItsHttp_JsonMessageBodyTypes { MeasTaSubscription measTaSubscription, CaReConfSubscription caReConfSubscription, S1BearerSubscription s1BearerSubscription, + L2Meas l2Meas, RnisAPI_TypesAndValues.ProblemDetails problemDetails_rnis, BwInfo bwInfo, BwManagementAPI_TypesAndValues.ProblemDetails problemDetails_bw_management, diff --git a/ttcn/patch_lib_http/LibItsHttp_JsonTemplates.ttcn b/ttcn/patch_lib_http/LibItsHttp_JsonTemplates.ttcn index cd039b5821af5144e3076016ab39eccf79c756f9..ee6edac3531fce983f58e02fd5d0bde902182382 100644 --- a/ttcn/patch_lib_http/LibItsHttp_JsonTemplates.ttcn +++ b/ttcn/patch_lib_http/LibItsHttp_JsonTemplates.ttcn @@ -698,6 +698,18 @@ group ams_api { s1BearerSubscription := p_s1BearerSubscription } // End of template mw_body_json_s1_bearer_subscription + template (value) JsonBody m_body_json_l2_meas_subscription( + in template (value) L2Meas p_l2Meas + ) := { + l2Meas := p_l2Meas + } // End of template m_body_json_l2_meas_subscription + + template (present) JsonBody mw_body_json_l2_meas_subscription( + template (present) L2Meas p_l2Meas := ? + ) := { + l2Meas := p_l2Meas + } // End of template mw_body_json_l2_meas_subscription + template (value) JsonBody m_body_json_rni_problem_details( in template (value) RnisAPI_TypesAndValues.ProblemDetails p_problemDetails ) := {