From 79d00f6f3e540cc49efd427a4ae4e0fbee576949 Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Tue, 11 Jun 2019 04:52:24 -0700 Subject: [PATCH] Validate UEidentityAPI BI_BO tests --- etc/AtsMec/AtsMec.cfg | 8 +- ttcn/AtsMec/AtsMec_TestControl.ttcn | 4 + .../AtsMec_UEidentityAPI_TestCases.ttcn | 228 ++++++++++++++++++ .../ttcn/BwManagementAPI_TypesAndValues.ttcn | 3 +- .../RnisAPI/ttcn/RnisAPI_TypesAndValues.ttcn | 3 +- .../ttcn/UEidentityAPI_Pixits.ttcn | 6 + .../ttcn/UEidentityAPI_TypesAndValues.ttcn | 18 +- .../LibItsHttp_JsonTemplates.ttcn | 16 +- 8 files changed, 270 insertions(+), 16 deletions(-) diff --git a/etc/AtsMec/AtsMec.cfg b/etc/AtsMec/AtsMec.cfg index ca750b9..7378a6e 100644 --- a/etc/AtsMec/AtsMec.cfg +++ b/etc/AtsMec/AtsMec.cfg @@ -13,15 +13,13 @@ LibItsHttp_Pics.PICS_HEADER_HOST := "192.168.0.5" LibItsHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json" LibMec_Pics.PICS_MEC_PLAT := true -LibMec_Pics.PICS_RNIS := true +LibMec_Pics.PICS_RNIS := false -LocationAPI_Pics.PICS_LOCATION_API_SUPPORTED := true -LocationAPI_Pics.PICS_LOCATION_API_SUPPORTED := true -LocationAPI_Pics.PICS_LOCATION_API_SUPPORTED := true +LocationAPI_Pics.PICS_LOCATION_API_SUPPORTED := false UEidentityAPI_Pics.PICS_UE_IDENTITY_API_SUPPORTED := true -BwManagementAPI_Pics.PICS_BWMANAGEMENT_API_SUPPORTED := true +BwManagementAPI_Pics.PICS_BWMANAGEMENT_API_SUPPORTED := false [LOGGING] # In this section you can specify the name of the log file and the classes of events diff --git a/ttcn/AtsMec/AtsMec_TestControl.ttcn b/ttcn/AtsMec/AtsMec_TestControl.ttcn index 01418db..5cdfe3a 100644 --- a/ttcn/AtsMec/AtsMec_TestControl.ttcn +++ b/ttcn/AtsMec/AtsMec_TestControl.ttcn @@ -30,6 +30,10 @@ module AtsMec_TestControl { execute(TC_MEC_PLAT_MP1_UETAG_BV_001()); execute(TC_MEC_PLAT_MP1_UETAG_BV_002()); execute(TC_MEC_PLAT_MP1_UETAG_BV_003()); + execute(TC_MEC_PLAT_MP1_UETAG_BI_001()); + execute(TC_MEC_PLAT_MP1_UETAG_BI_002()); + execute(TC_MEC_PLAT_MP1_UETAG_BI_003()); + execute(TC_MEC_PLAT_MP1_UETAG_BI_004()); } if (PICS_LOCATION_API_SUPPORTED) { execute(TC_MEC_PLAT_MP1_INF_BV_001()); diff --git a/ttcn/AtsMec/AtsMec_UEidentityAPI_TestCases.ttcn b/ttcn/AtsMec/AtsMec_UEidentityAPI_TestCases.ttcn index 8a3f5d4..016dca1 100644 --- a/ttcn/AtsMec/AtsMec_UEidentityAPI_TestCases.ttcn +++ b/ttcn/AtsMec/AtsMec_UEidentityAPI_TestCases.ttcn @@ -232,6 +232,234 @@ module AtsMec_UEidentityAPI_TestCases { f_cf_01_http_down(); } // End of testcase TC_MEC_PLAT_MP1_UETAG_BV_003 + /** + * @desc Check that the IUT responds with ProblemDetails on information on an unknown UE Identity tag when queried by a MEC Application + * @see https://forge.etsi.org/gitlab/mec/MEC-tests/blob/master/Test%20Purposes/Plat/Mp1/UeIdentity/PlatUeIdentity.tplan2 + */ + testcase TC_MEC_PLAT_MP1_UETAG_BI_001() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines v_headers; + var HttpMessage v_response; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_UE_IDENTITY_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_LOCATION_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info?ueIdentityTag=" & oct2char(unichar2oct(PX_UE_IDENTITY_TAG_UNKNOWN, "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_ue_identity_problem_details( + mw_problem_details( + -, -, 404 + )))))) -> value v_response { + 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 + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_PLAT_MP1_UETAG_BI_001 + + /** + * @desc Check that the IUT responds with ProblemDetails on information an unknown Application Instance Identifier when queried by a MEC Application + * @see https://forge.etsi.org/gitlab/mec/MEC-tests/blob/master/Test%20Purposes/Plat/Mp1/UeIdentity/PlatUeIdentity.tplan2 + */ + testcase TC_MEC_PLAT_MP1_UETAG_BI_002() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines v_headers; + var HttpMessage v_response; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_UE_IDENTITY_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_LOCATION_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID_UNKNOWN, "UTF-8")) & "/ue_identity_tag_info?ueIdentityTag=" & oct2char(unichar2oct(PX_UE_IDENTITY_TAG, "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_ue_identity_problem_details( + mw_problem_details( + -, -, 404 + )))))) -> value v_response { + 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 + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_PLAT_MP1_UETAG_BI_002 + + /** + * @desc Check that the IUT responds with ProblemDetails on information an invalid URI + * @see https://forge.etsi.org/gitlab/mec/MEC-tests/blob/master/Test%20Purposes/Plat/Mp1/UeIdentity/PlatUeIdentity.tplan2 + */ + testcase TC_MEC_PLAT_MP1_UETAG_BI_003() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines v_headers; + var HttpMessage v_response; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_UE_IDENTITY_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_LOCATION_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_information?ueIdentityTag=" & oct2char(unichar2oct(PX_UE_IDENTITY_TAG, "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_ue_identity_problem_details( + mw_problem_details( + -, -, 400 + )))))) -> value v_response { + 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 + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_PLAT_MP1_UETAG_BI_003 + + /** + * @desc Check that the IUT responds with ProblemDetails on information on not allowed request + * @see https://forge.etsi.org/gitlab/mec/MEC-tests/blob/master/Test%20Purposes/Plat/Mp1/UeIdentity/PlatUeIdentity.tplan2 + */ + testcase TC_MEC_PLAT_MP1_UETAG_BI_004() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines v_headers; + var HttpMessage v_response; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_UE_IDENTITY_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_LOCATION_API_SUPPORTED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(APP_INSTANCE_ID_WITH_RESTRICTED_ACCESS, "UTF-8")) & "/ue_identity_tag_info?ueIdentityTag=" & oct2char(unichar2oct(PX_UE_IDENTITY_TAG, "UTF-8")), + v_headers + ) + ) + ); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_403_forbidden( + mw_http_message_body_json( + mw_body_json_ue_identity_problem_details( + mw_problem_details( + -, -, 403 + )))))) -> value v_response { + 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 + + // Postamble + f_cf_01_http_down(); + } // End of testcase TC_MEC_PLAT_MP1_UETAG_BI_004 + } // End of group me_app_role } // End of module AtsMec_TestCases diff --git a/ttcn/LibMec/BwManagementAPI/ttcn/BwManagementAPI_TypesAndValues.ttcn b/ttcn/LibMec/BwManagementAPI/ttcn/BwManagementAPI_TypesAndValues.ttcn index 10fc131..63da82e 100644 --- a/ttcn/LibMec/BwManagementAPI/ttcn/BwManagementAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/BwManagementAPI/ttcn/BwManagementAPI_TypesAndValues.ttcn @@ -7,12 +7,13 @@ module BwManagementAPI_TypesAndValues { import from LibCommon_BasicTypesAndValues all; /** - * @desc + * @desc Problem Details for HTTP APIs * @member type_ A URI reference according to IETF RFC 3986 that identifies the problem type * @member title A short, human-readable summary of the problem type * @member status The HTTP status code for this occurrence of the problem * @member detail A human-readable explanation specific to this occurrence of the problem * @member instance A URI reference that identifies the specific occurrence of the problem + * @see IETF RFC 7807 Clause 3. The Problem Details JSON Object */ type record ProblemDetails { JSON.String type_, diff --git a/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_TypesAndValues.ttcn b/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_TypesAndValues.ttcn index e52586b..9be42ff 100644 --- a/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_TypesAndValues.ttcn @@ -11,12 +11,13 @@ module RnisAPI_TypesAndValues { import from LibCommon_BasicTypesAndValues all; /** - * @desc + * @desc Problem Details for HTTP APIs * @member type_ A URI reference according to IETF RFC 3986 that identifies the problem type * @member title A short, human-readable summary of the problem type * @member status The HTTP status code for this occurrence of the problem * @member detail A human-readable explanation specific to this occurrence of the problem * @member instance A URI reference that identifies the specific occurrence of the problem + * @see IETF RFC 7807 Clause 3. The Problem Details JSON Object */ type record ProblemDetails { JSON.String type_, diff --git a/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_Pixits.ttcn b/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_Pixits.ttcn index 73f030d..f513896 100644 --- a/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_Pixits.ttcn +++ b/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_Pixits.ttcn @@ -8,6 +8,12 @@ module UEidentityAPI_Pixits { modulepar universal charstring PX_APP_INSTANCE_ID := "appInst01"; + modulepar universal charstring PX_APP_INSTANCE_ID_UNKNOWN := "appInst99"; + + modulepar universal charstring APP_INSTANCE_ID_WITH_RESTRICTED_ACCESS := "appInst98"; + modulepar universal charstring PX_UE_IDENTITY_TAG := "UeTagA"; + modulepar universal charstring PX_UE_IDENTITY_TAG_UNKNOWN := "UeTagW"; + } // End of module UEidentityAPI_Pixits diff --git a/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_TypesAndValues.ttcn b/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_TypesAndValues.ttcn index 316a845..77007fb 100644 --- a/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_TypesAndValues.ttcn @@ -1,3 +1,13 @@ +/** + * @author ETSI / STF569 + * @version $URL$ + * $Id$ + * @desc Module containing types and values for UeIdentiyAPI protocol + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + */ module UEidentityAPI_TypesAndValues { // JSON @@ -7,12 +17,13 @@ module UEidentityAPI_TypesAndValues { import from LibCommon_BasicTypesAndValues all; /** - * @desc + * @desc Problem Details for HTTP APIs * @member type_ A URI reference according to IETF RFC 3986 that identifies the problem type * @member title A short, human-readable summary of the problem type * @member status The HTTP status code for this occurrence of the problem * @member detail A human-readable explanation specific to this occurrence of the problem * @member instance A URI reference that identifies the specific occurrence of the problem + * @see IETF RFC 7807 Clause 3. The Problem Details JSON Object */ type record ProblemDetails { JSON.String type_, @@ -27,6 +38,7 @@ module UEidentityAPI_TypesAndValues { /** * @desc Information of UE identity tag used in UE Identity feature * @member ueIdentityTags 1 to N tags presented by a ME Application instance to a ME Platform + * @see ETSI GS MEC 014 Clause 7.2 Global definitions and resource structure */ type record UeIdentityTagInfo { UeIdentityTags ueIdentityTags @@ -34,11 +46,13 @@ module UEidentityAPI_TypesAndValues { /** * @desc Specific tag presented by a ME Application instance to a ME Platform + * @see ETSI GS MEC 014 Clause 6.2.2 Type: UeIdentityTagInfo */ type JSON.String UeIdentityTag; /** * @desc Status of the resource ueIdentityTagInfo + * @see ETSI GS MEC 014 Clause 6.2.2 Type: UeIdentityTagInfo */ type enumerated State { UNREGISTERED, @@ -49,6 +63,7 @@ module UEidentityAPI_TypesAndValues { * @desc ME Application instance to a ME Platform * @member ueIdentityTag Specific tag presented by a ME Application instance to a ME Platform * @member state Status of the resource ueIdentityTagInfo + * @see ETSI GS MEC 014 Clause 6.2.2 Type: UeIdentityTagInfo */ type record UeIdentityTagItem { JSON.String ueIdentityTag, @@ -57,6 +72,7 @@ module UEidentityAPI_TypesAndValues { /** * @desc 1 to N tags presented by a ME Application instance to a ME Platform + * @see ETSI GS MEC 014 Clause 6.2.2 Type: UeIdentityTagInfo */ type record of UeIdentityTagItem UeIdentityTags; diff --git a/ttcn/patch_lib_http/LibItsHttp_JsonTemplates.ttcn b/ttcn/patch_lib_http/LibItsHttp_JsonTemplates.ttcn index c7de670..d366bce 100644 --- a/ttcn/patch_lib_http/LibItsHttp_JsonTemplates.ttcn +++ b/ttcn/patch_lib_http/LibItsHttp_JsonTemplates.ttcn @@ -107,17 +107,17 @@ module LibItsHttp_JsonTemplates { ueIdentityTagInfo := p_ueIdentityTagInfo } // End of template mw_body_json_ue_identity_tag_info - template (value) JsonBody m_body_json_ue_problem_details( - in template (value) UEidentityAPI_TypesAndValues.ProblemDetails p_problemDetails - ) := { + template (value) JsonBody m_body_json_ue_identity_problem_details( + in template (value) UEidentityAPI_TypesAndValues.ProblemDetails p_problemDetails + ) := { problemDetails_ue_identity := p_problemDetails - } // End of template m_body_json_ue_problem_details + } // End of template m_body_json_ue_identity_problem_details - template (present) JsonBody mw_body_json_ue_problem_details( - template (present) UEidentityAPI_TypesAndValues.ProblemDetails p_problemDetails := ? - ) := { + template (present) JsonBody mw_body_json_ue_identity_problem_details( + template (present) UEidentityAPI_TypesAndValues.ProblemDetails p_problemDetails := ? + ) := { problemDetails_ue_identity := p_problemDetails - } // End of template mw_body_json_ue_problem_details + } // End of template mw_body_json_ue_identity_problem_details } // End of group ue_identity_api -- GitLab