Commit 4620d04f authored by Yann Garcia's avatar Yann Garcia
Browse files

TTF T027: Finalyze review MEC-030 & MEC-029

parent 4940e079
Loading
Loading
Loading
Loading
+698 −787

File changed.

Preview size limit exceeded, changes collapsed.

+38 −2
Original line number Diff line number Diff line
@@ -11,8 +11,44 @@ module AtsMec_FixedAccessInformationServiceAPI_TestControl {
  
  control {
    
    if (PICS_MEC_PLAT and PICS_FAI_API_SUPPORTED) {
      execute(TP_MEC_MEC029_SRV_FAIS_001_OK());
    if (PICS_MEC_PLAT and PICS_FAI_API_SUPPORTED and PICS_FAI_API_SUPPORTED) {
      execute(TC_MEC_MEC029_SRV_FAIS_001_OK());
      execute(TC_MEC_MEC029_SRV_FAIS_001_BR());
      execute(TC_MEC_MEC029_SRV_FAIS_001_NF());

      execute(TC_MEC_MEC029_SRV_FAIS_002_OK());
      execute(TC_MEC_MEC029_SRV_FAIS_002_BR());
      execute(TC_MEC_MEC029_SRV_FAIS_002_NF());

      execute(TC_MEC_MEC029_SRV_FAIS_003_OK());
      execute(TC_MEC_MEC029_SRV_FAIS_003_BR());
      execute(TC_MEC_MEC029_SRV_FAIS_003_NF());

      execute(TC_MEC_MEC029_SRV_FAIS_004_OK());
      execute(TC_MEC_MEC029_SRV_FAIS_004_BR());
      execute(TC_MEC_MEC029_SRV_FAIS_004_NF());

      execute(TC_MEC_MEC029_SRV_FAIS_005_OK());
      execute(TC_MEC_MEC029_SRV_FAIS_005_BR());
      execute(TC_MEC_MEC029_SRV_FAIS_005_NF());

      execute(TC_MEC_MEC029_SRV_FAIS_006_OK());
      execute(TC_MEC_MEC029_SRV_FAIS_006_BR());

      execute(TC_MEC_MEC029_SRV_FAIS_007_OK());
      execute(TC_MEC_MEC029_SRV_FAIS_007_NF());

      execute(TC_MEC_MEC029_SRV_FAIS_008_OK());
      execute(TC_MEC_MEC029_SRV_FAIS_008_BR());
      execute(TC_MEC_MEC029_SRV_FAIS_008_NF());
      execute(TC_MEC_MEC029_SRV_FAIS_008_PF());

      execute(TC_MEC_MEC029_SRV_FAIS_009_OK());
      execute(TC_MEC_MEC029_SRV_FAIS_009_NF());

      execute(TC_MEC_MEC029_SRV_FAIS_010_OK());

      execute(TC_MEC_MEC029_SRV_FAIS_011_OK());
    }
  } // End of 'control' statement

+1 −0
Original line number Diff line number Diff line
@@ -2,5 +2,6 @@ sources := \
    ttcn/FixedAccessInformationServiceAPI_Pics.ttcn \
    ttcn/FixedAccessInformationServiceAPI_Pixits.ttcn \
    ttcn/FixedAccessInformationServiceAPI_Templates.ttcn \
    ttcn/FixedAccessInformationServiceAPI_Functions.ttcn \
    ttcn/FixedAccessInformationServiceAPI_TypesAndValues.ttcn
+342 −0
Original line number Diff line number Diff line
module FixedAccessInformationServiceAPI_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/FixedAccessInformationServiceAPI
  import from FixedAccessInformationServiceAPI_TypesAndValues all;
  import from FixedAccessInformationServiceAPI_Templates all;
  import from FixedAccessInformationServiceAPI_Pixits all;

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

  function f_create_onu_alarm_subscription(
                                           out OnuAlarmSubscription p_onu_alarm_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_FAI_SUB_URI,
                                                     v_headers,
                                                     m_http_message_body_json(
                                                                              m_body_json_fai_onu_alarm_subscription(
                                                                                                                     m_onu_alarm_subscription(
                                                                                                                                              PX_ONU_ALARM_SUB_CALLBACK_URI,
                                                                                                                                              m_filter_criteria_onu_alarm
                  ))))));
    tc_ac.start;
    alt {
      [] httpPort.receive(
                          mw_http_response(
                                           mw_http_response_201_created(
                                                                        mw_http_message_body_json(
                                                                                                  mw_body_json_fai_onu_alarm_subscription(
                                                                                                                                          mw_onu_alarm_subscription(
                                                                                                                                                                    PX_ONU_ALARM_SUB_CALLBACK_URI
                          )))))) -> 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_FAI_SUB_URI & "/(?*)",
                                    0
                                    );
        p_onu_alarm_subscription := v_response.response.body.json_body.onuAlarmSubscription;
        log("f_create_onu_alarm_subscription: INFO: IUT successfully responds to the subscription: ", p_onu_alarm_subscription);
        log("f_create_onu_alarm_subscription: INFO: p_subscription_id: ", p_subscription_id);
      }
      [] tc_ac.timeout {
        log("f_create_onu_alarm_subscription: INCONC: Expected message not received");
      }
    } // End of 'alt' statement
    
  } // End of function f_create_onu_alarm_subscription

  function f_delete_onu_alarm_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_FAI_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_onu_alarm_subscription: INCONC: Expected message not received");
      }
    } // End of 'alt' statement
    
  } // End of function f_delete_onu_alarm_subscription

  function f_create_dev_info_subscription(
                                          out DevInfoSubscription p_dev_info_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_FAI_SUB_URI,
                                                     v_headers,
                                                     m_http_message_body_json(
                                                                              m_body_json_fai_dev_info_subscription(
                                                                                                                    m_dev_info_subscription(
                                                                                                                                            PX_DEV_ALARM_SUB_CALLBACK_URI,
                                                                                                                                            m_filter_criteria_dev_info
                  ))))));
    tc_ac.start;
    alt {
      [] httpPort.receive(
                          mw_http_response(
                                           mw_http_response_201_created(
                                                                        mw_http_message_body_json(
                                                                                                  mw_body_json_fai_onu_alarm_subscription(
                                                                                                                                          mw_onu_alarm_subscription(
                                                                                                                                                                    PX_ONU_ALARM_SUB_CALLBACK_URI
                          )))))) -> 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_FAI_SUB_URI & "/(?*)",
                                    0
                                    );
        p_dev_info_subscription := v_response.response.body.json_body.devInfoSubscription;
        log("f_create_dev_info_subscription: INFO: IUT successfully responds to the subscription: ", p_dev_info_subscription);
        log("f_create_dev_info_subscription: INFO: p_subscription_id: ", p_subscription_id);
      }
      [] tc_ac.timeout {
        log("f_create_onu_alarm_suf_create_dev_info_subscriptionbscription: INCONC: Expected message not received");
      }
    } // End of 'alt' statement
    
  } // End of function f_create_dev_info_subscription

  function f_delete_dev_info_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_FAI_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_dev_info_subscription: INCONC: Expected message not received");
      }
    } // End of 'alt' statement
    
  } // End of function f_delete_dev_info_subscription

  function f_create_cm_conn_subscription(
                                         out CmConnSubscription p_cm_conn_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_FAI_SUB_URI,
                                                     v_headers,
                                                     m_http_message_body_json(
                                                                              m_body_json_fai_cm_conn_subscription(
                                                                                                                   m_cm_conn_subscription(
                                                                                                                                          PX_CM_CONN_SUB_CALLBACK_URI
                                                                                                                                          //m_filter_criteria_dev_info
                  ))))));
    tc_ac.start;
    alt {
      [] httpPort.receive(
                          mw_http_response(
                                           mw_http_response_201_created(
                                                                        mw_http_message_body_json(
                                                                                                  mw_body_json_fai_onu_alarm_subscription(
                                                                                                                                          mw_onu_alarm_subscription(
                                                                                                                                                                    PX_CM_CONN_SUB_CALLBACK_URI
                          )))))) -> 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_FAI_SUB_URI & "/(?*)",
                                    0
                                    );
        p_cm_conn_subscription := v_response.response.body.json_body.cmConnSubscription;
        log("f_create_cm_conn_subscription: INFO: IUT successfully responds to the subscription: ", p_cm_conn_subscription);
        log("f_create_cm_conn_subscription: INFO: p_subscription_id: ", p_subscription_id);
      }
      [] tc_ac.timeout {
        log("f_create_onu_alarm_suf_create_cm_conn_subscriptionbscription: INCONC: Expected message not received");
      }
    } // End of 'alt' statement
    
  } // End of function f_create_cm_conn_subscription

  function f_delete_cm_conn_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_FAI_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_cm_conn_subscription: INCONC: Expected message not received");
      }
    } // End of 'alt' statement
    
  } // End of function f_delete_cm_conn_subscription

  function f_create_ani_alarm_subscription(
                                           out AniAlarmSubscription p_ani_alarm_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_FAI_SUB_URI,
                                                     v_headers,
                                                     m_http_message_body_json(
                                                                              m_body_json_fai_ani_alarm_subscription(
                                                                                                                     m_ani_alarm_subscription(
                                                                                                                                              PX_ANI_ALARM_SUB_CALLBACK_URI
                                                                                                                                              //m_filter_criteria_ani_alarm
                  ))))));
    tc_ac.start;
    alt {
      [] httpPort.receive(
                          mw_http_response(
                                           mw_http_response_201_created(
                                                                        mw_http_message_body_json(
                                                                                                  mw_body_json_fai_ani_alarm_subscription(
                                                                                                                                          mw_ani_alarm_subscription(
                                                                                                                                                                    PX_ANI_ALARM_SUB_CALLBACK_URI
                          )))))) -> 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_FAI_SUB_URI & "/(?*)",
                                    0
                                    );
        p_ani_alarm_subscription := v_response.response.body.json_body.aniAlarmSubscription;
        log("f_create_ani_alarm_subscription: INFO: IUT successfully responds to the subscription: ", p_ani_alarm_subscription);
        log("f_create_ani_alarm_subscription: INFO: p_subscription_id: ", p_subscription_id);
      }
      [] tc_ac.timeout {
        log("f_create_ani_alarm_subscription: INCONC: Expected message not received");
      }
    } // End of 'alt' statement
    
  } // End of function f_create_ani_alarm_subscription

  function f_delete_ani_alarm_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_FAI_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_ani_alarm_subscription: INCONC: Expected message not received");
      }
    } // End of 'alt' statement
    
  } // End of function f_delete_ani_alarm_subscription

} // End of module FixedAccessInformationServiceAPI_Functions
 No newline at end of file
