Commit 65ada19a authored by garciay's avatar garciay
Browse files

Validate first ECRF test cases

parent 6d7e5ebb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -525,7 +525,7 @@ int http_codec::decode_body(TTCN_Buffer& decoding_buffer, LibItsHttp__MessageBod
         }
         message_body.xml__body() = xml_body;
       } else if (p["decode_str"].find("xmlns=\"urn:ietf:params:xml:ns:lost1\">") != std::string::npos) {
         loggers::get_instance().log("http_codec::decode_body: Find 'urn:ietf:params:xml:ns:loat1'");
         loggers::get_instance().log("http_codec::decode_body: Find 'urn:ietf:params:xml:ns:lost1'");
         if (_codecs["lost"].get() != nullptr) {
           loggers::get_instance().log("http_codec::decode_body: Call 'lost_codec'");
           if (_codecs["lost"]->decode(body, (Record_Type&)xml_body, &p) == -1) {
+2 −2
Original line number Diff line number Diff line
@@ -38,9 +38,9 @@ int lost_codec::encode (const LibItsHttp__XmlMessageBodyTypes::XmlBody& msg, OCT
  loggers::get_instance().log("lost_codec::encode: Before work-around: %s", str.c_str());
  std::size_t it = str.find("pointType");
  if (it != std::string::npos) {
    str = str.substr(0, it + 5) + str.substr(it + 9);
    str = str.substr(0, it) + "Point" + str.substr(it + 9);
    it = str.find("pointType");
    str = str.substr(0, it + 5) + str.substr(it + 9);
    str = str.substr(0, it) + "Point" + str.substr(it + 9);
  }
  
  data = OCTETSTRING(str.length(), (const unsigned char*)str.c_str());
+8 −10
Original line number Diff line number Diff line
@@ -50,6 +50,8 @@ int sip_codec_request::decode (const OCTETSTRING& data, LibSip__SIPTypesAndValue
    return -1;
  }

  TRACE_INITIALIZE(TRACE_LEVEL7, NULL);
  
  osip_message_t* sip_message;
  ::parser_init();
  int result = ::osip_message_init(&sip_message);
@@ -935,10 +937,9 @@ void sip_codec_request::decode_headers(const osip_message_t* p_sip_message, LibS

  // List unprocessed headers
  int i = 0;
  char *hvalue;
  while (::osip_message_get_unsupported(p_sip_message, i, &hvalue) == 0) {
    loggers::get_instance().warning("sip_codec_request::decode_header: '%s' was not processed", hvalue);
    osip_free(hvalue);
  osip_header_t* h_;
  while (::osip_message_get_header(p_sip_message, i++, &h_) == 0) {
    loggers::get_instance().warning("sip_codec_request::decode_header (1): '%s'/'%s' was not processed", h_->hname, h_->hvalue);
  } // End of 'while' statement
  
  loggers::get_instance().log_msg("<<< sip_codec_request::decode_headers: ", p_request);
@@ -948,14 +949,11 @@ void sip_codec_request::decode_message_body(const osip_message_t* p_sip_message,
{
  loggers::get_instance().log(">>> sip_codec_request::decode_message_body");

  osip_content_type_t* content_type = ::osip_message_get_content_type(p_sip_message);
  osip_body_t* body;
  int result = ::osip_message_get_body(p_sip_message, 0, &body);
  loggers::get_instance().log("sip_codec_request::decode_message_body: result=%d", result);
  loggers::get_instance().log("sip_codec_request::decode_message_body: body=%s", body->body);
  loggers::get_instance().log("sip_codec_request::decode_message_body: content-type=%p", body->content_type);
  loggers::get_instance().log("sip_codec_request::decode_message_body: body headers size=%d", ::osip_list_size(body->headers));
  osip_content_type_t* content_type = ::osip_message_get_content_type(p_sip_message);
  if (content_type != nullptr) {
    loggers::get_instance().log("sip_codec_request::decode_message_body: result=%d", result);
    loggers::get_instance().log("sip_codec_request::decode_message_body: content-type.type: %s", content_type->type);
    loggers::get_instance().log("sip_codec_request::decode_message_body: content-type.subtype: %s", content_type->subtype);
    LibSip__MessageBodyTypes::MessageBody m;
@@ -1019,7 +1017,7 @@ void sip_codec_request::decode_message_body(const osip_message_t* p_sip_message,
      m.textplain() = CHARSTRING(body->body);
    }
    p_request.messageBody() = OPTIONAL<LibSip__MessageBodyTypes::MessageBody>(m);
  } else if (body->body != nullptr) {
  } else if ((body != nullptr) && (body->body != nullptr)) {
    LibSip__MessageBodyTypes::MessageBody m;
    m.textplain() = CHARSTRING(body->body);
    p_request.messageBody() = OPTIONAL<LibSip__MessageBodyTypes::MessageBody>(m);
+12 −9
Original line number Diff line number Diff line
@@ -3,21 +3,22 @@

LibCommon_Time.PX_TAC := 30.0

LibItsHttp_Pics.PICS_HEADER_HOST := "e4iutdpic5.execute-api.eu-central-1.amazonaws.com" # Used for LIS
#LibItsHttp_Pics.PICS_HEADER_HOST := "6fsrcxrqm1.execute-api.eu-central-1.amazonaws.com" # Used for ECRF
#LibItsHttp_Pics.PICS_HEADER_HOST := "e4iutdpic5.execute-api.eu-central-1.amazonaws.com" # Used for LIS
LibItsHttp_Pics.PICS_HEADER_HOST := "6fsrcxrqm1.execute-api.eu-central-1.amazonaws.com" # Used for ECRF
#LibItsHttp_Pics.PICS_HEADER_HOST := "ptsv2.com"

LibNg112_Pics.PICS_LIS_URI := "/Prod";
#LibNg112_Pics.PICS_ECRF_URI := "/Prod";
LibNg112_Pics.PICS_ECRF_URI := "/Prod";

LibItsHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/held+xml;charset=utf-8";
#LibItsHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/lost+xml;charset=utf-8";
#LibItsHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/held+xml;charset=utf-8";
LibItsHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/lost+xml;charset=utf-8";

#LibNg112_Pics.PICS_HTTP_GET_REQUEST := false

LibNg112_Pixits.PX_DEVICE_URI_TEL := "<uri>+331234567890</uri>" # Position location
#LibNg112_Pixits.PX_DEVICE_URI_TEL := "<uri>+331234567890</uri>" # Position location
#LibNg112_Pixits.PX_DEVICE_URI_TEL := "<uri>+331234567891</uri>" # Circle location
#LibNg112_Pixits.PX_DEVICE_URI_TEL := "<uri>+331234567892</uri>" # Civic location
LibNg112_Pixits.PX_DEVICE_URI_TEL := "<uri>+331234567893</uri>" # Civic location
LibNg112_Pixits.PX_DEVICE_NUMBER_POINT := { 43.616891, 7.053179 }
LibNg112_Pixits.PX_CIRCLE_POS := { 43.617174, 7.05275 }
LibNg112_Pixits.PX_CIRCLE_RADIUS := 15.000
@@ -40,9 +41,9 @@ LogEventTypes:= Yes
# In this section you can specify parameters that are passed to Test Ports.

# LIS
system.httpPort.params := "HTTP(codecs=lost:lost_codec;held:held_codec)/TCP(debug=1,server=e4iutdpic5.execute-api.eu-central-1.amazonaws.com,use_ssl=1)"
#system.httpPort.params := "HTTP(codecs=lost:lost_codec;held:held_codec)/TCP(debug=1,server=e4iutdpic5.execute-api.eu-central-1.amazonaws.com,use_ssl=1)"
# ECRF
#system.httpPort.params := "HTTP(codecs=lost:lost_codec;held:held_codec)/TCP(debug=1,server=6fsrcxrqm1.execute-api.eu-central-1.amazonaws.com,use_ssl=1)"
system.httpPort.params := "HTTP(codecs=lost:lost_codec;held:held_codec)/TCP(debug=1,server=6fsrcxrqm1.execute-api.eu-central-1.amazonaws.com,use_ssl=1)"
# Test
#system.httpPort.params := "HTTP(codecs=lost:lost_codec;held:held_codec)/TCP(debug=1,server=ptsv2.com,port=80,use_ssl=0)"

@@ -71,15 +72,17 @@ system.httpPort.params := "HTTP(codecs=lost:lost_codec;held:held_codec)/TCP(debu

[EXECUTE]
# In this section you can specify what parts of your test suite you want to execute.
AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_01
#AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_01
#AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_02
#AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_03
#AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_04
#AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_05
#AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_06
#AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_07
#AtsNg112_TestCases.TC_LIS_HTTP_GET_BV_01
#AtsNg112_TestCases.TC_LIS_HTTP_GET_BV_02
#AtsNg112_TestCases.TC_ECRF_HTTP_POST_BV_01
AtsNg112_TestCases.TC_ECRF_HTTP_POST_BV_02

[GROUPS]
# In this section you can specify groups of hosts. These groups can be used inside the
+119 −27
Original line number Diff line number Diff line
@@ -97,7 +97,7 @@ module AtsNg112_TestCases {
     * @reference
     *           "ETSI TS 103 479 Vm.t.e (yyyy-mm) Clause 5.5 Location Information Server (LIS)",
     *           "Next Generation 112 Long Term Definition http://www.eena.org/uploads/gallery/files/pdf/2013-03-15-eena_ng_longtermdefinitionupdated.pdf Clause 4.10",
     *           "https://tools.ietf.org/html/rfc5985"
     *           "https://tools.ietf.org/html/rfc5985 - HTTP-Enabled Location Delivery (HELD)"
     * @remark PICS Selection PICS_HTTP_POST_REQUEST PICS_LOCATION_HELD
     * <pre>
     * Initial conditions with {
@@ -223,7 +223,7 @@ module AtsNg112_TestCases {
     * @reference
     *           ETSI TS 103 479 Vm.t.e (yyyy-mm) Clause 5.5 Location Information Server (LIS)
     *           Next Generation 112 Long Term Definition http://www.eena.org/uploads/gallery/files/pdf/2013-03-15-eena_ng_longtermdefinitionupdated.pdf Clause 4.10
     *           https://tools.ietf.org/html/rfc5985
     *           https://tools.ietf.org/html/rfc5985 - HTTP-Enabled Location Delivery (HELD)
     * @remark PICS Selection PICS_HTTP_POST_REQUEST PICS_LOCATION_HELD
     * <pre>
     * Initial conditions with {
@@ -348,7 +348,7 @@ module AtsNg112_TestCases {
     * @reference
     *           ETSI TS 103 479 Vm.t.e (yyyy-mm) Clause 5.5 Location Information Server (LIS)
     *           Next Generation 112 Long Term Definition http://www.eena.org/uploads/gallery/files/pdf/2013-03-15-eena_ng_longtermdefinitionupdated.pdf Clause 4.10
     *           https://tools.ietf.org/html/rfc5985
     *           https://tools.ietf.org/html/rfc5985 - HTTP-Enabled Location Delivery (HELD)
     * @remark PICS Selection PICS_HTTP_POST_REQUEST PICS_LOCATION_HELD
     * <pre>
     * Initial conditions with {
@@ -433,7 +433,7 @@ module AtsNg112_TestCases {
     * @reference
     *           ETSI TS 103 479 Vm.t.e (yyyy-mm) Clause 5.5 Location Information Server (LIS)
     *           Next Generation 112 Long Term Definition http://www.eena.org/uploads/gallery/files/pdf/2013-03-15-eena_ng_longtermdefinitionupdated.pdf Clause 4.10
     *           https://tools.ietf.org/html/rfc5985
     *           https://tools.ietf.org/html/rfc5985 - HTTP-Enabled Location Delivery (HELD)
     * @remark PICS Selection PICS_HTTP_POST_REQUEST PICS_LOCATION_HELD
     * <pre>
     * Initial conditions with {
@@ -562,7 +562,7 @@ module AtsNg112_TestCases {
     * @reference
     *           "ETSI TS 103 479 Vm.t.e (yyyy-mm) Clause 5.5 Location Information Server (LIS)",
     *           "Next Generation 112 Long Term Definition http://www.eena.org/uploads/gallery/files/pdf/2013-03-15-eena_ng_longtermdefinitionupdated.pdf Clause 4.10",
     *           "https://tools.ietf.org/html/rfc5985"
     *           "https://tools.ietf.org/html/rfc5985 - HTTP-Enabled Location Delivery (HELD)"
     * @remark PICS Selection PICS_HTTP_POST_REQUEST PICS_LOCATION_HELD
     * <pre>
     * Initial conditions with {
@@ -641,7 +641,7 @@ module AtsNg112_TestCases {
     * @reference
     *           ETSI TS 103 479 Vm.t.e (yyyy-mm) Clause 5.5 Location Information Server (LIS)
     *           Next Generation 112 Long Term Definition http://www.eena.org/uploads/gallery/files/pdf/2013-03-15-eena_ng_longtermdefinitionupdated.pdf Clause 4.10
     *           https://tools.ietf.org/html/rfc5985
     *           https://tools.ietf.org/html/rfc5985 - HTTP-Enabled Location Delivery (HELD)
     * @remark PICS Selection PICS_HTTP_POST_REQUEST PICS_LOCATION_HELD
     * <pre>
     * Initial conditions with {
@@ -763,12 +763,92 @@ module AtsNg112_TestCases {
        f_cf_01_http_down();
    } // End of testcase TC_LIS_HTTP_POST_BV_06
    
    /**
     * @desc IUT successfully responds with an error response when it receives a HTTP POST location request with an unknown location type
     * @reference
     *           ETSI TS 103 479 Vm.t.e (yyyy-mm) Clause 5.5 Location Information Server (LIS)
     *           Next Generation 112 Long Term Definition http://www.eena.org/uploads/gallery/files/pdf/2013-03-15-eena_ng_longtermdefinitionupdated.pdf Clause 4.10
     *           https://tools.ietf.org/html/rfc5985 - HTTP-Enabled Location Delivery (HELD)
     * @remark PICS Selection PICS_HTTP_POST_REQUEST PICS_LOCATION_HELD
     * <pre>
     * Initial conditions with {
     *   the IUT entity havingLocationMappingFor the DEVICE_NUMBER_CIVIC containing
     *     "point" containing
     *       "position" indicating value POINT_POS
     *     ;
     *   ;
     * }
     * </pre>
     */
    testcase TC_LIS_HTTP_POST_BV_07() runs on HttpComponent system TestAdapter {
        // Local variables
        var HeaderLines v_headers;
        var HttpMessage v_response;
        
        // Test control
        if (not(PICS_LIS_IUT) or (not PICS_HTTP_POST_REQUEST) or (not PICS_LOCATION_HELD)) {
            log("*** " & testcasename() & ": PICS_LIS_IUT and PICS_HTTP_POST_REQUEST and PICS_LOCATION_HELD required for executing the TC ***");
            setverdict(inconc);
            stop;
        }
        
        // Test component configuration
        f_cf_01_http_up();
        
        // Test adapter configuration
        
        // Preamble
        f_init_default_headers_list(v_headers);
        f_remove_headears_list({ c_header_accept }, v_headers);
        httpPort.send(
                      m_http_request(
                                     m_http_request_post(
                                                         PICS_LIS_URI,
                                                         v_headers,
                                                         m_http_message_body_xml(m_body_xml_location_request(
                                                                                                             m_locationRequest(
                                                                                                                               { encvalue_unichar(valueof(m_device({ PX_DEVICE_URI_TEL }))) },
                                                                                                                               m_locationTypeType(
                                                                                                                                                  m_locationTypeBase_civic,
                                                                                                                                                  true
                                                                                                                                                  )
                                                                                                                               )
                                                                                                             )
                                                                                 )
                                                         )
                                     )
                      );
        f_selfOrClientSyncAndVerdictTestBody(c_prDone, e_success);
        
        // Test body
        tc_ac.start;
        alt {
          [] httpPort.receive(
                              mw_http_response(
                                               mw_http_response_ok(
                                                                   mw_http_message_body_xml(
                                                                                            mw_body_xml_location_response_error(
                                                                                                                                mw_error_type
                                                                                                                          ))))) -> value v_response {
            log("*** " & testcasename() & ": PASS: Expected error message received ***");
            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
          }
          [] tc_ac.timeout {
            log("*** " & testcasename() & ": INCONC: Expected message not received ***");
            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
          }
        } // End of 'alt' statement
        
        // Postamble
        f_cf_01_http_down();
    } // End of testcase TC_LIS_HTTP_POST_BV_07
    
    /**
     * @desc IUT successfully returns the location when a locationURI is dereferenced
     * @reference
     *           ETSI TS 103 479 Vm.t.e (yyyy-mm) Clause 5.5 Location Information Server (LIS)
     *           Next Generation 112 Long Term Definition http://www.eena.org/uploads/gallery/files/pdf/2013-03-15-eena_ng_longtermdefinitionupdated.pdf Clause 4.10
     *           https://tools.ietf.org/html/rfc5985
     *           https://tools.ietf.org/html/rfc5985 - HTTP-Enabled Location Delivery (HELD)
     * @remark PICS Selection PICS_HTTP_POST_REQUEST PICS_LOCATION_HELD
     * <pre>
     * Initial conditions with {
@@ -1046,7 +1126,13 @@ module AtsNg112_TestCases {
                                                                     mw_http_message_body_xml(
                                                                                              mw_body_xml_find_service_response(
                                                                                                                                mw_find_service_response(
                                                                                                                                                         { mw_mapping }
                                                                                                                                                         { mw_mapping(
                                                                                                                                                                      mw_expires_date_time(PX_LOST_EXPIRES),
                                                                                                                                                                      PX_LOST_LAST_UPDATED,
                                                                                                                                                                      PX_LOST_SOURCE,
                                                                                                                                                                      PX_LOST_SOURCE_ID,
                                                                                                                                                                      -,
                                                                                                                                                                      { PX_LOST_URI } ) }
            )))))) {
                tc_ac.stop;
                // TODO Need to decode content
@@ -1101,11 +1187,11 @@ module AtsNg112_TestCases {
        // Test adapter configuration
        
        // Preamble
        /*f_init_default_headers_list(v_headers);
        f_init_default_headers_list(v_headers);
        httpPort.send(
                      m_http_request(
                                     m_http_request_post(
                                                         PICS_ECRF_REQUEST_URIs[1],
                                                         PICS_ECRF_URI,
                                                         v_headers,
                                                         m_http_message_body_xml(
                                                                                 m_body_xml_find_service_request(
@@ -1113,12 +1199,12 @@ module AtsNg112_TestCases {
                                                                                                                                    {
                                                                                                                                      m_location(
                                                                                                                                                 PX_LOST_ID,
                                                                                                                                                     { m_extension_point( { m_notLost(encvalue_unichar(valueof(m_circle(m_center_group_pos(PX_CIRCLE_POS), m_radius(PX_CIRCLE_UOM, PX_CIRCLE_RADIUS), PX_SRS_NAME, "circle1")))) } ) },
                                                                                                                                                 { m_extension_point(encvalue_unichar(valueof(m_circle(m_center_group_pos(PX_CIRCLE_POS), m_radius(PX_SRS_NAME, PX_CIRCLE_RADIUS), "circle1")))) },
                                                                                                                                                 "geodetic-2d" // TODO Use a Pixit
                                                                                                                                                 )
                                                                                                                                      },
                                                                                                                                        { m_notLost(encvalue_unichar(valueof(m_circle(mw_center_group_pos(PX_CIRCLE_POS), m_radius(PX_CIRCLE_UOM, PX_CIRCLE_RADIUS), PX_SRS_NAME, "circle1")))) },
                                                                                                                                        PX_LOST_SERVICE_URN_2,
                                                                                 { /*m_notLost(encvalue_unichar(valueof(m_point(PX_LOST_NO_LOST, PX_SRS_NAME, "point1"))))*/ },
                                                                                                                                    PX_LOST_SERVICE_URN_1,
                                                                                                                                    true,
                                                                                                                                    value_
                                                                                                                                    )))
@@ -1134,11 +1220,17 @@ module AtsNg112_TestCases {
                                                                     mw_http_message_body_xml(
                                                                                              mw_body_xml_find_service_response(
                                                                                                                                mw_find_service_response(
                                                                                                                                                         { mw_mapping }
                                                                                                                                                         { mw_mapping(
                                                                                                                                                                      mw_expires_date_time(PX_LOST_EXPIRES),
                                                                                                                                                                      PX_LOST_LAST_UPDATED,
                                                                                                                                                                      PX_LOST_SOURCE,
                                                                                                                                                                      PX_LOST_SOURCE_ID,
                                                                                                                                                                      -,
                                                                                                                                                                      { PX_LOST_URI } ) }
            )))))) {
                tc_ac.stop;
                // TODO Need to decode content
                log("*** " & testcasename() & ": PASS: IUT successfully responds with a Circle ***");
                log("*** " & testcasename() & ": PASS: IUT successfully responds with a Point ***");
                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                
            }
@@ -1147,7 +1239,7 @@ module AtsNg112_TestCases {
                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
            }
        } // End of 'alt' statement
        */
        
        // Postamble
        f_cf_01_http_down();
    } // End of testcase TC_ECRF_HTTP_POST_BV_02
Loading