Commit 49eadc03 authored by Yann Garcia's avatar Yann Garcia
Browse files

Implementation od MEC 040 TPs

parent 15517809
Loading
Loading
Loading
Loading
+1844 −2

File changed.

Preview size limit exceeded, changes collapsed.

+42 −0
Original line number Diff line number Diff line
@@ -11,6 +11,48 @@ module AtsMec_FederationEnablementAPI_TestControl {
  
  control {

    if (PICS_FED_API_SUPPORTED) {

      if (PICS_MEC_PLAT and PICS_SERVICES) {
        execute(TC_MEC_MEC040_SRV_MEF_001_OK_01());
        execute(TC_MEC_MEC040_SRV_MEF_001_OK_02());
        execute(TC_MEC_MEC040_SRV_MEF_001_OK_03());
        execute(TC_MEC_MEC040_SRV_MEF_001_OK_04());
        execute(TC_MEC_MEC040_SRV_MEF_001_OK_05());
        execute(TC_MEC_MEC040_SRV_MEF_001_OK_06());
        execute(TC_MEC_MEC040_SRV_MEF_001_OK_07());
        execute(TC_MEC_MEC040_SRV_MEF_001_OK_08());
        execute(TC_MEC_MEC040_SRV_MEF_001_OK_09());
        execute(TC_MEC_MEC040_SRV_MEF_001_OK_10());
        execute(TC_MEC_MEC040_SRV_MEF_001_OK_11());

        execute(TC_MEC_MEC040_SRV_MEF_001_NF_01());
        execute(TC_MEC_MEC040_SRV_MEF_001_NF_02());
        execute(TC_MEC_MEC040_SRV_MEF_001_NF_03());

        execute(TC_MEC_MEC040_SRV_MEF_001_BR());

        execute(TC_MEC_MEC040_SRV_MEF_002_OK());
        execute(TC_MEC_MEC040_SRV_MEF_002_BR_01());
        execute(TC_MEC_MEC040_SRV_MEF_002_BR_02());

        execute(TC_MEC_MEC040_SRV_MEF_003_OK());
        execute(TC_MEC_MEC040_SRV_MEF_003_NF());

        execute(TC_MEC_MEC040_SRV_MEF_004_OK_01());
        execute(TC_MEC_MEC040_SRV_MEF_004_OK_02());
        execute(TC_MEC_MEC040_SRV_MEF_004_OK_03());

        execute(TC_MEC_MEC040_SRV_MEF_004_NF());
        execute(TC_MEC_MEC040_SRV_MEF_004_BR_01());
        execute(TC_MEC_MEC040_SRV_MEF_004_BR_02());

        execute(TC_MEC_MEC040_SRV_MEF_005_OK());
        execute(TC_MEC_MEC040_SRV_MEF_005_NF());
      }

    }

  } // End of 'control' statement

} // End of module AtsMec_FederationEnablementAPI_TestControl
+113 −0
Original line number Diff line number Diff line
module FederationEnablementAPI_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 FederationEnablementAPI_TypesAndValues all;
  import from FederationEnablementAPI_Templates all;
  import from FederationEnablementAPI_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_system_info(
                                out SystemInfo p_system_info
                                ) 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_FED_API_SUB,
                                                     v_headers,
                                                     m_http_message_body_json(
                                                                              m_body_json_fed_system_info(
                                                                                                          m_system_info(
                                                                                                                        PX_FED_SYSTEM_NAME_1,
                                                                                                                        PX_FED_SYSTEM_PROVIDER_1
                  ))))));
    tc_ac.start;
    alt {
      [] httpPort.receive(
                          mw_http_response(
                                          mw_http_response_201_created(
                                                                      mw_http_message_body_json(
                                                                                                mw_body_json_fed_system_info(
                                                                                                                             mw_system_info(
                                                                                                                                             PX_FED_SYSTEM_PROVIDER_1,
                                                                                                                                             PX_FED_SYSTEM_NAME_1,
                                                                                                                                             PX_FED_SYSTEM_ID_1
                          )))))) -> value v_response {
        tc_ac.stop;

        p_system_info := v_response.response.body.json_body.systemInfo;
        log("f_create_system_info: INFO: IUT successfully responds to the subscription: ", p_system_info);
      }
      [] tc_ac.timeout {
        log("f_create_system_info: INCONC: Expected message not received");
      }
    } // End of 'alt' statement
  
  } // End of function f_create_system_info

  function f_delete_system_info(
                                in SystemInfo p_system_info
                                ) 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_delete(
                                                       PICS_ROOT_API & PX_FED_API_SUB & "/" & oct2char(unichar2oct(p_system_info.systemId, "UTF-8")),
                                                       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_system_info: INCONC: Expected message not received");
        }
    } // End of 'alt' statement
  
  } // End of function f_delete_system_info

  function f_create_system_info_list(
                                     out SystemInfoList p_system_info_list
                                     ) runs on HttpComponent {
    for (var integer i := 0; i < lengthof(p_system_info_list); i := i + 1) {
        f_create_system_info(p_system_info_list[i]);
    }
  } // End of function f_create_system_info_list

  function f_delete_system_info_list(
                                     in SystemInfoList p_system_info_list
                                     ) runs on HttpComponent {
    for (var integer i := 0; i < lengthof(p_system_info_list); i := i + 1) {
        f_delete_system_info(p_system_info_list[i]);
    }
  } // End of function f_delete_system_info_list

} // End of modue FederationEnablementAPI_Functions
 No newline at end of file
+5 −0
Original line number Diff line number Diff line
module FederationEnablementAPI_Pics {
    
  /**
   * @desc Does the IUT support MEC Federation API?
   */
  modulepar boolean PICS_FED_API_SUPPORTED := true;
  
} // End of module FederationEnablementAPI_Pics
 No newline at end of file
+39 −0
Original line number Diff line number Diff line
module FederationEnablementAPI_Pixits {
    
  // JSON
  import from Json all;
  
  // LibCommon
  import from LibCommon_BasicTypesAndValues all;

  // LibMec/FixedAccessInformationServiceAPI
  import from FederationEnablementAPI_TypesAndValues all;

  modulepar Json.String PX_FED_SYSTEM_ID_1             := "";

  modulepar Json.String PX_FED_SYSTEM_NAME_1           := "";

  modulepar Json.String PX_FED_SYSTEM_PROVIDER_1       := "";

  modulepar Json.String PX_FED_SYSTEM_ID_2             := "";

  modulepar Json.String PX_FED_SYSTEM_NAME_2           := "";

  modulepar Json.String PX_FED_SYSTEM_PROVIDER_2       := "";

  modulepar Json.String PX_FED_SYSTEM_ID_3             := "";

  modulepar Json.String PX_FED_SYSTEM_NAME_3           := "";

  modulepar Json.String PX_FED_SYSTEM_PROVIDER_3       := "";

  modulepar Json.String PX_FED_SYSTEM_ID_UNKNOWN       := "";

  modulepar Json.String PX_FED_SYSTEM_NAME_UNKNOWN     := "";

  modulepar Json.String PX_FED_SYSTEM_PROVIDER_UNKNOWN := "";

  modulepar Json.String PX_FED_ENDPOINT_URI_1          := "";

  modulepar Json.String PX_FED_ENDPOINT_URI_2          := "";

  modulepar Json.String PX_FED_ENDPOINT_URI_3          := "";

} // End of module FederationEnablementAPI_Pixits
 No newline at end of file
Loading