Commit ca00cdd3 authored by YannGarcia's avatar YannGarcia
Browse files

Bug fixed in script 40-ttf_t012.sh

parent 4b434a8b
Loading
Loading
Loading
Loading
+22 −5
Original line number Original line Diff line number Diff line
@@ -475,17 +475,29 @@ int json_codec::decode (const OCTETSTRING& p_data, LibItsHttp__JsonMessageBodyTy
    msg.provChgPc5Notification() = prov_chg_pc5_notification;
    msg.provChgPc5Notification() = prov_chg_pc5_notification;





  } else if (it->second.find("\"AssocStaSubscription\"") != std::string::npos) {
  } else if (it->second.find("\"AssocStaSubscription\"") != std::string::npos) {
    if (it->second.find("\"subscription\"") != std::string::npos) { // SubscriptionLinkList
      WlanInformationAPI__TypesAndValues::SubscriptionLinkList subscription_link_list;
      TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
      subscription_link_list.decode(WlanInformationAPI__TypesAndValues::SubscriptionLinkList_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
      msg.subscriptionLinkList__wlan() = subscription_link_list;
    } else { // AssocStaSubscription
      WlanInformationAPI__TypesAndValues::AssocStaSubscription assoc_sta_subscription;
      WlanInformationAPI__TypesAndValues::AssocStaSubscription assoc_sta_subscription;
      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()));
      assoc_sta_subscription.decode(WlanInformationAPI__TypesAndValues::AssocStaSubscription_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
      assoc_sta_subscription.decode(WlanInformationAPI__TypesAndValues::AssocStaSubscription_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
      msg.assocStaSubscription() = assoc_sta_subscription;
      msg.assocStaSubscription() = assoc_sta_subscription;
    }
  } else if (it->second.find("\"StaDataRateSubscription\"") != std::string::npos) {
  } else if (it->second.find("\"StaDataRateSubscription\"") != std::string::npos) {
    WlanInformationAPI__TypesAndValues::StaDataRateSubscription sta_data_rate_subscription;
    WlanInformationAPI__TypesAndValues::StaDataRateSubscription sta_data_rate_subscription;
    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()));
    sta_data_rate_subscription.decode(WlanInformationAPI__TypesAndValues::StaDataRateSubscription_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
    sta_data_rate_subscription.decode(WlanInformationAPI__TypesAndValues::StaDataRateSubscription_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
    msg.staDataRateSubscription() = sta_data_rate_subscription;
    msg.staDataRateSubscription() = sta_data_rate_subscription;
  } else if ((it->second.find("\"_links\"") != std::string::npos) && (it->second.find("subscriptions") != std::string::npos)) { // SubscriptionLinkList
    // decode_str: {"_links":{"self":{"href":"https://try-mec.etsi.org/sbxpb4c4k2/wai/v2/subscriptions"}}}
    WlanInformationAPI__TypesAndValues::SubscriptionLinkList subscription_link_list;
    TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
    subscription_link_list.decode(WlanInformationAPI__TypesAndValues::SubscriptionLinkList_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
    msg.subscriptionLinkList__wlan() = subscription_link_list;
  } else if ((it->second.find("\"apInfo\"") != std::string::npos) || (it->second.find("\"apId\"") != std::string::npos)) {
  } else if ((it->second.find("\"apInfo\"") != std::string::npos) || (it->second.find("\"apId\"") != std::string::npos)) {
    WlanInformationAPI__TypesAndValues::ApInfoList ap_info_list;
    WlanInformationAPI__TypesAndValues::ApInfoList ap_info_list;
    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()));
@@ -497,6 +509,11 @@ int json_codec::decode (const OCTETSTRING& p_data, LibItsHttp__JsonMessageBodyTy
    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()));
    sta_info_list.decode(WlanInformationAPI__TypesAndValues::StaInfoList_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
    sta_info_list.decode(WlanInformationAPI__TypesAndValues::StaInfoList_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
    msg.staInfoList() = sta_info_list;
    msg.staInfoList() = sta_info_list;
  } else if (it->second.find("\"AssocStaNotification\"") != std::string::npos) {
    WlanInformationAPI__TypesAndValues::AssocStaNotification assoc_sta_notification;
    TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str()));
    assoc_sta_notification.decode(WlanInformationAPI__TypesAndValues::AssocStaNotification_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
    msg.assocStaNotification() = assoc_sta_notification;






+2 −2
Original line number Original line Diff line number Diff line
@@ -78,10 +78,10 @@ tcp_layer::tcp_layer(const std::string & p_type, const std::string & param) : la
  if (server_mode) {
  if (server_mode) {
    parameter_set("serverPort", _params[params::local_port].c_str());
    parameter_set("serverPort", _params[params::local_port].c_str());
    if (ssl_mode) { // Add certificate bundle
    if (ssl_mode) { // Add certificate bundle
      parameter_set(ssl_verifycertificate_name(), "no");
      parameter_set(ssl_verifycertificate_name(), "yes");
      parameter_set(ssl_private_key_file_name(), "../certificates/out/privates/486c4cb43fcbcdb5f564824ad201cffb405f3d3659fc1facd5f5cb21d4ea64e0_server_rsa.key.pem");
      parameter_set(ssl_private_key_file_name(), "../certificates/out/privates/486c4cb43fcbcdb5f564824ad201cffb405f3d3659fc1facd5f5cb21d4ea64e0_server_rsa.key.pem");
      parameter_set(ssl_certificate_file_name(), "../certificates/out/certs/486c4cb43fcbcdb5f564824ad201cffb405f3d3659fc1facd5f5cb21d4ea64e0_server_rsa.cert.pem");
      parameter_set(ssl_certificate_file_name(), "../certificates/out/certs/486c4cb43fcbcdb5f564824ad201cffb405f3d3659fc1facd5f5cb21d4ea64e0_server_rsa.cert.pem");
      parameter_set(ssl_trustedCAlist_file_name(), "../certificates/out/certs/486c4cb43fcbcdb5f564824ad201cffb405f3d3659fc1facd5f5cb21d4ea64e0_server_rsa.cert.pem"); // FIXME Use a parameter
      parameter_set(ssl_trustedCAlist_file_name(), "../certificates/out/certs/CA_rsa.cert.pem"); // FIXME Use a parameter
    }
    }
  }
  }
  set_ttcn_buffer_usercontrol(false);
  set_ttcn_buffer_usercontrol(false);
+6 −0
Original line number Original line Diff line number Diff line
@@ -31,3 +31,9 @@ make


echo -e "*****************************\n* Init Eclipse Workspace\n*****************************\n"
echo -e "*****************************\n* Init Eclipse Workspace\n*****************************\n"


echo -e "*****************************\n* Change sudo in command line\n*****************************\n"
cd /home/etsi/dev/ETSI_Ng112/scripts
sed --in-place 's/sudo/echo "etsi" \| sudo -S/' ./run_mtc.bash
sed --in-place 's/sudo/echo "etsi" \| sudo -S/' ./run_ptcs.bash

cd /home/etsi/dev/TTF_T012_Mec
+5 −5
Original line number Original line Diff line number Diff line
@@ -14,7 +14,7 @@ LibItsHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json"
LibItsHttp_Pics.PICS_USE_TOKEN_HEADER    := true
LibItsHttp_Pics.PICS_USE_TOKEN_HEADER    := true
#LibItsHttp_Pics.PICS_TOKEN_HEADER        := "Basic WrongToken"
#LibItsHttp_Pics.PICS_TOKEN_HEADER        := "Basic WrongToken"


LibMec_Pics.PICS_ROOT_API               := "/sbxj2byamx" # Need to sign in on https://try-mec.etsi.org/, section 'Try-it from your MEC application'
LibMec_Pics.PICS_ROOT_API               := "/sbxpl1eil4" # Need to sign in on https://try-mec.etsi.org/, section 'Try-it from your MEC application'


# LibMec_Pixits
# LibMec_Pixits
LibMec_Pixits.PX_ME_APP_Q_ZONE_ID_URI     := "/location/v2/queries/zones"
LibMec_Pixits.PX_ME_APP_Q_ZONE_ID_URI     := "/location/v2/queries/zones"
@@ -86,8 +86,8 @@ WlanInformationAPI_Pixits.PX_ASSOC_STA_SUBSCRIPTION_CALLBACK := "https://yanngar
LogFile := "../logs/AtsMec/%e.%h-%r.%s"
LogFile := "../logs/AtsMec/%e.%h-%r.%s"
FileMask := LOG_ALL | USER | DEBUG | MATCHING
FileMask := LOG_ALL | USER | DEBUG | MATCHING
ConsoleMask := LOG_ALL | USER | DEBUG | MATCHING
ConsoleMask := LOG_ALL | USER | DEBUG | MATCHING
#FileMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT
#FileMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT | TESTCASE
#ConsoleMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT
#ConsoleMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT | TESTCASE
LogSourceInfo := Stack
LogSourceInfo := Stack
LogEntityName:= Yes
LogEntityName:= Yes
LogEventTypes:= Yes
LogEventTypes:= Yes
@@ -294,7 +294,7 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server


# ETSI GS MEC 028
# ETSI GS MEC 028
# Check that the IUT responds with the list of WLAN Access Point
# Check that the IUT responds with the list of WLAN Access Point
#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_001_OK
AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_001_OK
# Check that the IUT responds with the list of WLAN Access Point filtered by the macId provided as query parameter
# Check that the IUT responds with the list of WLAN Access Point filtered by the macId provided as query parameter
#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_002_OK
#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_002_OK
# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
@@ -306,7 +306,7 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server
# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_004_BR
#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_004_BR
# Check that the IUT responds with the requested list of subscription
# Check that the IUT responds with the requested list of subscription
AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_005_OK
#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_005_OK
# Check that the IUT responds with the requested list of subscription
# Check that the IUT responds with the requested list of subscription
#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_006_OK
#AtsMec_WlanInformationAPI_TestCases.TC_MEC_MEC028_SRV_WAI_006_OK
# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
# Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
+80 −124
Original line number Original line Diff line number Diff line
@@ -184,7 +184,7 @@ module AtsMec_WlanInformationAPI_TestCases {
        httpPort.send(
        httpPort.send(
                      m_http_request(
                      m_http_request(
                                     m_http_request_get(
                                     m_http_request_get(
                                                        PICS_ROOT_API & PX_ME_WLAN_QUERIES_URI & "/apId/ap_information?filter=(eq," & PX_WLAN_FILTER_FIELD & "," & PX_WLAN_FILTER_VALUE & ")", // Invalid requery
                                                        PICS_ROOT_API & PX_ME_WLAN_QUERIES_URI & "/apId/ap_information?filter=(ee," & PX_WLAN_FILTER_FIELD & "," & PX_WLAN_FILTER_VALUE & ")", // Invalid requery
                                                        v_headers
                                                        v_headers
                                                        )
                                                        )
                                     )
                                     )
@@ -356,7 +356,7 @@ module AtsMec_WlanInformationAPI_TestCases {
        httpPort.send(
        httpPort.send(
                      m_http_request(
                      m_http_request(
                                     m_http_request_get(
                                     m_http_request_get(
                                                        PICS_ROOT_API & PX_ME_WLAN_QUERIES_URI & "/staId/sta_information?filter=(eq," & PX_WLAN_FILTER_FIELD & "," & PX_WLAN_FILTER_VALUE & ")", // Invalid requery
                                                        PICS_ROOT_API & PX_ME_WLAN_QUERIES_URI & "/staId/sta_information?filter=(ee," & PX_WLAN_FILTER_FIELD & "," & PX_WLAN_FILTER_VALUE & ")", // Invalid requery
                                                        v_headers
                                                        v_headers
                                                        )
                                                        )
                                     )
                                     )
@@ -447,65 +447,6 @@ module AtsMec_WlanInformationAPI_TestCases {
        f_cf_01_http_down();
        f_cf_01_http_down();
    } // End of testcase TC_MEC_MEC028_SRV_WAI_005_OK
    } // End of testcase TC_MEC_MEC028_SRV_WAI_005_OK


    /**
     * @desc Check that the IUT responds with the requested list of subscription
     * @see https://forge.etsi.org/rep/mec/gs028-wai-api/blob/master/WlanInformationApi.json
     * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v2.2.1-dev/Test%20Purposes/MEC028/SRV/WAI/Subscription.tplan2
     */
    testcase TC_MEC_MEC028_SRV_WAI_005_BR() runs on HttpComponent system HttpTestAdapter {
        // Local variables
      var AssocStaSubscription v_assoc_sta_subscription;
        var Headers v_headers;
        var HttpMessage v_response;
        
        // Test control
        if (not(PICS_MEC_PLAT) or not(PICS_WLAN_INFORMATION_API_SUPPORTED)) {
            log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_WLAN_INFORMATION_API_SUPPORTED required for executing the TC ***");
            setverdict(inconc);
            stop;
        }
        
        // Test component configuration
        f_cf_01_http_up();
        
        // Test adapter configuration
        
        // Preamble
        f_create_assoc_sta_subscription(v_assoc_sta_subscription);
        f_init_default_headers_list(-, -, v_headers);
        httpPort.send(
                      m_http_request(
                                     m_http_request_get(
                                                        PICS_ROOT_API & PX_ME_WLAN_URI & "/subscriptions",
                                                        v_headers
                                                        )
                                     )
                      );
        f_selfOrClientSyncAndVerdict(c_prDone, e_success);

        // Test Body
        tc_ac.start;
        alt {
          [] httpPort.receive(
                              mw_http_response(
                                               mw_http_response_400_bad_request
                                               )) -> value v_response {
            tc_ac.stop;
            
            log("*** " & testcasename() & ": PASS: IUT successfully responds with a correct error code ***");
            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
          }
          [] tc_ac.timeout {
            log("*** " & testcasename() & ": INCONC: Expected message not received ***");
            f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
          }
        } // End of 'alt' statement
        
        // Postamble
        f_delete_assoc_sta_subscription(v_assoc_sta_subscription);
        f_cf_01_http_down();
    } // End of testcase TC_MEC_MEC028_SRV_WAI_005_BR

    /**
    /**
     * @desc Check that the IUT responds with the requested list of subscription
     * @desc Check that the IUT responds with the requested list of subscription
     * @see https://forge.etsi.org/rep/mec/gs028-wai-api/blob/master/WlanInformationApi.json
     * @see https://forge.etsi.org/rep/mec/gs028-wai-api/blob/master/WlanInformationApi.json
@@ -535,7 +476,7 @@ module AtsMec_WlanInformationAPI_TestCases {
      httpPort.send(
      httpPort.send(
                    m_http_request(
                    m_http_request(
                                   m_http_request_get(
                                   m_http_request_get(
                                                        PICS_ROOT_API & PX_ME_WLAN_URI & "/subscriptions/assoc_sta",
                                                      PICS_ROOT_API & PX_ME_WLAN_URI & "/subscriptions?subscription_type=assoc_sta",
                                                      v_headers
                                                      v_headers
                                                      )
                                                      )
                                   )
                                   )
@@ -683,6 +624,15 @@ module AtsMec_WlanInformationAPI_TestCases {
        f_cf_01_http_down();
        f_cf_01_http_down();
    } // End of testcase TC_MEC_MEC028_SRV_WAI_006_NF
    } // End of testcase TC_MEC_MEC028_SRV_WAI_006_NF


    /***
      var charstring v_uri;
      v_uri := regexp(
                      oct2char(unichar2oct(v_assoc_sta_subscription.links.self_.href)),
                      "?+(" & PX_ME_WLAN_URI & "?*)",
                      0
                      );
    ***/

    /**
    /**
     * @desc Check that the IUT responds with the list of Station Point filtered by the macId provided as query parameter
     * @desc Check that the IUT responds with the list of Station Point filtered by the macId provided as query parameter
     * @see https://forge.etsi.org/rep/mec/gs028-wai-api/blob/master/WlanInformationApi.json
     * @see https://forge.etsi.org/rep/mec/gs028-wai-api/blob/master/WlanInformationApi.json
@@ -718,6 +668,12 @@ module AtsMec_WlanInformationAPI_TestCases {
                                                                                                                                              PX_ASSOC_STA_SUBSCRIPTION_CALLBACK,
                                                                                                                                              PX_ASSOC_STA_SUBSCRIPTION_CALLBACK,
                                                                                                                                              m_ap_identity(
                                                                                                                                              m_ap_identity(
                                                                                                                                                            PX_MAC_ID
                                                                                                                                                            PX_MAC_ID
                                                                                                                                                            ),
                                                                                                                                              -, -, -,
                                                                                                                                              10, // notificationPeriod - Table 6.3.2-1: Attributes of the AssocStaSubscription Note 2
                                                                                                                                              -,
                                                                                                                                              m_time_stamp(
                                                                                                                                                           f_get_current_timestamp_utc() / 1000 + 30 // Expiry time: T + 30 seconds
                                                                                                                                                           )))))));
                                                                                                                                                           )))))));
        f_selfOrClientSyncAndVerdict(c_prDone, e_success);
        f_selfOrClientSyncAndVerdict(c_prDone, e_success);


@@ -726,7 +682,7 @@ module AtsMec_WlanInformationAPI_TestCases {
        alt {
        alt {
          [] httpPort.receive(
          [] httpPort.receive(
                              mw_http_response(
                              mw_http_response(
                                               mw_http_response_ok(
                                               mw_http_response_201_created(
                                                                            mw_http_message_body_json(
                                                                            mw_http_message_body_json(
                                                                                                      mw_body_json_assoc_sta_subscription(
                                                                                                      mw_body_json_assoc_sta_subscription(
                                                                                                                                          mw_assoc_sta_subscription(
                                                                                                                                          mw_assoc_sta_subscription(
Loading