Commit 53c05408 authored by Yann Garcia's avatar Yann Garcia
Browse files

Bug fixed in TC_MEC_MEC011_SRV_SRVSUB_xxx

parent 39a499cd
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -135,10 +135,6 @@ int json_codec::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes
    UEAppInterfaceAPI__TypesAndValues::AppInfo appInfo;
    appInfo.decode(UEAppInterfaceAPI__TypesAndValues::AppInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
    msg.appInfo() = appInfo;
  } else if (it->second.find("\"appName\"") != std::string::npos) {
    EdgePlatformApplicationEnablementAPI__TypesAndValues::AppInfo appInfo;
    appInfo.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::AppInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
    msg.appInfo__regapps() = appInfo;
  } else if ((it->second.find("\"bwInfo\"") != std::string::npos) || (it->second.find("\"fixedBWPriority\"") != std::string::npos)) {
    // Need to change some enumerated string not supported by TTCN-3 language
    while (true) {
+9 −5
Original line number Diff line number Diff line
@@ -153,18 +153,18 @@ int json_codec_mec011::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBo
      dns_rule.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::DnsRule_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
      msg.dnsRule() = dns_rule;
    }
  } else if ((it->second.find("\"SerAvailabilityNotificationSubscription\"") != std::string::npos) || (it->second.find("\"rel\"") != std::string::npos)) {
    EdgePlatformApplicationEnablementAPI__TypesAndValues::SerAvailabilityNotificationSubscription ser_av;
    ser_av.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::SerAvailabilityNotificationSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
    msg.serAvailabilityNotificationSubscription() = ser_av;
  } else if ((it->second.find("\"_links\"") != std::string::npos) && (it->second.find("\"subscriptions\"") != std::string::npos)) {
    EdgePlatformApplicationEnablementAPI__TypesAndValues::SubscriptionLinkList sub_link_list;
    sub_link_list.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::SubscriptionLinkList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
    msg.subscriptionLinkList__app__ens() = sub_link_list;
  } else if (it->second.find("\"AppTerminationNotificationSubscription\"") != std::string::npos) {
  } else if ((it->second.find("\"AppTerminationNotificationSubscription\"") != std::string::npos) && (it->second.find("\"callbackReference\"") != std::string::npos)) {
    EdgePlatformApplicationEnablementAPI__TypesAndValues::AppTerminationNotificationSubscription app_term;
    app_term.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::AppTerminationNotificationSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
    msg.appTerminationNotificationSubscription() = app_term;
  } else if ((it->second.find("\"subscriptionType\"") != std::string::npos) && (it->second.find("\"SerAvailabilityNotificationSubscription\"") != std::string::npos)) {
    EdgePlatformApplicationEnablementAPI__TypesAndValues::SerAvailabilityNotificationSubscription ser_av;
    ser_av.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::SerAvailabilityNotificationSubscription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
    msg.serAvailabilityNotificationSubscription() = ser_av;
  } else if ((it->second.find("\"ntpServers\"") != std::string::npos) || (it->second.find("{\"timeStamp\"") == 0)) {
    EdgePlatformApplicationEnablementAPI__TypesAndValues::TimingCaps timing_caps;
    timing_caps.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::TimingCaps_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
@@ -173,6 +173,10 @@ int json_codec_mec011::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBo
    EdgePlatformApplicationEnablementAPI__TypesAndValues::CurrentTime current_time;
    current_time.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::CurrentTime_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
    msg.currentTime() = current_time;
  } else if (it->second.find("\"appName\"") != std::string::npos) {
    EdgePlatformApplicationEnablementAPI__TypesAndValues::AppInfo appInfo;
    appInfo.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::AppInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
    msg.appInfo__regapps() = appInfo;
  } else {
    loggers::get_instance().warning("json_codec_mec011::decode: Unsupported variant");
    return -1;
+5 −5
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ LibMec_Pics.PICS_ROOT_API := "/sbxykqjr17/mep1/" # Need to sign i
LibMec_Pics.PICS_MEC_PLAT := true

# Application Instance ID
EdgePlatformApplicationEnablementAPI_Pixits.PX_APP_INSTANCE_ID := "2815c5ee-b4e3-4105-9112-0ef9f8a1b32d" # Copied from ETSI MEC Sandbox GUI
EdgePlatformApplicationEnablementAPI_Pixits.PX_APP_INSTANCE_ID := "6c6b308f-4849-413a-9b15-6cae37ee5fce" # Copied from ETSI MEC Sandbox GUI

# Callbacks

@@ -40,7 +40,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_mec011)/TCP(debug=1,server=mec-platform.etsi.org,port=443,use_ssl=1,trusted_ca_list=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem,privkey=/home/yann/var/ssl/archive/yanngarcia.ddns.net/privkey1.pem,certificate=/home/yann/var/ssl/archive/yanngarcia.ddns.net/fullchain1.pem)"
system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec013)/TCP(debug=1,server_mode=1,use_ssl=0)"
system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec011)/TCP(debug=1,server_mode=1,use_ssl=0)"