+10 −4
Original line number Diff line number Diff line
@@ -6,10 +6,6 @@ module FixedAccessInformationServiceAPI_Pixits {
  // LibMec_FixedAccessInformationServiceAPI
  import from FixedAccessInformationServiceAPI_TypesAndValues all;
  
  modulepar GatewayIdList PX_FAI_GW_ID := { "" };
  
  modulepar GatewayIdList PX_NON_EXISTING_FAI_GW_ID := { "" };
  
  modulepar Json.String PX_FAI_CM_ID := "";
  
  modulepar Json.String PX_NON_EXISTING_FAI_CM_ID := "";
@@ -18,12 +14,22 @@ module FixedAccessInformationServiceAPI_Pixits {
  
  modulepar Json.String PX_NON_EXISTING_FAI_ONU_ID := "";
  
  modulepar Json.String PX_FAI_GW_ID := "";
  
  modulepar Json.String PX_NON_EXISTING_FAI_GW_ID := "";
  
  modulepar Json.String PX_FAI_SUB_ID := "";
  
  modulepar Json.String PX_NON_EXISTING_FAI_SUB_ID := "";
  
  modulepar Json.AnyURI PX_ONU_ALARM_SUB_CALLBACK_URI := "";
  
  modulepar Json.AnyURI PX_DEV_ALARM_SUB_CALLBACK_URI := "";
  
  modulepar Json.AnyURI PX_CM_CONN_SUB_CALLBACK_URI := "";
  
  modulepar Json.AnyURI PX_ANI_ALARM_SUB_CALLBACK_URI := "";
  
  modulepar Json.String PX_SUBSCRIPTION_ID := "";
  
  modulepar Json.String PX_NON_EXISTENT_SUBSCRIPTION_ID := "";
Loading