Commit 3883c283 authored by Muhammad Umair Khan's avatar Muhammad Umair Khan
Browse files

update MEC015 testcases as per version v3.1.1

parent 774709bd
Loading
Loading
Loading
Loading
+13 −0
Original line number Original line Diff line number Diff line
@@ -32,6 +32,10 @@ int json_codec::encode (const LibHttp__JsonMessageBodyTypes::JsonBody& msg, OCTE
    const TrafficManagementAPI__TypesAndValues::BwInfo& bw_info = msg.bwInfo();
    const TrafficManagementAPI__TypesAndValues::BwInfo& bw_info = msg.bwInfo();
    bw_info.encode(TrafficManagementAPI__TypesAndValues::BwInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON);
    bw_info.encode(TrafficManagementAPI__TypesAndValues::BwInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON);
    data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/;
    data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/;
  } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ATL_bwchgeventsubscription)) {
    const TrafficManagementAPI__TypesAndValues::BwChgEventSubscription& bw_chg_event_subscription = msg.bwInfo();
    bw_info.encode(TrafficManagementAPI__TypesAndValues::BwChgEventSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON);
    data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/;
  } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_mtsSessionInfo)) {
  } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_mtsSessionInfo)) {
    const TrafficManagementAPI__TypesAndValues::MtsSessionInfo& mts_session_info = msg.mtsSessionInfo();
    const TrafficManagementAPI__TypesAndValues::MtsSessionInfo& mts_session_info = msg.mtsSessionInfo();
    mts_session_info.encode(TrafficManagementAPI__TypesAndValues::MtsSessionInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON);
    mts_session_info.encode(TrafficManagementAPI__TypesAndValues::MtsSessionInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON);
@@ -153,6 +157,15 @@ int json_codec::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBodyTypes
      bw_info.decode(TrafficManagementAPI__TypesAndValues::BwInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
      bw_info.decode(TrafficManagementAPI__TypesAndValues::BwInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
      msg.bwInfo() = bw_info;
      msg.bwInfo() = bw_info;
    }
    }
  } else if ((it->second.find("\"_links\"") != std::string::npos) && (it->second.find("subscriptions\"") != std::string::npos)) { // SubscriptionLinkList
    TrafficManagementAPI__TypesAndValues::SubscriptionLinkList subscription_link_list;
    subscription_link_list.decode(TrafficManagementAPI__TypesAndValues::SubscriptionLinkList_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
    msg.subscriptionLinkList() = subscription_link_list;
  } else if ((it->second.find("\"bwchgeventsubscription\"") != std::string::npos) {
    TrafficManagementAPI__TypesAndValues::BwChgEventSubscription bw_chg_event_subscription;
    TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
    bw_chg_event_subscription.decode(TrafficManagementAPI__TypesAndValues::MtsCapabilityInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
    msg.bwchgeventsubscription() = bw_chg_event_subscription;
  } else if ((it->second.find("\"mtsCapabilityInfo\"") != std::string::npos) || (it->second.find("\"mtsAccessInfo\"") != std::string::npos)) {
  } else if ((it->second.find("\"mtsCapabilityInfo\"") != std::string::npos) || (it->second.find("\"mtsAccessInfo\"") != std::string::npos)) {
    TrafficManagementAPI__TypesAndValues::MtsCapabilityInfo mts_cap_info;
    TrafficManagementAPI__TypesAndValues::MtsCapabilityInfo mts_cap_info;
    TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
    TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
+1031 −0

File added.

Preview size limit exceeded, changes collapsed.

+17 −0
Original line number Original line Diff line number Diff line
@@ -41,6 +41,23 @@ module AtsMec_TrafficManagementAPI_TestControl {
      execute(TC_MEC_MEC015_SRV_TM_006_OK());
      execute(TC_MEC_MEC015_SRV_TM_006_OK());
      execute(TC_MEC_MEC015_SRV_TM_006_NF());
      execute(TC_MEC_MEC015_SRV_TM_006_NF());
    }
    }

    if (PICS_MEC_PLAT and PICS_BWMANAGEMENT_SUBCRIPTION_API_SUPPORTED) {
      execute(TC_MEC_MEC015_SRV_BWMSUBLOOKUP_001_OK());
      execute(TC_MEC_MEC015_SRV_BWSUBLOOKUP_001_BR());
      execute(TC_MEC_MEC015_SRV_BWSUBLOOKUP_001_NF());
      execute(TC_MEC_MEC015_SRV_BWSUBLOOKUP_002_OK());
      execute(TP_MEC_MEC015_SRV_BWSUBLOOKUP_002_NF());
      execute(TC_MEC_MEC015_SRV_BWSUBLOOKUP_003_OK());
      execute(TC_MEC_MEC015_SRV_BWSUBLOOKUP_003_NF());

      execute(TC_MEC_MEC015_SRV_BW_SUB_NOT_001_OK());
      execute(TC_MEC_MEC015_SRV_BW_SUB_NOT_001_BR_01());
      execute(TC_MEC_MEC015_SRV_BW_SUB_NOT_001_BR_02());
      execute(TC_MEC_MEC015_SRV_BW_SUB_NOT_001_BR_03());
      execute(TC_MEC_MEC015_SRV_BW_SUB_NOT_002_OK());
    }

    if (PICS_MEC_PLAT and PICS_MULTI_ACCESS_TRAFFIC_STEERING_API_SUPPORTED) {
    if (PICS_MEC_PLAT and PICS_MULTI_ACCESS_TRAFFIC_STEERING_API_SUPPORTED) {
      execute(TC_MEC_MEC015_SRV_MTS_001_OK());
      execute(TC_MEC_MEC015_SRV_MTS_001_OK());


+1 −0
Original line number Original line Diff line number Diff line
@@ -2,6 +2,7 @@ suite := AtsMec_TrafficManagement


sources := \
sources := \
    AtsMec_TrafficManagementAPI_TestCases.ttcn  \
    AtsMec_TrafficManagementAPI_TestCases.ttcn  \
    AtsMec_BandwidthChangeEventSubAPI_TestCases.ttcn  \
    AtsMec_MultiAccessSteeringInfoAPI_TestCases.ttcn  \
    AtsMec_MultiAccessSteeringInfoAPI_TestCases.ttcn  \
    AtsMec_TrafficManagementAPI_TestControl
    AtsMec_TrafficManagementAPI_TestControl


+86 −0
Original line number Original line Diff line number Diff line
@@ -106,6 +106,92 @@ module TrafficManagementAPI_Functions {
    } // End of 'alt' statement
    } // End of 'alt' statement
  } // End of function f_delete_bw_allocation_resource
  } // End of function f_delete_bw_allocation_resource


  function f_create_bw_chg_event_subscription(
                                              out BwChgEventSubscription p_bw_chg_event_subscription,
                                              out charstring p_subscription_id
                                              ) runs on HttpComponent {

    var Headers v_headers;
    var HttpMessage v_response;

    f_init_default_headers_list(-, -, v_headers);

    httpPort.send(
                  m_http_request(
                                 m_http_request_post(
                                                     PICS_ROOT_API & PX_ME_BWM_SUB_URI,
                                                     v_headers,
                                                     m_http_message_body_json(
                                                                              m_body_json_bw_chg_event_subscription(
                                                                                                                   m_bw_chg_event_subscription(
                                                                                                                                              PX_BW_EVENT_SUB_CALLBACK_URI,
                                                                                                                                              -,
                                                                                                                                              -,
                                                                                                                                              m_filter_criteria
                  ))))));
    tc_ac.start;
    alt {
      [] httpPort.receive(
                          mw_http_response(
                                           mw_http_response_201_created(
                                                                        mw_http_message_body_json(
                                                                                                  mw_body_json_bw_chg_event_subscription(
                                                                                                                                        mw_bw_chg_event_subscription(
                                                                                                                                                                    PX_BW_Subcription_type,
                                                                                                                                                                    PX_BW_EVENT_SUB_CALLBACK_URI,
                                                                                                                                                                    -,
                                                                                                                                                                    -,
                                                                                                                                                                    m_filter_criteria
                        )))))) -> value v_response {
        tc_ac.stop;

        // Extract HTTP Location header
        var charstring_list v_subscription_id;
        f_get_header(v_response.response.header, "Location", v_subscription_id);
        // Extract HTTP subssription id
        p_subscription_id := regexp(
                                    v_subscription_id[0],
                                    "?+" & PX_ME_BWM_SUB_URI & "/(?*)",
                                    0
                                    );
        p_bw_chg_event_subscription := v_response.response.body.json_body.m_bw_chg_event_subscription;
        log("f_create_bw_chg_event_subscription: INFO: IUT successfully responds to the subscription: ", p_bw_chg_event_subscription);
        log("f_create_bw_chg_event_subscription: INFO: p_subscription_id: ", p_subscription_id);
      }
      [] tc_ac.timeout {
        log("f_create_qos_measure_subscription: INCONC: Expected message not received");
      }
    } // End of 'alt' statement

  }  // End of function f_create_bw_chg_event_subscription

  function f_delete_bw_chg_event_subscription(
                                             in charstring p_subscription_id
                                             ) runs on HttpComponent {
    var Headers v_headers;
    
    f_init_default_headers_list(-, -, v_headers);
    httpPort.send(
                  m_http_request(
                                 m_http_request_delete(
                                                       PICS_ROOT_API & PX_ME_BWM_SUB_URI & "/" & p_subscription_id,
                                                       v_headers
                  )));
    tc_ac.start;
    alt {
      [] httpPort.receive(
                          mw_http_response(
                                           mw_http_response_204_no_content
                          )) {
        tc_ac.stop;
      }
      [] tc_ac.timeout {
        log("f_delete_qos_subscription: INCONC: Expected message not received");
      }
    } // End of 'alt' statement
    
  } // End of function f_delete_qos_subscription

  function f_create_mts_session_info_resource(
  function f_create_mts_session_info_resource(
                                              in Json.String p_app_instance_id,
                                              in Json.String p_app_instance_id,
                                              out charstring p_mts_session_id,
                                              out charstring p_mts_session_id,
Loading