[DEFINE]
# In this section you can create macro definitions,
@@ -81,7 +81,7 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec013)/TCP(debug=1
#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSAQ_002_NF
# Check that the IUT responds with the information on a specific service for a given application instance when queried by a MEC Application
#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSAQ_003_OK
# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application#
# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application
#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSAQ_003_NF
# Check that the IUT updates a service information for a given application instance when commanded by a MEC Application
#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_APPSAQ_004_OK
@@ -123,7 +123,7 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec013)/TCP(debug=1
#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_CONFTASK_002_NF

# Check that the IUT responds with the liveness of a MEC service instance when queried by a MEC Application
AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MSL_001_OK
#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MSL_001_OK
# Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application
#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MSL_001_NF
# Check that the IUT updates the liveness of a MEC service instance when requested by a MEC Application
@@ -149,7 +149,7 @@ AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MSL_001_
# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_SRVSUB_002_BR
# Check that the IUT responds with the information on a specific subscription when queried by a MEC Application
#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_SRVSUB_003_OK
AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_SRVSUB_003_OK
# Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application
#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_SRVSUB_003_NF
# Check that the IUT acknowledges the unsubscribe from service availability event notifications when commanded by a MEC Application
+6 −13
Original line number Diff line number Diff line
@@ -566,6 +566,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases {
      // Preamble
      f_create_service_info(v_service_info, v_subscription_id);
      f_init_default_headers_list(-, -, v_headers);
      v_service_info.version := PX_NEW_SERVICE_INFO_VERSION;
      httpPort.send(
                    m_http_request(
                                   m_http_request_put(
@@ -573,12 +574,8 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases {
                                                      v_headers,
                                                      m_http_message_body_json(
                                                                               m_body_json_service_info(
                                                                                                        m_service_info(
                                                                                                                       v_service_info.serName,
                                                                                                                       PX_NEW_SERVICE_INFO_VERSION,
                                                                                                                       -, -, -, -, -,
                                                                                                                       v_service_info.transportInfo
                    ))))));
                                                                                                        v_service_info
                    )))));
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);

      // Test Body
@@ -589,12 +586,8 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases {
                                             mw_http_response_ok(
                                                                 mw_http_message_body_json(
                                                                                           mw_body_json_service_info(
                                                                                                                     mw_service_info(
                                                                                                                                     v_service_info.serName,
                                                                                                                                     PX_NEW_SERVICE_INFO_VERSION,
                                                                                                                                     -, -, -, -, -,
                                                                                                                                     v_service_info.transportInfo
                            )))))) {
                                                                                                                     v_service_info
                            ))))) {
          tc_ac.stop;

          log("*** " & testcasename() & ": PASS: IUT successfully responds with a modified ServiceInfo ***");
@@ -2362,7 +2355,7 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestCases {
                                                                                                             m_app_info(
                                                                                                                        PX_APP_NAME,
                                                                                                                        -, -, -,
                                                                                                                        -,
                                                                                                                        -,//PX_APP_INSTANCE_ID,
                                                                                                                        m_end_point_uris({PX_APP_ENDPOINT_URI})
                    ))))));
      f_selfOrClientSyncAndVerdict(c_prDone, e_success);