From 50e5eb569683cabda1bceb7ad9cc4a75824a833c Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Tue, 28 May 2019 03:16:14 -0700 Subject: [PATCH] Completed first Rnis test --- ccsrc/Protocols/Json/json_codec.cc | 5 + .../{AtsMec_LocationAPI.cfg => AtsMec.cfg} | 11 +-- ttcn/AtsMec/AtsMec_LocationAPI_TestCases.ttcn | 6 +- ...AtsMec_RadioNodeLocationAPI_TestCases.ttcn | 6 +- ttcn/AtsMec/AtsMec_RnisAPI_TestCases.ttcn | 17 ++-- ttcn/AtsMec/AtsMec_TestControl.ttcn | 4 +- ttcn/AtsMec/AtsMec_UEdistance_TestCases.ttcn | 6 +- .../AtsMec_UEidentityAPI_TestCases.ttcn | 18 ++-- .../AtsMec_UEinformation_TestCases.ttcn | 6 +- .../ttcn/LocationAPI_Templates.ttcn | 13 ++- .../ttcn/LocationAPI_TypesAndValues.ttcn | 28 +++--- ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Pics.ttcn | 2 - ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Pixits.ttcn | 10 +- .../RnisAPI/ttcn/RnisAPI_Templates.ttcn | 22 ++++- .../RnisAPI/ttcn/RnisAPI_TypesAndValues.ttcn | 35 +++---- .../ttcn/UEidentityAPI_Templates.ttcn | 19 ++-- .../ttcn/UEidentityAPI_TypesAndValues.ttcn | 15 +-- ttcn/LibMec/ttcn/JSON.ttcn | 91 +++++++++++++++++-- ttcn/LibMec/ttcn/LibMec_Pics.ttcn | 28 ++++-- ttcn/LibMec/ttcn/LibMec_Pixits.ttcn | 10 ++ .../LibItsHttp_JsonMessageBodyTypes.ttcn | 1 + .../LibItsHttp_JsonTemplates.ttcn | 12 +++ 22 files changed, 260 insertions(+), 105 deletions(-) rename etc/AtsMec/{AtsMec_LocationAPI.cfg => AtsMec.cfg} (89%) diff --git a/ccsrc/Protocols/Json/json_codec.cc b/ccsrc/Protocols/Json/json_codec.cc index e8c0e4f..7960cf2 100644 --- a/ccsrc/Protocols/Json/json_codec.cc +++ b/ccsrc/Protocols/Json/json_codec.cc @@ -64,6 +64,11 @@ int json_codec::decode (const OCTETSTRING& p_data, LibItsHttp__JsonMessageBodyTy LocationAPI__TypesAndValues::AccessPointList access_point_list; access_point_list.decode(LocationAPI__TypesAndValues::AccessPointList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.accessPointList() = access_point_list; + } else if (it->second.find("\"SubscriptionLinkList\"") != std::string::npos) { // Be carefull to the order + // TODO To be refined, find("\"accessPointList\"") is not optimal + RnisAPI__TypesAndValues::SubscriptionLinkList subscription_link_list; + subscription_link_list.decode(RnisAPI__TypesAndValues::SubscriptionLinkList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.subscriptionLinkList() = subscription_link_list; } else if (it->second.find("\"userInfo\"") != std::string::npos) { LocationAPI__TypesAndValues::UserInfo user_info; user_info.decode(LocationAPI__TypesAndValues::UserInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); diff --git a/etc/AtsMec/AtsMec_LocationAPI.cfg b/etc/AtsMec/AtsMec.cfg similarity index 89% rename from etc/AtsMec/AtsMec_LocationAPI.cfg rename to etc/AtsMec/AtsMec.cfg index 8c7d9a3..e36d99e 100644 --- a/etc/AtsMec/AtsMec_LocationAPI.cfg +++ b/etc/AtsMec/AtsMec.cfg @@ -7,14 +7,13 @@ LibCommon_Time.PX_TAC := 30.0 LibCommon_Sync.PX_TSYNC_TIME_LIMIT := 30.0; LibCommon_Sync.PX_TSHUT_DOWN_TIME_LIMIT := 30.0; -#LibItsHttp_Pics.PICS_HEADER_HOST := "192.168.1.140" -LibItsHttp_Pics.PICS_HEADER_HOST := "172.16.3.114" -#LibItsHttp_Pics.PICS_HEADER_HOST := "172.28.4.87" +LibItsHttp_Pics.PICS_HEADER_HOST := "172.28.4.87" +#LibItsHttp_Pics.PICS_HEADER_HOST := "192.168.1.21" LibItsHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json" -LibMec_Pics.PICS_PLAT_IUT := true -LibMec_Pics.PICS_RNIS_IUT := false +LibMec_Pics.PICS_MEC_PLAT := true +LibMec_Pics.PICS_RNIS := true [LOGGING] # In this section you can specify the name of the log file and the classes of events @@ -32,7 +31,7 @@ LogEventTypes:= Yes [TESTPORT_PARAMETERS] # In this section you can specify parameters that are passed to Test Ports. -system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=172.16.3.114,port=8081,use_ssl=0)" +system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=172.28.4.87,port=8081,use_ssl=0)" [DEFINE] # In this section you can create macro definitions, diff --git a/ttcn/AtsMec/AtsMec_LocationAPI_TestCases.ttcn b/ttcn/AtsMec/AtsMec_LocationAPI_TestCases.ttcn index d157c5a..009da1e 100644 --- a/ttcn/AtsMec/AtsMec_LocationAPI_TestCases.ttcn +++ b/ttcn/AtsMec/AtsMec_LocationAPI_TestCases.ttcn @@ -47,8 +47,8 @@ module AtsMec_LocationAPI_TestCases { var HttpMessage v_response; // Test control - if (not(PICS_PLAT_IUT) or not(PICS_LOCATION_API_SUPPORTED)) { - log("*** " & testcasename() & ": PICS_PLAT_IUT and PICS_LOCATION_API_SUPPORTED required for executing the TC ***"); + if (not(PICS_MEC_PLAT) or not(PICS_LOCATION_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_LOCATION_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } @@ -63,7 +63,7 @@ module AtsMec_LocationAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ME_APP_Q_USERS_LIST_URI & "?zoneId=" & oct2char(unichar2oct(PX_ZONE_ID, "UTF-8")), + PX_ME_APP_Q_USERS_LIST_URI & "?zoneId=" & oct2char(unichar2oct(PX_ZONE_ID, "UTF-8")), v_headers ) ) diff --git a/ttcn/AtsMec/AtsMec_RadioNodeLocationAPI_TestCases.ttcn b/ttcn/AtsMec/AtsMec_RadioNodeLocationAPI_TestCases.ttcn index 68a14aa..da3c238 100644 --- a/ttcn/AtsMec/AtsMec_RadioNodeLocationAPI_TestCases.ttcn +++ b/ttcn/AtsMec/AtsMec_RadioNodeLocationAPI_TestCases.ttcn @@ -47,8 +47,8 @@ module AtsMec_RadioNodeLocationAPI_TestCases { var HttpMessage v_response; // Test control - if (not(PICS_PLAT_IUT) or not(PICS_LOCATION_API_SUPPORTED)) { - log("*** " & testcasename() & ": PICS_PLAT_IUT and PICS_LOCATION_API_SUPPORTED required for executing the TC ***"); + if (not(PICS_MEC_PLAT) or not(PICS_LOCATION_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_LOCATION_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } @@ -63,7 +63,7 @@ module AtsMec_RadioNodeLocationAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ME_APP_Q_ZONE_ID_URI & "/" & oct2char(unichar2oct(PX_ZONE_ID, "UTF-8")) & "/accessPoints", + PX_ME_APP_Q_ZONE_ID_URI & "/" & oct2char(unichar2oct(PX_ZONE_ID, "UTF-8")) & "/accessPoints", v_headers ) ) diff --git a/ttcn/AtsMec/AtsMec_RnisAPI_TestCases.ttcn b/ttcn/AtsMec/AtsMec_RnisAPI_TestCases.ttcn index fc7ef55..a491cca 100644 --- a/ttcn/AtsMec/AtsMec_RnisAPI_TestCases.ttcn +++ b/ttcn/AtsMec/AtsMec_RnisAPI_TestCases.ttcn @@ -38,7 +38,8 @@ 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 + * @see https://forge.etsi.org/gitlab/mec/MEC-tests/blob/master/Test%20Purposes/App/Mp1/Rnis/RnisAllSubscriptions_BV.tplan2 + * @see */ testcase TC_MEC025_RNIS_SUBSCRIPTION_005() runs on HttpComponent system HttpTestAdapter { // Local variables @@ -46,8 +47,8 @@ module AtsMec_RnisAPI_TestCases { var HttpMessage v_response; // Test control - if (not(PICS_RNIS_IUT) or not(PICS_RNIS_ALL_SUBSCRIPTIONS)) { - log("*** " & testcasename() & ": PICS_RNIS_IUT and PICS_RNIS_ALL_SUBSCRIPTIONS required for executing the TC ***"); + if (not(PICS_RNIS) or not(PICS_RNIS_ALL_SUBSCRIPTIONS)) { + log("*** " & testcasename() & ": PICS_RNIS and PICS_RNIS_ALL_SUBSCRIPTIONS required for executing the TC ***"); setverdict(inconc); stop; } @@ -62,7 +63,7 @@ module AtsMec_RnisAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_RNIS_SUBSCRITIONS_URI & oct2char(unichar2oct(PX_SUBSCRIPTION_ID, "UTF-8")), + PX_RNIS_SUBSCRITIONS_URI, v_headers ) ) @@ -76,9 +77,11 @@ module AtsMec_RnisAPI_TestCases { mw_http_response( mw_http_response_ok( mw_http_message_body_json( - mw_body_json_cell_change_subscription( - mw_cell_change_subscription - ))))) -> value v_response { + mw_body_json_subscriptions_list( + mw_subscriptions_list( + PX_LINKS_SELF, + ? + )))))) -> value v_response { log("*** " & testcasename() & ": PASS: IUT successfully responds with a cell subscription ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } diff --git a/ttcn/AtsMec/AtsMec_TestControl.ttcn b/ttcn/AtsMec/AtsMec_TestControl.ttcn index 9d52184..100e6af 100644 --- a/ttcn/AtsMec/AtsMec_TestControl.ttcn +++ b/ttcn/AtsMec/AtsMec_TestControl.ttcn @@ -19,7 +19,7 @@ module AtsMec_TestControl { control { - if (PICS_PLAT_IUT) { + if (PICS_MEC_PLAT) { if (PICS_LOCATION_API_SUPPORTED) { execute(TC_MEC_PLAT_MP1_LOC_BV_001()); } @@ -36,7 +36,7 @@ module AtsMec_TestControl { } } - if (PICS_RNIS_IUT) { + if (PICS_RNIS) { if (PICS_RNIS_ALL_SUBSCRIPTIONS) { execute(TC_MEC025_RNIS_SUBSCRIPTION_005()); } diff --git a/ttcn/AtsMec/AtsMec_UEdistance_TestCases.ttcn b/ttcn/AtsMec/AtsMec_UEdistance_TestCases.ttcn index 052c6b0..e15e61e 100644 --- a/ttcn/AtsMec/AtsMec_UEdistance_TestCases.ttcn +++ b/ttcn/AtsMec/AtsMec_UEdistance_TestCases.ttcn @@ -46,8 +46,8 @@ module AtsMec_UEdistance_TestCases { var HttpMessage v_response; // Test control - if (not(PICS_PLAT_IUT) or not(PICS_LOCATION_API_SUPPORTED)) { - log("*** " & testcasename() & ": PICS_PLAT_IUT and PICS_LOCATION_API_SUPPORTED required for executing the TC ***"); + if (not(PICS_MEC_PLAT) or not(PICS_LOCATION_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_LOCATION_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } @@ -62,7 +62,7 @@ module AtsMec_UEdistance_TestCases { httpPort.send( m_http_request( m_http_request_post( - PICS_ME_APP_Q_DIST_URI, + PX_ME_APP_Q_DIST_URI, v_headers ) ) diff --git a/ttcn/AtsMec/AtsMec_UEidentityAPI_TestCases.ttcn b/ttcn/AtsMec/AtsMec_UEidentityAPI_TestCases.ttcn index 30ea8b9..8a3f5d4 100644 --- a/ttcn/AtsMec/AtsMec_UEidentityAPI_TestCases.ttcn +++ b/ttcn/AtsMec/AtsMec_UEidentityAPI_TestCases.ttcn @@ -46,8 +46,8 @@ module AtsMec_UEidentityAPI_TestCases { var HttpMessage v_response; // Test control - if (not(PICS_PLAT_IUT) or not(PICS_UE_IDENTITY_API_SUPPORTED)) { - log("*** " & testcasename() & ": PICS_PLAT_IUT and PICS_LOCATION_API_SUPPORTED required for executing the TC ***"); + 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; } @@ -62,7 +62,7 @@ module AtsMec_UEidentityAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_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, "UTF-8")), + 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, "UTF-8")), v_headers ) ) @@ -104,8 +104,8 @@ module AtsMec_UEidentityAPI_TestCases { var HttpMessage v_response; // Test control - if (not(PICS_PLAT_IUT) or not(PICS_UE_IDENTITY_API_SUPPORTED)) { - log("*** " & testcasename() & ": PICS_PLAT_IUT and PICS_LOCATION_API_SUPPORTED required for executing the TC ***"); + 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; } @@ -120,7 +120,7 @@ module AtsMec_UEidentityAPI_TestCases { httpPort.send( m_http_request( m_http_request_post( - PICS_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info", + PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info", v_headers, m_http_message_body_json( m_body_json_ue_identity_tag_info( @@ -173,8 +173,8 @@ module AtsMec_UEidentityAPI_TestCases { var HttpMessage v_response; // Test control - if (not(PICS_PLAT_IUT) or not(PICS_UE_IDENTITY_API_SUPPORTED)) { - log("*** " & testcasename() & ": PICS_PLAT_IUT and PICS_LOCATION_API_SUPPORTED required for executing the TC ***"); + 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; } @@ -189,7 +189,7 @@ module AtsMec_UEidentityAPI_TestCases { httpPort.send( m_http_request( m_http_request_post( - PICS_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info", + PX_ME_APP_Q_UE_IDENTITY_ID_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/ue_identity_tag_info", v_headers, m_http_message_body_json( m_body_json_ue_identity_tag_info( diff --git a/ttcn/AtsMec/AtsMec_UEinformation_TestCases.ttcn b/ttcn/AtsMec/AtsMec_UEinformation_TestCases.ttcn index ab81821..150cafa 100644 --- a/ttcn/AtsMec/AtsMec_UEinformation_TestCases.ttcn +++ b/ttcn/AtsMec/AtsMec_UEinformation_TestCases.ttcn @@ -47,8 +47,8 @@ module AtsMec_UEinformation_TestCases { var HttpMessage v_response; // Test control - if (not(PICS_PLAT_IUT) or not(PICS_LOCATION_API_SUPPORTED)) { - log("*** " & testcasename() & ": PICS_PLAT_IUT and PICS_LOCATION_API_SUPPORTED required for executing the TC ***"); + if (not(PICS_MEC_PLAT) or not(PICS_LOCATION_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_LOCATION_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } @@ -63,7 +63,7 @@ module AtsMec_UEinformation_TestCases { httpPort.send( m_http_request( m_http_request_get( - PICS_ME_APP_Q_USERS_LIST_URI, + PX_ME_APP_Q_USERS_LIST_URI, v_headers ) ) diff --git a/ttcn/LibMec/LocationAPI/ttcn/LocationAPI_Templates.ttcn b/ttcn/LibMec/LocationAPI/ttcn/LocationAPI_Templates.ttcn index 956c9b6..9a0fd08 100644 --- a/ttcn/LibMec/LocationAPI/ttcn/LocationAPI_Templates.ttcn +++ b/ttcn/LibMec/LocationAPI/ttcn/LocationAPI_Templates.ttcn @@ -1,5 +1,8 @@ module LocationAPI_Templates { + // JSON + import from JSON all; + // LibCommon import from LibCommon_BasicTypesAndValues all; @@ -26,7 +29,7 @@ module LocationAPI_Templates { template (present) Address p_address := ?, template (present) AccessPointId p_access_point_id := ?, template (present) ZoneId p_zone_id := ?, - template (present) universal charstring p_resource_url := ? + template (present) ResourceURL p_resource_url := ? ) := { address_ := p_address, accessPointId := p_access_point_id, @@ -54,8 +57,8 @@ module LocationAPI_Templates { } // End of template mw_user_list template (value) LocationInfo m_location_info( - in float p_latitude, - in float p_longitude, + in JSON.Number p_latitude, + in JSON.Number p_longitude, in UInt32 p_accuracy ) := { latitude := p_latitude, @@ -65,8 +68,8 @@ module LocationAPI_Templates { } // End of template m_location_info template (present) LocationInfo mw_location_info( - template (present) float p_latitude := ?, - template (present) float p_longitude := ?, + template (present) JSON.Number p_latitude := ?, + template (present) JSON.Number p_longitude := ?, template (present) UInt32 p_accuracy := ? ) := { latitude := p_latitude, diff --git a/ttcn/LibMec/LocationAPI/ttcn/LocationAPI_TypesAndValues.ttcn b/ttcn/LibMec/LocationAPI/ttcn/LocationAPI_TypesAndValues.ttcn index 5f1c22b..3467c8d 100644 --- a/ttcn/LibMec/LocationAPI/ttcn/LocationAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/LocationAPI/ttcn/LocationAPI_TypesAndValues.ttcn @@ -71,7 +71,7 @@ module LocationAPI_TypesAndValues { /** * @desc Identifier of access point, (reference ETSI TS 129 171). Where the E-CGI is made up of the PLMN and Cell Identity (28 bit string). Then the PLMN is made up of the 3 digit MCC & 2 or 3 digit MNC. The Cell Portion is an optional element */ - type universal charstring AccessPointId; + type JSON.String AccessPointId; /** * @desc A type containing access point information. @@ -107,12 +107,12 @@ module LocationAPI_TypesAndValues { /** * @desc Address of user (e.g. \"sip\" URI, \"tel\" URI, \"acr\" URI). */ - type universal charstring Address + type JSON.String Address /** * @desc Reserved for future use. */ - type universal charstring AncillaryInfo; + type JSON.String AncillaryInfo; /** * @desc CallBackData if passed by the application during the associated ZonalTrafficSubscription and UserTrackingSubscription operation. See [\ @@ -131,7 +131,7 @@ REST_NetAPI_Common]. /** * @desc Uniquely identifies this create subscription request. If there is a communication failure during the request, using the same clientCorrelator when retrying the request allows the operator to avoid creating a duplicate subscription. */ - type universal charstring ClientCorrelator; + type JSON.String ClientCorrelator; /** * @desc The connection type for the access point @@ -152,12 +152,12 @@ REST_NetAPI_Common]. /** * @desc Contextual information of a user location (e.g., aisle, floor, room number, etc.) */ - type universal charstring ContextLocationInfo; + type JSON.String ContextLocationInfo; /** * @desc Zone ID */ - type universal charstring CurrentAccessPointId; + type JSON.String CurrentAccessPointId; /** * @desc Period (in seconds) of time notifications are provided for. If set to \"0\" (zero), a default duration time, which is specified by the service policy, will be used. If the parameter is omitted, the notifications will continue until the maximum duration time, which is specified by the service policy, unless the notifications are stopped by deletion of subscription for notifications. This element MAY be given by the client during resource creation in order to signal the desired lifetime of the subscription. The server MUST return in this element the period of time for which the subscription will still be valid. @@ -175,14 +175,14 @@ REST_NetAPI_Common]. * @member href UTI */ type record Link { - universal charstring rel, - universal charstring href + JSON.String rel, + JSON.String href } /** * @desc The URL of your own listener application. */ - type universal charstring NotifyURL; + type JSON.String NotifyURL; /** * @desc The number of access points within the zone @@ -231,22 +231,22 @@ REST_NetAPI_Common]. /** * @desc Zone ID */ - type universal charstring PreviousAccessPointId; + type JSON.String PreviousAccessPointId; /** * @desc Self referring URL */ - type universal charstring ResourceURL; + type JSON.AnyURI ResourceURL; /** * @desc Indicates the time of day for zonal presence notification. */ - type universal charstring Timestamp; + type JSON.String Timestamp; /** * @desc Time zone of access point */ - type universal charstring Timezone; + type JSON.String Timezone; /** * @desc User event @@ -338,7 +338,7 @@ REST_NetAPI_Common]. /** * @desc Identifier of zone */ - type universal charstring ZoneId; + type JSON.String ZoneId; /** * @desc A type containing zone status notification. diff --git a/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Pics.ttcn b/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Pics.ttcn index 1274902..453dd18 100644 --- a/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Pics.ttcn +++ b/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Pics.ttcn @@ -5,6 +5,4 @@ module RnisAPI_Pics { */ modulepar boolean PICS_RNIS_ALL_SUBSCRIPTIONS := true; - modulepar charstring PICS_RNIS_SUBSCRITIONS_URI := "/rni/v2/subscriptions/"; - } // End of module RnisAPI_Pics diff --git a/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Pixits.ttcn b/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Pixits.ttcn index 5ae95ee..551180b 100644 --- a/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Pixits.ttcn +++ b/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Pixits.ttcn @@ -1,5 +1,13 @@ module RnisAPI_Pixits { + + // JSON + import from JSON all; + + // LibMec/Rnis + import from RnisAPI_TypesAndValues all; - modulepar universal charstring PX_SUBSCRIPTION_ID := "7777"; + modulepar JSON.String PX_SUBSCRIPTION_ID := "7777"; + + modulepar Link PX_LINKS_SELF := { self_ := "http://meAppServer.example.com/rni/v1/subscriptions" }; } // End of module RnisAPI_Pixits diff --git a/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Templates.ttcn b/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Templates.ttcn index fdf6b48..16ef757 100644 --- a/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Templates.ttcn +++ b/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Templates.ttcn @@ -1,5 +1,8 @@ module RnisAPI_Templates { + // JSON + import from JSON all; + // LibCommon import from LibCommon_BasicTypesAndValues all; @@ -7,7 +10,24 @@ module RnisAPI_Templates { import from RnisAPI_TypesAndValues all; group subscriptions { - + + template (omit) SubscriptionLinkList m_subscriptions_list( + in Link p_links, + in template (omit) Subscription p_subscription := omit + ) := { + links := p_links, + subscription := p_subscription + } // End of template m_subscriptions_list + + + template SubscriptionLinkList mw_subscriptions_list( + template (present) Link p_links := ?, + template Subscription p_subscription := * + ) := { + links := p_links, + subscription := p_subscription + } // End of template mw_subscriptions_list + group cell { template (omit) CellChangeSubscription m_cell_change_subscription( diff --git a/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_TypesAndValues.ttcn b/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_TypesAndValues.ttcn index 0e5b93d..e52586b 100644 --- a/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_TypesAndValues.ttcn @@ -4,6 +4,9 @@ */ module RnisAPI_TypesAndValues { + // JSON + import from JSON all; + // LibCommon import from LibCommon_BasicTypesAndValues all; @@ -16,11 +19,11 @@ module RnisAPI_TypesAndValues { * @member instance A URI reference that identifies the specific occurrence of the problem */ type record ProblemDetails { - universal charstring type_, - universal charstring title, + JSON.String type_, + JSON.String title, UInt32 status, - universal charstring detail, - universal charstring instance + JSON.String detail, + JSON.String instance } with { variant (type_) "name as 'type'"; } @@ -101,9 +104,9 @@ module RnisAPI_TypesAndValues { Mtmsi mtmsi } - type universal charstring Mmec; + type JSON.String Mmec; - type universal charstring Mtmsi; + type JSON.String Mtmsi; /** * @desc @@ -111,8 +114,8 @@ module RnisAPI_TypesAndValues { * @member tunnelId eNB GTP-U TEID of this S1 bearer */ type record S1EnbInfo { - universal charstring ipAddress, - universal charstring tunnelId + JSON.String ipAddress, + JSON.String tunnelId } /** @@ -121,8 +124,8 @@ module RnisAPI_TypesAndValues { * @member tunnelId SGW GTP-U TEID of this S1 bearer */ type record SGwInfo { - universal charstring ipAddress, - universal charstring tunnelId + JSON.String ipAddress, + JSON.String tunnelId } /** @@ -138,12 +141,12 @@ module RnisAPI_TypesAndValues { /** * @desc Unique identifier for the mobile edge application instance", */ - type universal charstring AppInsId; + type JSON.String AppInsId; /** * @desc Unique identifier allocated by the Mobile Edge application for the Information request */ - type universal charstring RequestId; + type JSON.String RequestId; /** * @desc The information on users per cell @@ -172,8 +175,8 @@ module RnisAPI_TypesAndValues { * @member mnc The Mobile Network Code part of PLMN Identity as defined in 3GPP TS 36.413 */ type record Plmn { - universal charstring mcc, - universal charstring mnc + JSON.String mcc, + JSON.String mnc } /** @@ -490,7 +493,7 @@ module RnisAPI_TypesAndValues { /** * @desc URL selected by the Mobile Edge application to receive notifications on the subscribed RNIS information */ - type universal charstring CallbackReference; + type JSON.String CallbackReference; /** * @desc List of hyperlinks related to the resource @@ -505,7 +508,7 @@ module RnisAPI_TypesAndValues { /** * @desc URI referring to a resource */ - type universal charstring LinkType; + type JSON.AnyURI LinkType; /** * @desc A link to a subscription diff --git a/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_Templates.ttcn b/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_Templates.ttcn index 342c6a3..e35023e 100644 --- a/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_Templates.ttcn +++ b/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_Templates.ttcn @@ -1,5 +1,8 @@ module UEidentityAPI_Templates { + // JSON + import from JSON all; + // LibCommon import from LibCommon_BasicTypesAndValues all; @@ -7,11 +10,11 @@ module UEidentityAPI_Templates { import from UEidentityAPI_TypesAndValues all; template (value) ProblemDetails m_problem_details( - in universal charstring p_type, - in universal charstring p_title, + in JSON.String p_type, + in JSON.String p_title, in UInt32 p_status, - in universal charstring p_detail, - in universal charstring p_instance + in JSON.String p_detail, + in JSON.String p_instance ) := { type_ := p_type, title := p_title, @@ -21,11 +24,11 @@ module UEidentityAPI_Templates { } // End of template m_problem_details template (present) ProblemDetails mw_problem_details( - template (present) universal charstring p_type := ?, - template (present) universal charstring p_title := ?, + template (present) JSON.String p_type := ?, + template (present) JSON.String p_title := ?, template (present) UInt32 p_status := ?, - template (present) universal charstring p_detail := ?, - template (present) universal charstring p_instance := ? + template (present) JSON.String p_detail := ?, + template (present) JSON.String p_instance := ? ) := { type_ := p_type, title := p_title, diff --git a/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_TypesAndValues.ttcn b/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_TypesAndValues.ttcn index 3bf7516..316a845 100644 --- a/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/UEidentityAPI/ttcn/UEidentityAPI_TypesAndValues.ttcn @@ -1,5 +1,8 @@ module UEidentityAPI_TypesAndValues { + // JSON + import from JSON all; + // LibCommon import from LibCommon_BasicTypesAndValues all; @@ -12,11 +15,11 @@ module UEidentityAPI_TypesAndValues { * @member instance A URI reference that identifies the specific occurrence of the problem */ type record ProblemDetails { - universal charstring type_, - universal charstring title, + JSON.String type_, + JSON.String title, UInt32 status, - universal charstring detail, - universal charstring instance + JSON.String detail, + JSON.String instance } with { variant (type_) "name as 'type'"; } @@ -32,7 +35,7 @@ module UEidentityAPI_TypesAndValues { /** * @desc Specific tag presented by a ME Application instance to a ME Platform */ - type universal charstring UeIdentityTag; + type JSON.String UeIdentityTag; /** * @desc Status of the resource ueIdentityTagInfo @@ -48,7 +51,7 @@ module UEidentityAPI_TypesAndValues { * @member state Status of the resource ueIdentityTagInfo */ type record UeIdentityTagItem { - universal charstring ueIdentityTag, + JSON.String ueIdentityTag, State state } diff --git a/ttcn/LibMec/ttcn/JSON.ttcn b/ttcn/LibMec/ttcn/JSON.ttcn index ec483fc..fe3942c 100644 --- a/ttcn/LibMec/ttcn/JSON.ttcn +++ b/ttcn/LibMec/ttcn/JSON.ttcn @@ -1,20 +1,95 @@ module JSON { + // These constants are used in the JSON date/time type definitions + const charstring + dash := "-", + cln := ":", + year := "[0-9]#4", + yearExpansion := "(-([1-9][0-9]#(0,))#(,1))#(,1)", + month := "(0[1-9]|1[0-2])", + dayOfMonth := "(0[1-9]|[12][0-9]|3[01])", + hour := "([01][0-9]|2[0-3])", + minute := "([0-5][0-9])", + second := "([0-5][0-9])", + sFraction := "(.[0-9]#(1,))#(,1)", + endOfDayExt := "24:00:00(.0#(1,))#(,1)", + nums := "[0-9]#(1,)", + ZorTimeZoneExt := "(Z|[+-]((0[0-9]|1[0-3]):[0-5][0-9]|14:00))#(,1)", + durTime := "(T[0-9]#(1,)"& + "(H([0-9]#(1,)(M([0-9]#(1,)(S|.[0-9]#(1,)S))#(,1)|.[0-9]#(1,)S|S))#(,1)|"& + "M([0-9]#(1,)(S|.[0-9]#(1,)S)|.[0-9]#(1,)M)#(,1)|"& + "S|"& + ".[0-9]#(1,)S))"; + type universal charstring utf8string; + type utf8string JSONCompatibleString + ( + char(0,0,0,9)..char(0,0,0,9), + char(0,0,0,10)..char(0,0,0,10), + char(0,0,0,13)..char(0,0,0,13), + char(0,0,0,32)..char(0,0,215,255), + char(0,0,224,0)..char(0,0,255,253), + char(0,1,0,0)..char(0,16,255,253) + ); + type utf8string JSONStringWithNoWhitespace + ( + char(0,0,0,33)..char(0,0,215,255), + char(0,0,224,0)..char(0,0,255,253), + char(0,1,0,0)..char(0,16,255,253) + ); + type utf8string JSONStringWithNoCRLFHT + ( + char(0,0,0,32)..char(0,0,215,255), + char(0,0,224,0)..char(0,0,255,253), + char(0,1,0,0)..char(0,16,255,253) + ); + // JSON Number type (generic) type float Number (!-infinity .. !infinity) /*with { variant "JSON:number" - }*/ + }*/; // Integer type type integer Integer (-infinity .. infinity) /*with { variant "JSON:integer" - }*/ + }*/; // String type - type universal charstring String /*with { + type utf8string String /*with { variant "JSON:string" - }*/ - type universal charstring Date /*with { - variant "JSON:date" - }*/ + }*/; + type JSONStringWithNoCRLFHT NormalizedString /*with { + variant "JSON:normalizedString"; + }*/; + type JSONStringWithNoWhitespace Name /*with { + variant "JSON:Name"; + }*/; + type Name NCName /*with { + variant "JSON:NCName"; + }*/; + type NormalizedString Token /*with { + variant "JSON:token"; + }*/; + type JSONStringWithNoCRLFHT AnyURI /*with { + variant "JSON:anyURI"; + }*/; + type charstring Duration (pattern + "{dash}#(,1)P({nums}(Y({nums}(M({nums}D{durTime}#(,1)|{durTime}#(,1))|D{durTime}#(,1))|" & + "{durTime}#(,1))|M({nums}D{durTime}#(,1)|{durTime}#(,1))|D{durTime}#(,1))|{durTime})") + /*with { + variant "JSON:duration"; + }*/; + type charstring DateTime (pattern + "{yearExpansion}{year}{dash}{month}{dash}{dayOfMonth}T({hour}{cln}{minute}{cln}{second}" & + "{sFraction}|{endOfDayExt}){ZorTimeZoneExt}" ) + /*with { + variant "JSON:dateTime"; + }*/; + type charstring Time (pattern "({hour}{cln}{minute}{cln}{second}{sFraction}|{endOfDayExt}){ZorTimeZoneExt}" ) + /*with { + variant "JSON:time"; + }*/; + type charstring Date (pattern "{yearExpansion}{year}{dash}{month}{dash}{dayOfMonth}{ZorTimeZoneExt}" ) + /*with { + variant "JSON:date"; + }*/; // Array type /*type record of JSON.Values Array with { variant "JSON:array" @@ -71,4 +146,6 @@ module JSON { //When only the null literal is allowed type enumerated Null { null_ }; /*with { variant "JSON:literal" }*/ +} with { + encode "JSON" } // End of module JSON diff --git a/ttcn/LibMec/ttcn/LibMec_Pics.ttcn b/ttcn/LibMec/ttcn/LibMec_Pics.ttcn index f15fb43..8118796 100644 --- a/ttcn/LibMec/ttcn/LibMec_Pics.ttcn +++ b/ttcn/LibMec/ttcn/LibMec_Pics.ttcn @@ -2,22 +2,32 @@ module LibMec_Pics { /** * @desc Does the IUT act as Edge Mobile Application? - * TODO Renane into PIC_MEC_PLAT */ - modulepar boolean PICS_PLAT_IUT := false; + modulepar boolean PICS_MEC_PLAT := false; /** * @desc Does the IUT act as Edge Mobile Application? - * TODO Renane into PIC_RNIS */ - modulepar boolean PICS_RNIS_IUT := false; + modulepar boolean PICS_RNIS := false; - modulepar charstring PICS_ME_APP_Q_ZONE_ID_URI := "/exampleAPI/location/v2/zones"; + modulepar boolean PIC_MEC_SYSTEM := false; - modulepar charstring PICS_ME_APP_Q_USERS_LIST_URI := "/exampleAPI/location/v2/users"; - - modulepar charstring PICS_ME_APP_Q_DIST_URI := "/exampleAPI/location/v2/subscriptions/distance"; + modulepar boolean PIC_SERVICES := false; - modulepar charstring PICS_ME_APP_Q_UE_IDENTITY_ID_URI := "/exampleAPI/ui/v2/"; + modulepar boolean PIC_NOTIFICATIONS := false; + + modulepar boolean PIC_APP_PACKAGE := false; + + modulepar boolean PIC_APP_PACKAGE_MANAGEMENT := false; + + modulepar boolean PIC_APP_PACKAGE_NOTIFICATIONS := false; + + modulepar boolean PIC_RNIS_QUERY := false; + + modulepar boolean PIC_RNIS_ALL_SUBSCRIPTIONS := false; + + modulepar boolean PIC_RNIS_SPECIFIC_SUBSCRIPTION := false; + + modulepar boolean PIC_RNIS_NOTIFICATIONS := false; } // End of module LibMec_Pics diff --git a/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn b/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn index 4703730..f48fb8c 100644 --- a/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn +++ b/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn @@ -1,3 +1,13 @@ module LibMec_Pixits { + modulepar charstring PX_ME_APP_Q_ZONE_ID_URI := "/exampleAPI/location/v2/zones"; + + modulepar charstring PX_ME_APP_Q_USERS_LIST_URI := "/exampleAPI/location/v2/users"; + + modulepar charstring PX_ME_APP_Q_DIST_URI := "/exampleAPI/location/v2/subscriptions/distance"; + + modulepar charstring PX_ME_APP_Q_UE_IDENTITY_ID_URI := "/exampleAPI/ui/v2/"; + + modulepar charstring PX_RNIS_SUBSCRITIONS_URI := "/exampleAPI/rni/v2/subscriptions/"; + } // End of module LibMec_Pixits diff --git a/ttcn/patch_lib_http/LibItsHttp_JsonMessageBodyTypes.ttcn b/ttcn/patch_lib_http/LibItsHttp_JsonMessageBodyTypes.ttcn index a880443..a41277c 100644 --- a/ttcn/patch_lib_http/LibItsHttp_JsonMessageBodyTypes.ttcn +++ b/ttcn/patch_lib_http/LibItsHttp_JsonMessageBodyTypes.ttcn @@ -21,6 +21,7 @@ module LibItsHttp_JsonMessageBodyTypes { AccessPointList accessPointList, UEidentityAPI_TypesAndValues.ProblemDetails problemDetails_ue_identity, UeIdentityTagInfo ueIdentityTagInfo, + SubscriptionLinkList subscriptionLinkList, CellChangeSubscription cellChangeSubscription, RnisAPI_TypesAndValues.ProblemDetails problemDetails_rnis, universal charstring raw diff --git a/ttcn/patch_lib_http/LibItsHttp_JsonTemplates.ttcn b/ttcn/patch_lib_http/LibItsHttp_JsonTemplates.ttcn index b116380..76b945e 100644 --- a/ttcn/patch_lib_http/LibItsHttp_JsonTemplates.ttcn +++ b/ttcn/patch_lib_http/LibItsHttp_JsonTemplates.ttcn @@ -120,6 +120,18 @@ module LibItsHttp_JsonTemplates { group rnis_subscriptions { + template (value) JsonBody m_body_json_subscriptions_list( + in template (value) SubscriptionLinkList p_subscriptionLinkList + ) := { + subscriptionLinkList := p_subscriptionLinkList + } // End of template m_body_json_subscriptions_list + + template (present) JsonBody mw_body_json_subscriptions_list( + template (present) SubscriptionLinkList p_subscriptionLinkList := ? + ) := { + subscriptionLinkList := p_subscriptionLinkList + } // End of template mw_body_json_subscriptions_list + template (value) JsonBody m_body_json_cell_change_subscription( in template (value) CellChangeSubscription p_cellChangeSubscription ) := { -- GitLab