Commit db330b1e authored by Yann Garcia's avatar Yann Garcia
Browse files

Implement QoS Measurements Sub/Not TPs

parent a3bec823
Loading
Loading
Loading
Loading
Original line number Diff line number Diff line
Subproject commit fffe402b8aa3986bdab4b4bcced277c8b334a1ec
Subproject commit e7f13cca244490ee6f5fc6e80c6836384b562568
+1789 −493

File changed.

Preview size limit exceeded, changes collapsed.

+22 −0
Original line number Diff line number Diff line
@@ -24,7 +24,29 @@ module AtsMec_QoSMeasurementAPI_TestControl {
      execute(TC_MEC_MEC045_SRV_QOSLOOKUP_003_OK());
      execute(TC_MEC_MEC045_SRV_QOSLOOKUP_003_NF());

      execute(TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_OK_01());
      execute(TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_OK_02());
      execute(TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_OK_03());
      execute(TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_01());
      execute(TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_02());
      execute(TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_03());
      execute(TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_04());
      execute(TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_05());
      execute(TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_06());
      execute(TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_07());
      execute(TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_001_BR_08());

      execute(TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_002_OK());
      execute(TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_002_NF());

      execute(TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_003_OK());
      execute(TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_003_NF());

      execute(TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_004_OK_01());
      execute(TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_004_OK_02());
    }

      execute(TC_MEC_MEC045_SRV_QOS_MEAS_SUB_NOT_005_OK());
  }

} // End of module AtsMec_QoSMeasurementAPI_TestControl
 No newline at end of file
+128 −1
Original line number Diff line number Diff line
module QoSMeasurementAPI_Functions {

  // JSON
  import from Json all;

  // LibCommon
  import from LibCommon_BasicTypesAndValues all;
  import from LibCommon_Time all;
  import from LibCommon_VerdictControl all;
  import from LibCommon_Sync all;

  // LibHttp
  import from LibHttp_TypesAndValues all;
  import from LibHttp_Functions all;
  import from LibHttp_Templates all;
  import from LibHttp_JsonTemplates all;
  import from LibHttp_TestSystem all;

  // LibMec/QoSMeasurementAPI
  import from QoSMeasurementAPI_TypesAndValues all;
  import from QoSMeasurementAPI_Templates all;
  import from QoSMeasurementAPI_Pics all;
  import from QoSMeasurementAPI_Pixits all;

  // LibMec
  import from LibMec_TypesAndValues all;
  import from LibMec_Templates all;
  import from LibMec_Functions all;
  import from LibMec_Pics all;
  import from LibMec_Pixits all;


  function f_create_qos_measure_subscription(
                                             out QoSMeasureSubscription p_qos_measure_subscription,
                                             out charstring p_subscription_id,
                                             in template (omit) boolean p_test_notification := omit,
                                             in template (omit) TimeStamp p_expiryDeadline := omit
                                             ) 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_QOS_API_LIST_SUBS,
                                                     v_headers,
                                                     m_http_message_body_json(
                                                                              m_body_json_qos_measure_subscription(
                                                                                                                   m_qos_measure_subscription(
                                                                                                                                              {LATENCY, JITTER, THROUGHPUT},
                                                                                                                                              PX_QOS_MEAS_SUB_CALLBACK_URI,
                                                                                                                                              PX_MEASURING_PERIOD,
                                                                                                                                              -,
                                                                                                                                              { PX_USER },
                                                                                                                                              {
                                                                                                                                                m_flow_info(
                                                                                                                                                            m_flow_filter(
                                                                                                                                                                          PX_SOURCE_IP,
                                                                                                                                                                          {PX_SOURCE_PORT}
                                                                                                                                                            ))
                                                                                                                                              },
                                                                                                                                              -, -, -, -,
                                                                                                                                              p_test_notification,
                                                                                                                                              -,
                                                                                                                                              p_expiryDeadline
                  ))))));
    tc_ac.start;
    alt {
      [] httpPort.receive(
                          mw_http_response(
                                           mw_http_response_201_created(
                                                                        mw_http_message_body_json(
                                                                                                  mw_body_json_qos_measure_subscription(
                                                                                                                                        mw_qos_measure_subscription(
                                                                                                                                                                    {LATENCY, JITTER, THROUGHPUT},
                                                                                                                                                                    PX_QOS_MEAS_SUB_CALLBACK_URI,
                                                                                                                                                                    PX_MEASURING_PERIOD,
                                                                                                                                                                    mw_links
                          )))))) -> 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_QOS_API_LIST_SUBS & "/(?*)",
                                    0
                                    );
        p_qos_measure_subscription := v_response.response.body.json_body.qos_measure_subscription;
        log("f_create_qos_measure_subscription: INFO: IUT successfully responds to the subscription: ", p_qos_measure_subscription);
        log("f_create_qos_measure_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_qos_measure_subscription

  function f_delete_qos_measure_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_QOS_API_LIST_SUBS & "/" & 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_measure_subscription: INCONC: Expected message not received");
      }
    } // End of 'alt' statement
    
  } // End of function f_delete_qos_measure_subscription

} // End of module QoSMeasurementAPI_Functions
+29 −2
Original line number Diff line number Diff line
module QoSMeasurementAPI_Pixits {

    
  // JSON
  import from Json all;
  
  // LibCommon
  import from LibCommon_BasicTypesAndValues all;

  // LibMec/QoSMeasurementAPI
  import from QoSMeasurementAPI_TypesAndValues all;

  // LibMec
  import from LibMec_TypesAndValues all;

  modulepar Json.String PX_UNKNOWN_SUBSCRIPTION_ID := "UnknownSubId";

  modulepar Json.String PX_UNKNOWN_SUBSCRIPTION_TYPE := "UnknownSubType";

  modulepar Json.AnyURI PX_QOS_MEAS_SUB_CALLBACK_URI := "http://clientApp.example.com/location_notifications/123456";

  modulepar Json.String PX_USER := "10.100.0.1";

  modulepar Json.String PX_SOURCE_IP := "10.100.0.20";

  modulepar Json.UInteger PX_SOURCE_PORT := 12345;

  modulepar Json.UInteger PX_MEASURING_PERIOD := 30;

  modulepar Json.UInteger PX_NUMBER_OF_REPORTS := 10;

  modulepar Json.UInteger PX_REPORTING_INTERVAL := 30;

  modulepar Json.AnyURI PX_QOS_MEAS_SUB_WEB_SOCKET := "ws://clientApp.example.com/location_notifications/123456";

  modulepar Json.String PX_ACCESS_POINT_ID := "5g-small-cell-2";

  modulepar Json.String PX_ZONE_ID := "zone01";

  modulepar TimeStamp PX_EXPIRY_DEADLINE := { seconds := 30, nanoSeconds := 0 };

} // End of module QoSMeasurementAPI_Pixits
Loading