From d8540156c19098f787680bd6a9f1a198bcca3c6c Mon Sep 17 00:00:00 2001 From: YannGarcia Date: Tue, 6 Aug 2019 06:48:41 -0700 Subject: [PATCH] Add TC_MEC_SRV_RNIS_011_OK --- TODO.md | 20 +- ccsrc/Protocols/Json/json_codec.cc | 21 +- etc/AtsMec/AtsMec.cfg | 26 +- .../AtsMec_AppEnablementAPI_TestCases.ttcn | 252 +++++++++++++++++- ttcn/AtsMec/AtsMec_RnisAPI_TestCases.ttcn | 29 +- ttcn/AtsMec/AtsMec_TestControl.ttcn | 7 +- .../AtsMec_UEidentityAPI_TestCases.ttcn | 98 +++---- .../AppEna/ttcn/AppEnablementAPI_Pixits.ttcn | 2 +- .../ttcn/AppEnablementAPI_Templates.ttcn | 34 +++ .../ttcn/AppEnablementAPI_TypesAndValues.ttcn | 14 +- ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Pixits.ttcn | 4 +- .../RnisAPI/ttcn/RnisAPI_Templates.ttcn | 16 ++ ttcn/LibMec/ttcn/LibMec_Pixits.ttcn | 6 +- .../LibItsHttp_JsonMessageBodyTypes.ttcn | 2 + .../LibItsHttp_JsonTemplates.ttcn | 36 +++ 15 files changed, 471 insertions(+), 96 deletions(-) diff --git a/TODO.md b/TODO.md index 01fbd72..5b8e3d6 100644 --- a/TODO.md +++ b/TODO.md @@ -21,6 +21,13 @@ This file provides the list of the TODOs related to the STF 569. ### RNIS +Draft ETSI GS MEC 012 2.0.4 + +https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/RNIS/RnisSpecificSubscription_BV.tplan2 +https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/RNIS/RnisSpecificSubscription_BV.tplan2 + +- TC_MEC_SRV_RNIS_011_OK To be tested + ### SAQ ### SRVSUB @@ -29,14 +36,23 @@ This file provides the list of the TODOs related to the STF 569. ### TRAF -### TRANS +Draft ETSI GS MEC 011 V2.0.9 (2018-10) +https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/remove-401s/Test%20Purposes/SRV/TRAF/PlatTrafficRules.tplan2 + +- TC_MEC_SRV_TRANS_001_OK To be tested +- TC_MEC_SRV_TRAF_001_OK To be tested +- TC_MEC_SRV_TRAF_002_OK To be tested +- TC_MEC_SRV_TRAF_003_OK To be tested +- TC_MEC_SRV_TRAF_001_NF To be tested + +### TRANS Draft ETSI GS MEC 011 V2.0.9 (2018-10) https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/remove-401s/Test%20Purposes/SRV/TRANS/PlatTransport.tplan2 -- TC_MEC_SRV_TRANS_001_OK To be tested +- TP_MEC_SRV_TRAF_001_OK To be tested ### UEAREASUB diff --git a/ccsrc/Protocols/Json/json_codec.cc b/ccsrc/Protocols/Json/json_codec.cc index fad5c14..56d55ff 100644 --- a/ccsrc/Protocols/Json/json_codec.cc +++ b/ccsrc/Protocols/Json/json_codec.cc @@ -58,21 +58,26 @@ int json_codec::decode (const OCTETSTRING& p_data, LibItsHttp__JsonMessageBodyTy // ..and create the decoding buffer TTCN_Buffer decoding_buffer(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); - if (it->second.find("\"userList\"") != std::string::npos) { // Be carefull to the order - // TODO To be refined, find("\"userList\"") is not optimal + if (it->second.find("\"userList\"") != std::string::npos) { // Be careful to the order + // TODO To be refined, find("\"userList\"") is not optimal LocationAPI__TypesAndValues::UserList user_list; user_list.decode(LocationAPI__TypesAndValues::UserList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.userList() = user_list; - } else if (it->second.find("\"accessPointList\"") != std::string::npos) { // Be carefull to the order - // TODO To be refined, find("\"accessPointList\"") is not optimal + } else if (it->second.find("\"accessPointList\"") != std::string::npos) { // Be careful to the order + // TODO To be refined, find("\"accessPointList\"") is not optimal 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 + } else if (it->second.find("\"SubscriptionLinkList\"") != std::string::npos) { // Be careful 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("\"transportInfoList\"") != std::string::npos) { // Be careful to the order + // TODO To be refined, find("\"accessPointList\"") is not optimal + AppEnablementAPI__TypesAndValues::TransportInfoList transport_info_list; + transport_info_list.decode(AppEnablementAPI__TypesAndValues::TransportInfoList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.transportInfoList() = transport_info_list; } else if (it->second.find("\"userTrackingSubscription\"") != std::string::npos) { LocationAPI__TypesAndValues::UserTrackingSubscription user_tracking_subscription; user_tracking_subscription.decode(LocationAPI__TypesAndValues::UserTrackingSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); @@ -85,6 +90,10 @@ int json_codec::decode (const OCTETSTRING& p_data, LibItsHttp__JsonMessageBodyTy UEidentityAPI__TypesAndValues::UeIdentityTagInfo ue_identity_tag_info; ue_identity_tag_info.decode(UEidentityAPI__TypesAndValues::UeIdentityTagInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.ueIdentityTagInfo() = ue_identity_tag_info; + } else if (it->second.find("\"trafficRule\"") != std::string::npos) { + AppEnablementAPI__TypesAndValues::TrafficRule traffic_rule; + traffic_rule.decode(AppEnablementAPI__TypesAndValues::TrafficRule_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); + msg.trafficRule() = traffic_rule; } else if (it->second.find("\"bwInfo\"") != std::string::npos) { BwManagementAPI__TypesAndValues::BwInfo bw_info; diff --git a/etc/AtsMec/AtsMec.cfg b/etc/AtsMec/AtsMec.cfg index 879f749..a1a9ec9 100644 --- a/etc/AtsMec/AtsMec.cfg +++ b/etc/AtsMec/AtsMec.cfg @@ -7,21 +7,26 @@ 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 := "172.28.4.87" +LibItsHttp_Pics.PICS_HEADER_HOST := "192.168.56.1" +#LibItsHttp_Pics.PICS_HEADER_HOST := "172.28.4.87" #LibItsHttp_Pics.PICS_HEADER_HOST := "192.168.0.17" LibItsHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json" -LibMec_Pics.PICS_MEC_PLAT := true -LibMec_Pics.PICS_SERVICES := true -LibMec_Pics.PICS_RNIS := false +LibMec_Pics.PICS_MEC_PLAT := true +LibMec_Pics.PICS_SERVICES := true +LibMec_Pics.PICS_RNIS := true +LibMec_Pics.PICS_RNIS_ALL_SUBSCRIPTIONS := true LocationAPI_Pics.PICS_LOCATION_API_SUPPORTED := false -UEidentityAPI_Pics.PICS_UE_IDENTITY_API_SUPPORTED := true +UEidentityAPI_Pics.PICS_UE_IDENTITY_API_SUPPORTED := false BwManagementAPI_Pics.PICS_BWMANAGEMENT_API_SUPPORTED := false +AppEnablementAPI_Pics.PICS_ENABLE_APP_API_SUPPORTED := true + + [LOGGING] # In this section you can specify the name of the log file and the classes of events # you want to log into the file or display on console (standard error). @@ -38,7 +43,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.28.4.87,port=8081,use_ssl=0)" +system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=192.168.56.1,port=8081,use_ssl=0)" [DEFINE] # In this section you can create macro definitions, @@ -69,7 +74,7 @@ system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=172.2 #AtsMec_UEidentityAPI_TestCases.TC_MEC_SRV_UETAG_001_NF #AtsMec_UEidentityAPI_TestCases.TC_MEC_SRV_UETAG_002_OK #AtsMec_UEidentityAPI_TestCases.TC_MEC_SRV_UETAG_002_BR -AtsMec_UEidentityAPI_TestCases.TC_MEC_SRV_UETAG_002_PF +#AtsMec_UEidentityAPI_TestCases.TC_MEC_SRV_UETAG_002_PF #AtsMec_UEidentityAPI_TestCases.TC_MEC_SRV_UELOC_001_OK #AtsMec_UEidentityAPI_TestCases.TC_MEC_SRV_UELOC_001_BR @@ -94,6 +99,13 @@ AtsMec_UEidentityAPI_TestCases.TC_MEC_SRV_UETAG_002_PF #AtsMec_LocationAPI_TestCases.TC_MEC_SRV_UEINFSUB_002_OK #AtsMec_LocationAPI_TestCases.TC_MEC_SRV_UEINFSUB_002_NF +AtsMec_RnisAPI_TestCases.TC_MEC_SRV_RNIS_011_OK + +#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_TRANS_001_OK +#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_TRAF_001_OK +#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_TRAF_002_OK +#AtsMec_AppEnablementAPI_TestCases.TC_MEC_SRV_TRAF_001_NF + [GROUPS] # In this section you can specify groups of hosts. These groups can be used inside the # [COMPONENTS] section to restrict the creation of certain PTCs to a given set of hosts. diff --git a/ttcn/AtsMec/AtsMec_AppEnablementAPI_TestCases.ttcn b/ttcn/AtsMec/AtsMec_AppEnablementAPI_TestCases.ttcn index d94df76..1719b34 100644 --- a/ttcn/AtsMec/AtsMec_AppEnablementAPI_TestCases.ttcn +++ b/ttcn/AtsMec/AtsMec_AppEnablementAPI_TestCases.ttcn @@ -45,7 +45,7 @@ module AtsMec_AppEnablementAPI_TestCases { // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_ENABLE_APP_API_SUPPORTED)) { - log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_LOCATION_API_SUPPORTED required for executing the TC ***"); + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_ENABLE_APP_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } @@ -74,9 +74,8 @@ module AtsMec_AppEnablementAPI_TestCases { mw_http_response( mw_http_response_ok( mw_http_message_body_json( - mw_body_json_transport_info_list( - { *, mw_transport_info, * } - ))))) { + mw_body_json_transport_info_list + )))) { tc_ac.stop; log("*** " & testcasename() & ": PASS: IUT successfully responds with a UeIdentityTag ***"); @@ -94,4 +93,249 @@ module AtsMec_AppEnablementAPI_TestCases { } // End of group transport_info + group traffic_rules { + + /** + * @desc Check that the IUT responds with a list of available traffic rules when queried by a MEC Application + * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/TRAF/TrafficRules.tplan2 + */ + testcase TC_MEC_SRV_TRAF_001_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_ENABLE_APP_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_ENABLE_APP_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( + "/" & PICS_ROOT_API & PX_SVC_MGMT_APP_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/traffic_rules", + 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_traffic_rules_list + )))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a UeIdentityTag ***"); + 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_SRV_TRAF_001_OK + + /** + * @desc Check that the IUT responds with the information on a specific traffic rule when queried by a MEC Application + * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/TRAF/TrafficRules.tplan2 + */ + testcase TC_MEC_SRV_TRAF_002_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_ENABLE_APP_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_ENABLE_APP_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( + "/" & PICS_ROOT_API & PX_SVC_MGMT_APP_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/traffic_rules/" & oct2char(unichar2oct(PX_TRAFFIC_RULE_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_traffic_rule( + mw_traffic_rule( + PX_TRAFFIC_RULE_ID + )))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a UeIdentityTag ***"); + 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_SRV_TRAF_002_OK + + /** + * @desc Check that the IUT updates a specific traffic rule when commanded by a MEC Application + * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/TRAF/TrafficRules.tplan2 + */ + testcase TC_MEC_SRV_TRAF_003_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_ENABLE_APP_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_ENABLE_APP_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_post( + "/" & PICS_ROOT_API & PX_SVC_MGMT_APP_URI & oct2char(unichar2oct(PX_APP_INSTANCE_ID, "UTF-8")) & "/traffic_rules/" & oct2char(unichar2oct(PX_TRAFFIC_RULE_ID, "UTF-8")), + v_headers, + m_http_message_body_json( + m_body_json_traffic_rule( + m_traffic_rule( + PX_TRAFFIC_RULE_ID, + -, + -, + -, + DROP + ) + ) + ) + ) + ) + ); + 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_traffic_rule( + mw_traffic_rule( + PX_TRAFFIC_RULE_ID + )))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a UeIdentityTag ***"); + 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_SRV_TRAF_003_OK + + /** + * @desc Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application + * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/TRAF/TrafficRules.tplan2 + */ + testcase TC_MEC_SRV_TRAF_001_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines v_headers; + + // Test control + if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_ENABLE_APP_API_SUPPORTED)) { + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_ENABLE_APP_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( + "/" & PICS_ROOT_API & PX_SVC_MGMT_APP_URI & oct2char(unichar2oct(PX_NON_EXISTENT_APP_INSTANCE_ID, "UTF-8")) & "/traffic_rules", + 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_app_enablement_problem_details( + mw_problem_details( + -, -, 404 + )))))) { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a UeIdentityTag ***"); + 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_SRV_TRAF_001_NF + + } // End of group traffic_rules + } // End of module AtsMec_AppEnablementAPI_TestCases diff --git a/ttcn/AtsMec/AtsMec_RnisAPI_TestCases.ttcn b/ttcn/AtsMec/AtsMec_RnisAPI_TestCases.ttcn index 4076884..d3f398e 100644 --- a/ttcn/AtsMec/AtsMec_RnisAPI_TestCases.ttcn +++ b/ttcn/AtsMec/AtsMec_RnisAPI_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 012 V2.0.3 (2018-10) */ module AtsMec_RnisAPI_TestCases { @@ -34,14 +34,23 @@ module AtsMec_RnisAPI_TestCases { import from LibMec_Pics all; import from LibMec_Pixits all; - group me_app_role { + group rnis { /** - * @desc 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 + * @desc Check that the RNIS service sends the list of links to the relevant RNIS subscriptions when requested. + * Acceptable SUBSCRIPTION_TYPE are the following: + * - CellChangeSubscription + * - RabEstSubscription + * - RabModSubscription + * - RabRelSubscription + * - MeasRepUeSubscription + * - MeasTaSubscription + * - CaReconfSubscription + * - S1BearerSubscription + * - NrMeasRepUeSubscription" + * @see https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/RNIS/RnisSpecificSubscription_BV.tplan2 */ - testcase TC_MEC025_RNIS_SUBSCRIPTION_005() runs on HttpComponent system HttpTestAdapter { + testcase TC_MEC_SRV_RNIS_011_OK() runs on HttpComponent system HttpTestAdapter { // Local variables var HeaderLines v_headers; var HttpMessage v_response; @@ -63,7 +72,7 @@ module AtsMec_RnisAPI_TestCases { httpPort.send( m_http_request( m_http_request_get( - PX_RNIS_SUBSCRITIONS_URI, + "/" & PICS_ROOT_API & PX_RNIS_SUBSCRITIONS_URI & "?subscription_type=" & oct2char(unichar2oct(PX_SUBSCRIPTION_TYPE, "UTF-8")), v_headers ) ) @@ -80,7 +89,7 @@ module AtsMec_RnisAPI_TestCases { mw_body_json_subscriptions_list( mw_subscriptions_list( PX_LINKS_SELF, - ? + { *, mw_subscription(-, CELL_CHANGE), * } )))))) -> value v_response { tc_ac.stop; @@ -95,9 +104,9 @@ module AtsMec_RnisAPI_TestCases { // Postamble f_cf_01_http_down(); - } // End of testcase TC_MEC025_RNIS_SUBSCRIPTION_005 + } // End of testcase TC_MEC_SRV_RNIS_011_OK - } // End of group me_app_role + } // End of group rnis } // End of module AtsMec_RnisAPI_TestCases diff --git a/ttcn/AtsMec/AtsMec_TestControl.ttcn b/ttcn/AtsMec/AtsMec_TestControl.ttcn index 9beaec8..568d4d3 100644 --- a/ttcn/AtsMec/AtsMec_TestControl.ttcn +++ b/ttcn/AtsMec/AtsMec_TestControl.ttcn @@ -20,6 +20,7 @@ module AtsMec_TestControl { import from AtsMec_RadioNodeLocationAPI_TestCases all; import from AtsMec_RnisAPI_TestCases all; import from AtsMec_BwManagementAPI_TestCases all; + import from AtsMec_AppEnablementAPI_TestCases all; control { @@ -61,12 +62,16 @@ module AtsMec_TestControl { if (PICS_ENABLE_APP_API_SUPPORTED) { execute(TC_MEC_SRV_TRANS_001_OK()); + execute(TC_MEC_SRV_TRAF_001_OK()); + execute(TC_MEC_SRV_TRAF_002_OK()); + execute(TC_MEC_SRV_TRAF_003_OK()); + execute(TC_MEC_SRV_TRAF_001_NF()); } } if (PICS_RNIS) { if (PICS_RNIS_ALL_SUBSCRIPTIONS) { - execute(TC_MEC025_RNIS_SUBSCRIPTION_005()); + execute(TC_MEC_SRV_RNIS_011_OK()); } } diff --git a/ttcn/AtsMec/AtsMec_UEidentityAPI_TestCases.ttcn b/ttcn/AtsMec/AtsMec_UEidentityAPI_TestCases.ttcn index bd2d134..6e0ea09 100644 --- a/ttcn/AtsMec/AtsMec_UEidentityAPI_TestCases.ttcn +++ b/ttcn/AtsMec/AtsMec_UEidentityAPI_TestCases.ttcn @@ -43,7 +43,7 @@ module AtsMec_UEidentityAPI_TestCases { // Test control if (not(PICS_MEC_PLAT) or not(PICS_SERVICES) or not(PICS_UE_IDENTITY_API_SUPPORTED)) { - log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_LOCATION_API_SUPPORTED required for executing the TC ***"); + log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_SERVICES and PICS_UE_IDENTITY_API_SUPPORTED required for executing the TC ***"); setverdict(inconc); stop; } @@ -236,22 +236,22 @@ module AtsMec_UEidentityAPI_TestCases { } httpPort.send( m_http_request( - m_http_request_post( - "/" & PICS_ROOT_API & 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( - m_ue_identity_tag_info( - { - m_ue_identity_tag_item( - PX_UE_IDENTITY_TAG, - REGISTERED - ) - } - ) - ) - ) - ) + m_http_request_put( + "/" & PICS_ROOT_API & 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( + m_ue_identity_tag_info( + { + m_ue_identity_tag_item( + PX_UE_IDENTITY_TAG, + REGISTERED + ) + } + ) + ) + ) + ) ) ); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -316,22 +316,22 @@ module AtsMec_UEidentityAPI_TestCases { } httpPort.send( m_http_request( - m_http_request_post( - "/" & PICS_ROOT_API & 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( - m_ue_identity_tag_info( - { - m_ue_identity_tag_item( - PX_UE_IDENTITY_TAG, - INVALID_STATE - ) - } - ) - ) - ) - ) + m_http_request_put( + "/" & PICS_ROOT_API & 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( + m_ue_identity_tag_info( + { + m_ue_identity_tag_item( + PX_UE_IDENTITY_TAG, + INVALID_STATE + ) + } + ) + ) + ) + ) ) ); f_selfOrClientSyncAndVerdict(c_prDone, e_success); @@ -386,22 +386,22 @@ module AtsMec_UEidentityAPI_TestCases { f_init_default_headers_list(-, -, v_headers); httpPort.send( m_http_request( - m_http_request_post( - "/" & PICS_ROOT_API & 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( - m_ue_identity_tag_info( - { - m_ue_identity_tag_item( - PX_UE_IDENTITY_TAG_INVALID_STATE, - UNREGISTERED - ) - } - ) - ) - ) - ) + m_http_request_put( + "/" & PICS_ROOT_API & 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( + m_ue_identity_tag_info( + { + m_ue_identity_tag_item( + PX_UE_IDENTITY_TAG_INVALID_STATE, + UNREGISTERED + ) + } + ) + ) + ) + ) ) ); f_selfOrClientSyncAndVerdict(c_prDone, e_success); diff --git a/ttcn/LibMec/AppEna/ttcn/AppEnablementAPI_Pixits.ttcn b/ttcn/LibMec/AppEna/ttcn/AppEnablementAPI_Pixits.ttcn index bdb9c1b..e99f699 100644 --- a/ttcn/LibMec/AppEna/ttcn/AppEnablementAPI_Pixits.ttcn +++ b/ttcn/LibMec/AppEna/ttcn/AppEnablementAPI_Pixits.ttcn @@ -10,7 +10,7 @@ module AppEnablementAPI_Pixits { modulepar universal charstring PX_NON_EXISTENT_APP_INSTANCE_ID := "appInst99"; - modulepar universal charstring PX_UE_IDENTITY_TAG := "UeTagA"; + modulepar universal charstring PX_TRAFFIC_RULE_ID := "trafficRuleId01"; modulepar universal charstring PX_UE_IDENTITY_TAG_INVALID_STATE := "UeTagC"; diff --git a/ttcn/LibMec/AppEna/ttcn/AppEnablementAPI_Templates.ttcn b/ttcn/LibMec/AppEna/ttcn/AppEnablementAPI_Templates.ttcn index 7b6b729..fb7f280 100644 --- a/ttcn/LibMec/AppEna/ttcn/AppEnablementAPI_Templates.ttcn +++ b/ttcn/LibMec/AppEna/ttcn/AppEnablementAPI_Templates.ttcn @@ -67,4 +67,38 @@ module AppEnablementAPI_Templates { implSpecificInfo := * } // End of template mw_transport_info + template (value) TrafficRule m_traffic_rule( + in TrafficRule_Id p_trafficRuleId, + in TrafficRule_FilterType p_filterType := FLOW, + in TrafficRule_Priority p_priority := 1, + in TrafficFilterList p_trafficFilter := {}, + in TrafficRule_Action p_action_, + in TrafficRule_State p_state := ACTIVE + ) := { + trafficRuleId := p_trafficRuleId, + filterType := p_filterType, + priority := p_priority, + trafficFilter := p_trafficFilter, + action_ := p_action_, + dstInterface := omit, + state := p_state + } // End of template m_traffic_rule + + template (present) TrafficRule mw_traffic_rule( + template (present) TrafficRule_Id p_trafficRuleId := ?, + template (present) TrafficRule_FilterType p_filterType := ?, + template (present) TrafficRule_Priority p_priority := ?, + template (present) TrafficFilterList p_trafficFilter := ?, + template (present) TrafficRule_Action p_action_ := ?, + template (present) TrafficRule_State p_state := ? + ) := { + trafficRuleId := p_trafficRuleId, + filterType := p_filterType, + priority := p_priority, + trafficFilter := p_trafficFilter, + action_ := p_action_, + dstInterface := *, + state := p_state + } // End of template mw_traffic_rule + } // End of module AppEnablementAPI_Templates diff --git a/ttcn/LibMec/AppEna/ttcn/AppEnablementAPI_TypesAndValues.ttcn b/ttcn/LibMec/AppEna/ttcn/AppEnablementAPI_TypesAndValues.ttcn index b5f97e7..75ed478 100644 --- a/ttcn/LibMec/AppEna/ttcn/AppEnablementAPI_TypesAndValues.ttcn +++ b/ttcn/LibMec/AppEna/ttcn/AppEnablementAPI_TypesAndValues.ttcn @@ -419,19 +419,6 @@ module AppEnablementAPI_TypesAndValues { */ type JSON.String ServiceInfo_Version; - /** - * @desc This type represents the general information of a mobile edge service. - */ - type record Post { - SerInstanceId serInstanceId optional, - SerName serName, - ServiceInfo_Version version, - ServiceInfo_State state, - SerializerTypes serializer, - TransportId transportId optional, // JSON oneOf ??? - TransportInfo transportInfo optional // JSON oneOf ??? - } - /** * @desc This type represents the general information of a mobile edge service. */ @@ -676,6 +663,7 @@ module AppEnablementAPI_TypesAndValues { } with { variant (action_) "name as 'action'"; } + type record of TrafficRule TrafficRuleList /** * @desc Human-readable description of this transport. diff --git a/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Pixits.ttcn b/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Pixits.ttcn index cb6d060..ab4e798 100644 --- a/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Pixits.ttcn +++ b/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Pixits.ttcn @@ -6,8 +6,10 @@ module RnisAPI_Pixits { // LibMec/Rnis import from RnisAPI_TypesAndValues all; + modulepar JSON.String PX_SUBSCRIPTION_TYPE := "cell_change"; + modulepar JSON.String PX_SUBSCRIPTION_ID := "7777"; - modulepar Link PX_LINKS_SELF := { self_ := "http://example.com/exampleAPI/rni/v2/subscriptions/" }; + modulepar Link PX_LINKS_SELF := { self_ := "http://example.com/exampleAPI/rni/v2/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 16ef757..fbbc3e6 100644 --- a/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Templates.ttcn +++ b/ttcn/LibMec/RnisAPI/ttcn/RnisAPI_Templates.ttcn @@ -28,6 +28,22 @@ module RnisAPI_Templates { subscription := p_subscription } // End of template mw_subscriptions_list + template (value) Subscription_ m_subscription( + in LinkType p_href, + in SubscriptionType p_subscriptionType + ) := { + href := p_href, + subscriptionType := p_subscriptionType + } // End of temlate m_subscription + + template (present) Subscription_ mw_subscription( + template (present) LinkType p_href := ?, + template (present) SubscriptionType p_subscriptionType := ? + ) := { + href := p_href, + subscriptionType := p_subscriptionType + } // End of temlate mw_subscription + group cell { template (omit) CellChangeSubscription m_cell_change_subscription( diff --git a/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn b/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn index cd29db6..887161f 100644 --- a/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn +++ b/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn @@ -14,9 +14,11 @@ module LibMec_Pixits { modulepar charstring PX_ME_APP_Q_UE_IDENTITY_ID_URI := "/ui/v2/"; - modulepar charstring PX_SVC_MGMT_TRANS_URI := "/mec_service_mgmt/v1/transports"; + modulepar charstring PX_SVC_MGMT_TRANS_URI := "/mec_app_support/v2/transports"; - modulepar charstring PX_RNIS_SUBSCRITIONS_URI := "/rni/v2/subscriptions/"; + modulepar charstring PX_SVC_MGMT_APP_URI := "/mec_service_mgmt/v2/application"; + + modulepar charstring PX_RNIS_SUBSCRITIONS_URI := "/rni/v2/subscriptions"; modulepar charstring PX_ME_BWM_URI := "/bwm/v2/bw_allocations"; diff --git a/ttcn/patch_lib_http/LibItsHttp_JsonMessageBodyTypes.ttcn b/ttcn/patch_lib_http/LibItsHttp_JsonMessageBodyTypes.ttcn index 817261b..08171c9 100644 --- a/ttcn/patch_lib_http/LibItsHttp_JsonMessageBodyTypes.ttcn +++ b/ttcn/patch_lib_http/LibItsHttp_JsonMessageBodyTypes.ttcn @@ -33,6 +33,8 @@ module LibItsHttp_JsonMessageBodyTypes { BwInfo bwInfo, BwManagementAPI_TypesAndValues.ProblemDetails problemDetails_bw_management, TransportInfoList transportInfoList, + TrafficRuleList trafficRuleList, + TrafficRule trafficRule, AppEnablementAPI_TypesAndValues.ProblemDetails problemDetails_svc_mgmt, universal charstring raw } with { diff --git a/ttcn/patch_lib_http/LibItsHttp_JsonTemplates.ttcn b/ttcn/patch_lib_http/LibItsHttp_JsonTemplates.ttcn index 29718a4..a50790d 100644 --- a/ttcn/patch_lib_http/LibItsHttp_JsonTemplates.ttcn +++ b/ttcn/patch_lib_http/LibItsHttp_JsonTemplates.ttcn @@ -206,6 +206,42 @@ module LibItsHttp_JsonTemplates { transportInfoList := p_transportInfoList } // End of template mw_body_json_transport_info_list + template (value) JsonBody m_body_json_traffic_rule( + in template (value) TrafficRule p_trafficRule + ) := { + trafficRule := p_trafficRule + } // End of template m_body_json_traffic_rule + + template (present) JsonBody mw_body_json_traffic_rule( + template (present) TrafficRule p_trafficRule := ? + ) := { + trafficRule := p_trafficRule + } // End of template mw_body_json_traffic_rule + + template (value) JsonBody m_body_json_traffic_rules_list( + in template (value) TrafficRuleList p_trafficRuleList + ) := { + trafficRuleList := p_trafficRuleList + } // End of template m_body_json_traffic_rules_list + + template (present) JsonBody mw_body_json_traffic_rules_list( + template (present) TrafficRuleList p_trafficRuleList := ? + ) := { + trafficRuleList := p_trafficRuleList + } // End of template mw_body_json_traffic_rules_list + + template (value) JsonBody m_body_json_app_enablement_problem_details( + in template (value) AppEnablementAPI_TypesAndValues.ProblemDetails p_problemDetails + ) := { + problemDetails_svc_mgmt := p_problemDetails + } // End of template m_body_json_app_enablement_problem_details + + template (present) JsonBody mw_body_json_app_enablement_problem_details( + template (present) AppEnablementAPI_TypesAndValues.ProblemDetails p_problemDetails := ? + ) := { + problemDetails_svc_mgmt := p_problemDetails + } // End of template mw_body_json_app_enablement_problem_details + } // End of group svc_mgmt } // End of module LibItsHttp_JsonTemplates -- GitLab