From ce629822cc578704686893962d738f39f3ebfcb7 Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 16 May 2019 06:17:52 -0700 Subject: [PATCH] Add RnisAPI tests --- ccsrc/Protocols/Json/json_codec.cc | 2 +- scripts/mec_generate_makefile.bash | 2 +- scripts/update_mec_project.bash | 2 +- ttcn/AtsMec/AtsMec_RnisAPI_TestCases.ttcn | 6 +- ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Pixits.ttcn | 5 + .../RnisAPI/ttcn/RnisAPI_Templates.ttcn | 10 +- .../RnisAPI/ttcn/RnisAPI_TypesAndValues.ttcn | 194 ++++++++++-------- .../LibItsHttp_JsonMessageBodyTypes.ttcn | 19 +- .../LibItsHttp_JsonTemplates.ttcn | 11 +- 9 files changed, 144 insertions(+), 107 deletions(-) create mode 100644 ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Pixits.ttcn diff --git a/ccsrc/Protocols/Json/json_codec.cc b/ccsrc/Protocols/Json/json_codec.cc index d3e6c99..8d4d30e 100644 --- a/ccsrc/Protocols/Json/json_codec.cc +++ b/ccsrc/Protocols/Json/json_codec.cc @@ -65,7 +65,7 @@ int json_codec::decode (const OCTETSTRING& p_data, LibItsHttp__JsonMessageBodyTy } else if (it->second.find("\"problemDetails\"") != std::string::npos) { UEidentityAPI__TypesAndValues::ProblemDetails problem_details; problem_details.decode(UEidentityAPI__TypesAndValues::ProblemDetails_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); - msg.problemDetails() = problem_details; + msg.problemDetails__ue__identity() = problem_details; } else { loggers::get_instance().warning("json_codec::decode: Unsupported variant"); return -1; diff --git a/scripts/mec_generate_makefile.bash b/scripts/mec_generate_makefile.bash index 959df8f..917a764 100755 --- a/scripts/mec_generate_makefile.bash +++ b/scripts/mec_generate_makefile.bash @@ -52,7 +52,7 @@ find .. -type f -name "*.bak" -exec rm {} \; find .. -type f -name "*.log" -exec rm {} \; # Build JSON files if any and put them in objs directory -REFERENCES="LibCommon LibHttp LibMec LibMec/LocationAPI LibMec/UEidentityAPI" +REFERENCES="LibCommon LibHttp LibMec LibMec/LocationAPI LibMec/RnisAPI LibMec/UEidentityAPI" for i in ${REFERENCES} do # TTCN code diff --git a/scripts/update_mec_project.bash b/scripts/update_mec_project.bash index 0f418ba..42d9a31 100755 --- a/scripts/update_mec_project.bash +++ b/scripts/update_mec_project.bash @@ -146,7 +146,7 @@ do then cp ${TTCN_3_ORG_PATH}/$i/ttcn/*.ttcn ${TTCN_3_DST_PATH}/$i/ttcn cp ${TTCN_3_ORG_PATH}/$i/json/*.json ${TTCN_3_DST_PATH}/$i/json - elif [ "$i" == "LibMec/RnsiAPI" ] + elif [ "$i" == "LibMec/RnisAPI" ] then cp ${TTCN_3_ORG_PATH}/$i/ttcn/*.ttcn ${TTCN_3_DST_PATH}/$i/ttcn cp ${TTCN_3_ORG_PATH}/$i/json/*.json ${TTCN_3_DST_PATH}/$i/json diff --git a/ttcn/AtsMec/AtsMec_RnisAPI_TestCases.ttcn b/ttcn/AtsMec/AtsMec_RnisAPI_TestCases.ttcn index 3753452..19227d8 100644 --- a/ttcn/AtsMec/AtsMec_RnisAPI_TestCases.ttcn +++ b/ttcn/AtsMec/AtsMec_RnisAPI_TestCases.ttcn @@ -40,7 +40,7 @@ module AtsMec_RnisAPI_TestCases { * @desc Check that the RNIS service sends all RNIS subscriptions when requested * @see Check that the RNIS service sends all RNIS subscriptions when requested */ - testcase TC_MEC025_RNI_SUBSCRIPTION_05() runs on HttpComponent system HttpTestAdapter { + testcase TC_MEC025_RNI_SUBSCRIPTION_005() runs on HttpComponent system HttpTestAdapter { // Local variables var HeaderLines v_headers; var HttpMessage v_response; @@ -90,9 +90,9 @@ module AtsMec_RnisAPI_TestCases { // Postamble f_cf_01_http_down(); - } // End of testcase TC_MEC025_RNI_SUBSCRIPTION_05 + } // End of testcase TC_MEC025_RNI_SUBSCRIPTION_005 - } // End of group me_app_role + } // End of group me_app_role } // End of module AtsMec_RnisAPI_TestCases diff --git a/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Pixits.ttcn b/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Pixits.ttcn new file mode 100644 index 0000000..5ae95ee --- /dev/null +++ b/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Pixits.ttcn @@ -0,0 +1,5 @@ +module RnisAPI_Pixits { + + modulepar universal charstring PX_SUBSCRIPTION_ID := "7777"; + +} // End of module RnisAPI_Pixits diff --git a/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Templates.ttcn b/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Templates.ttcn index c15326d..fdf6b48 100644 --- a/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Templates.ttcn +++ b/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Templates.ttcn @@ -1,10 +1,10 @@ -module RnisAPI_TypesAndValues { +module RnisAPI_Templates { // LibCommon import from LibCommon_BasicTypesAndValues all; // LibMec/RnisAPI - import from module RnisAPI_TypesAndValues all; + import from RnisAPI_TypesAndValues all; group subscriptions { @@ -17,7 +17,7 @@ module RnisAPI_TypesAndValues { in template (omit) TimeStamp p_expiryDeadline := omit ) := { callbackReference := p_callbackReference, - _links := p_links, + links := p_links, filterCriteria := p_filterCriteria, expiryDeadline := p_expiryDeadline } // End of template m_cell_change_subscription @@ -29,7 +29,7 @@ module RnisAPI_TypesAndValues { template TimeStamp p_expiryDeadline := * ) := { callbackReference := p_callbackReference, - _links := p_links, + links := p_links, filterCriteria := p_filterCriteria, expiryDeadline := p_expiryDeadline } // End of template mw_cell_change_subscription @@ -38,4 +38,4 @@ module RnisAPI_TypesAndValues { } // End of group subscriptions -} // End of module RnisAPI_TypesAndValues +} // End of module RnisAPI_Templates diff --git a/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_TypesAndValues.ttcn b/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_TypesAndValues.ttcn index 6fa49e8..0e5b93d 100644 --- a/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_TypesAndValues.ttcn @@ -37,8 +37,6 @@ module RnisAPI_TypesAndValues { Ecgi ecgi } - type unsiversal charstring AppInsId; - /** * @desc * @member timeStamp @@ -74,7 +72,7 @@ module RnisAPI_TypesAndValues { type record S1UeInfo { TempUeId tempUeId, AssociateId associateId optional, - Ecgi ecgi, + Ecgis ecgi, S1BearerInfoDetailed s1BearerInfoDetailed } @@ -84,11 +82,12 @@ module RnisAPI_TypesAndValues { * @member s1EnbInfo * @member sGwInfo */ - type record S1BearerInfoDetailed { + type record S1BearerInfoDetailed_ { ErabId erabId, S1EnbInfo s1EnbInfo, SGwInfo sGwInfo } + type record of S1BearerInfoDetailed_ S1BearerInfoDetailed; type UInt32 ErabId; @@ -159,12 +158,13 @@ module RnisAPI_TypesAndValues { /** * @desc E-UTRAN CelI Global Identifier as defined in 3GPP TS 36.413 * @member ecgi - * @member ueInfo + * @member cellId */ type record Ecgi { Plmn plmn, CellId cellId } + type record of Ecgi Ecgis; /** * @desc E-UTRAN CelI Global Identifier as defined in 3GPP TS 36.413 @@ -186,33 +186,35 @@ module RnisAPI_TypesAndValues { * @member associateId * @member erabInfo */ - type record UeInfo { - record of AssociateId associateId optional, - record of ErabQosParameters erabInfo + type record UeInfo_ { + AssociateId associateId optional, + ErabQosParameters erabInfo } + type record of UeInfo_ UeInfo; /** * @desc Information on UEs in the specific cell * @member type Numeric value (0-255) corresponding to specified type of identifier * @member value Value for the identifier */ - type record AssociateId { + type record AssociateId_ { AssociateId_type type_, UInt32 value_ } with { variant (type_) "name as 'type'"; variant (value_) "name as 'value'"; } + type record of AssociateId_ AssociateId; /** * @desc Numeric value (0-255) corresponding to specified type of identifier */ type enumerated AssociateId_type { - "RESERVED", - "UE_IPV4_ADDRESS", - "UE_IPV6_ADDRESS", - "NATED_IP_ADDRESS", - "GTP_TEID" + RESERVED, + UE_IPV4_ADDRESS, + UE_IPV6_ADDRESS, + NATED_IP_ADDRESS, + GTP_TEID } /** @@ -220,10 +222,16 @@ module RnisAPI_TypesAndValues { * @member qci QoS Class Identifier as defined in TS 23.401 * @member qci_information */ - type record ErabQosParameters { + type record ErabQosParameter { UInt32 qci, QosInformation qci_information } + type record of ErabQosParameter ErabQosParameters; + + /** + * @desc QoS Class Identifier as defined in TS 23.401 + */ + type UInt32 Qci; /** * @desc @@ -233,20 +241,22 @@ module RnisAPI_TypesAndValues { * @member erabMbrUl This IE indicates the guaranteed uplink E-RAB Bit Rate as defined in TS 23.401 for this bearer */ type enumerated QosInformation { - "erabGbrDl", - "erabGbrUl", - "erabMbrDl", - "erabMbrUl" + erabGbrDl, + erabGbrUl, + erabMbrDl, + erabMbrUl } /** * @desc - * @member _links + * @member links * @member subscription */ type record SubscriptionLinkList { - Link _links, - Subscription subscription optional { + Link links, + Subscription subscription optional + } with { + variant (links) "name as '_links'"; } /** @@ -264,15 +274,17 @@ module RnisAPI_TypesAndValues { /** * @desc * @member callbackReference - * @member _links + * @member links * @member filterCriteria * @member expiryDeadline */ type record MeasRepUeSubscription { CallbackReference callbackReference, - Link _links, + Link links, FilterCriteriaAssocTri filterCriteria, TimeStamp expiryDeadline optional + } with { + variant (links) "name as '_links'"; } /** @@ -292,61 +304,68 @@ module RnisAPI_TypesAndValues { /** * @desc * @member callbackReference - * @member _links + * @member links * @member s1BearerSubscriptionCriteria * @member expiryDeadline */ type record S1BearerSubscription { CallbackReference callbackReference, - Link _links, + Link links, S1BearerSubscriptionCriteria s1BearerSubscriptionCriteria, TimeStamp expiryDeadline optional + } with { + variant (links) "name as '_links'"; } /** * @desc * @member callbackReference - * @member _links + * @member links * @member filterCriteria */ type record RabEstSubscription { CallbackReference callbackReference, - Link _links, + Link links, FilterCriteriaAssocQci filterCriteria + } with { + variant (links) "name as '_links'"; } /** * @desc * @member callbackReference - * @member _links + * @member links * @member filterCriteria * @member expiryDeadline */ type record RabEstSubscriptionPost { CallbackReference callbackReference, - Link _links, + Link links, FilterCriteriaAssocQci filterCriteria, TimeStamp expiryDeadline optional + } with { + variant (links) "name as '_links'"; } /** * @desc * @member callbackReference - * @member _links + * @member links * @member filterCriteria * @member expiryDeadline */ type record RabModSubscription { CallbackReference callbackReference, - Link _links, + Link links, FilterCriteriaAssocQci filterCriteria, TimeStamp expiryDeadline optional + } with { + variant (links) "name as '_links'"; } /** * @desc * @member callbackReference - * @member _links * @member filterCriteria * @member expiryDeadline */ @@ -359,15 +378,17 @@ module RnisAPI_TypesAndValues { /** * @desc * @member callbackReference - * @member _links + * @member links * @member filterCriteria * @member expiryDeadline */ type record RabRelSubscription { CallbackReference callbackReference, - Link _links, + Link links, FilterCriteriaAssocQci filterCriteria, TimeStamp expiryDeadline optional + } with { + variant (links) "name as '_links'"; } /** @@ -385,15 +406,17 @@ module RnisAPI_TypesAndValues { /** * @desc * @member callbackReference - * @member _links + * @member links * @member filterCriteria * @member expiryDeadline */ type record CaReConfSubscription { CallbackReference callbackReference, - Link _links, + Link links, FilterCriteriaAssoc filterCriteria, TimeStamp expiryDeadline optional + } with { + variant (links) "name as '_links'"; } /** @@ -423,15 +446,17 @@ module RnisAPI_TypesAndValues { /** * @desc * @member callbackReference - * @member _links + * @member links * @member filterCriteria * @member expiryDeadline */ type record CellChangeSubscription { CallbackReference callbackReference, - Link _links, + Link links, FilterCriteriaAssocHo filterCriteria, TimeStamp expiryDeadline optional + } with { + variant (links) "name as '_links'"; } /** @@ -449,15 +474,17 @@ module RnisAPI_TypesAndValues { /** * @desc * @member callbackReference - * @member _links + * @member links * @member filterCriteria * @member expiryDeadline */ type record MeasTaSubscription { CallbackReference callbackReference, - Link _links, + Link links, FilterCriteriaAssocHo filterCriteria, TimeStamp expiryDeadline optional + } with { + variant (links) "name as '_links'"; } /** @@ -470,7 +497,7 @@ module RnisAPI_TypesAndValues { * @member self_ URI referring to a resource */ type record Link { - LinkType self_, + LinkType self_ } with { variant (self_) "name as 'self'"; } @@ -485,10 +512,11 @@ module RnisAPI_TypesAndValues { * @member * @member */ - type record Subscription { + type record Subscription_ { LinkType href, SubscriptionType subscriptionType } + type record of Subscription_ Subscription; /** * @desc Numeric value corresponding to specified type of subscription @@ -500,15 +528,15 @@ module RnisAPI_TypesAndValues { * @member */ type enumerated SubscriptionType { - "RESERVED", - "CELL_CHANGE", - "RAB_ESTABLISHMENT", - "RAB_MODIFICATION", - "RAB_RELEASE", - "MEAS_REPORT_UE", - "MEAS_TIMING_ADVANCE", - "CA_RECONF", - "S1_BEARE" + RESERVED, + CELL_CHANGE, + RAB_ESTABLISHMENT, + RAB_MODIFICATION, + RAB_RELEASE, + MEAS_REPORT_UE, + MEAS_TIMING_ADVANCE, + CA_RECONF, + S1_BEARE } /** @@ -565,7 +593,7 @@ module RnisAPI_TypesAndValues { * @member cellId * @member trigger */ - type record FilterCriteriaAssocHo { + type record FilterCriteriaAssocTri { AppInsId appInsId, AssociateId associateId, Plmn plmn, @@ -583,58 +611,56 @@ module RnisAPI_TypesAndValues { * @member cellId * @member trigger */ - type record FilterCriteriaAssocHo { + type record S1BearerSubscriptionCriteria { AssociateId associateId, Plmn plmn, CellId cellId, - Trigger trigger_ - } with { - variant (trigger_) "name as 'trigger'"; + ErabId erabId } /** * @desc Description of the subscribed to event */ type enumerated HoStatus { - "RESERVED", - "IN_PREPARATION", - "IN_EXECUTION", - "COMPLETED", - "REJECTED", - "CANCELLED" + RESERVED, + IN_PREPARATION, + IN_EXECUTION, + COMPLETED, + REJECTED, + CANCELLED } /** * @desc Description of the subscribed event */ type enumerated EventType { - "RESERVED", - "S1_BEARER_ESTABLISH", - "S1_BEARER_MODIFY", - "S1_BEARER_RELEASE" + RESERVED, + S1_BEARER_ESTABLISH, + S1_BEARER_MODIFY, + S1_BEARER_RELEASE } /** * @desc Unique identifier for the mobile edge application instance */ type enumerated Trigger { - "NOT_AVAILABLE", - "PERIODICAL_REPORT_STRONGEST_CELLS", - "PERIODICAL_REPORT_STRONGEST_CELLS_FOR_SON", - "PERIODICAL_REPORT_CGI", - "EVENT_A1", - "EVENT_A2", - "EVENT_A3", - "EVENT_A4", - "EVENT_A5", - "EVENT_A6", - "EVENT_B1", - "EVENT_B2", - "EVENT_C1", - "EVENT_C2", - "EVENT_W1", - "EVENT_W2", - "EVENT_W3" + NOT_AVAILABLE, + PERIODICAL_REPORT_STRONGEST_CELLS, + PERIODICAL_REPORT_STRONGEST_CELLS_FOR_SON, + PERIODICAL_REPORT_CGI, + EVENT_A1, + EVENT_A2, + EVENT_A3, + EVENT_A4, + EVENT_A5, + EVENT_A6, + EVENT_B1, + EVENT_B2, + EVENT_C1, + EVENT_C2, + EVENT_W1, + EVENT_W2, + EVENT_W3 } } with { diff --git a/ttcn/patch_lib_http/LibItsHttp_JsonMessageBodyTypes.ttcn b/ttcn/patch_lib_http/LibItsHttp_JsonMessageBodyTypes.ttcn index f9b8eae..d75cc1a 100644 --- a/ttcn/patch_lib_http/LibItsHttp_JsonMessageBodyTypes.ttcn +++ b/ttcn/patch_lib_http/LibItsHttp_JsonMessageBodyTypes.ttcn @@ -4,7 +4,9 @@ module LibItsHttp_JsonMessageBodyTypes { import from LocationAPI_TypesAndValues all; // LibMec/UEidentityAPI import from UEidentityAPI_TypesAndValues all; - + // LibMec/RnisAPI + import from RnisAPI_TypesAndValues all; + /** * This file volontary contains a trivial declaration of the type JsonBody. * In accordance with your TTCN-3 module LibItsHttp_JSONTypes, you have to change the JsonBody typing. @@ -13,13 +15,14 @@ module LibItsHttp_JsonMessageBodyTypes { type union JsonBody { // TODO Add here your custom variants - UserInfo userInfo, - UserList userList, - ZoneInfo zoneInfo, - ProblemDetails problemDetails, - UeIdentityTagInfo ueIdentityTagInfo, - CellChangeSubscription cellChangeSubscription, - universal charstring raw + UserInfo userInfo, + UserList userList, + ZoneInfo zoneInfo, + UEidentityAPI_TypesAndValues.ProblemDetails problemDetails_ue_identity, + UeIdentityTagInfo ueIdentityTagInfo, + CellChangeSubscription cellChangeSubscription, + RnisAPI_TypesAndValues.ProblemDetails problemDetails_rnis, + universal charstring raw } with { variant "" } diff --git a/ttcn/patch_lib_http/LibItsHttp_JsonTemplates.ttcn b/ttcn/patch_lib_http/LibItsHttp_JsonTemplates.ttcn index 22a39e5..41fd994 100644 --- a/ttcn/patch_lib_http/LibItsHttp_JsonTemplates.ttcn +++ b/ttcn/patch_lib_http/LibItsHttp_JsonTemplates.ttcn @@ -16,6 +16,9 @@ module LibItsHttp_JsonTemplates { // LibMec/UEidentityAPI import from UEidentityAPI_TypesAndValues all; import from UEidentityAPI_Templates all; + // LibMec/RnisAPI + import from RnisAPI_TypesAndValues all; + import from RnisAPI_Templates all; // TODO Add here your custom RFCs import @@ -90,15 +93,15 @@ module LibItsHttp_JsonTemplates { } // End of template mw_body_json_ue_identity_tag_info template (value) JsonBody m_body_json_ue_problem_details( - in template (value) ProblemDetails p_problemDetails + in template (value) UEidentityAPI_TypesAndValues.ProblemDetails p_problemDetails ) := { - problemDetails := p_problemDetails + problemDetails_ue_identity := p_problemDetails } // End of template m_body_json_ue_problem_details template (present) JsonBody mw_body_json_ue_problem_details( - template (present) ProblemDetails p_problemDetails := ? + template (present) UEidentityAPI_TypesAndValues.ProblemDetails p_problemDetails := ? ) := { - problemDetails := p_problemDetails + problemDetails_ue_identity := p_problemDetails } // End of template mw_body_json_ue_problem_details } // End of group ue_identity_api -- GitLab