Commit 0d82f43c authored by garciay's avatar garciay
Browse files

Validate TC_ECRF_HTTP_POST_BV_01

parent 6580ca29
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -440,7 +440,7 @@ int http_codec::decode_body(TTCN_Buffer& decoding_buffer, LibItsHttp__MessageBod
       LibItsHttp__XmlMessageBodyTypes::XmlBody xml_body;
       // TODO To be refined adding a string identifier to check which codec to use. E.g. held_code.id() returns "xmlns=\"urn:ietf:params:xml:ns:geopriv:held\">"
       if (
           (p["decode_str"].find("xmlns=\"urn:ietf:params:xml:ns:geopriv:held\">") != std::string::npos) ||
           (p["decode_str"].find("xmlns=\"urn:ietf:params:xml:ns:geopriv:held\"") != std::string::npos) ||
           (p["decode_str"].find("xmlns=\"urn:ietf:params:xml:ns:pidf\">") != std::string::npos)
           ) {
         loggers::get_instance().log("http_codec::decode_body: Identified Held'");
@@ -457,9 +457,8 @@ int http_codec::decode_body(TTCN_Buffer& decoding_buffer, LibItsHttp__MessageBod
           loggers::get_instance().warning("http_codec::decode_body: No codec for HELD");
           xml_body.raw() = CHARSTRING(body.lengthof(), (char*)static_cast<const unsigned char*>(body));
         }
         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'");
       } 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: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) {
@@ -473,11 +472,11 @@ int http_codec::decode_body(TTCN_Buffer& decoding_buffer, LibItsHttp__MessageBod
           loggers::get_instance().warning("http_codec::decode_body: No codec for LOST");
           xml_body.raw() = CHARSTRING(body.lengthof(), (char*)static_cast<const unsigned char*>(body));
         }
         message_body.xml__body() = xml_body;
       } else {
         loggers::get_instance().warning("http_codec::decode_body: No codec found");
         xml_body.raw() = CHARSTRING(body.lengthof(), (char*)static_cast<const unsigned char*>(body));
       }
       message_body.xml__body() = xml_body;
    } else if (p["decode_str"].find("<html>") != std::string::npos) { // Try to identify HTML
      loggers::get_instance().log("http_codec::decode_body: Find html message");
      LibItsHttp__MessageBodyTypes::TextBody txt_body;
+10 −9
Original line number Diff line number Diff line
@@ -41,10 +41,6 @@ int lost_codec::decode (const OCTETSTRING& p_data, LibItsHttp__XmlMessageBodyTyp
{
  loggers::get_instance().log_msg(">>> lost_codec::decode: p_data=", p_data);

  TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT);
  TTCN_EncDec::clear_error();
  TTCN_Buffer decoding_buffer(p_data);

  // Sanity checks
  params::const_iterator it;
  if (p_params == nullptr) {
@@ -58,14 +54,19 @@ int lost_codec::decode (const OCTETSTRING& p_data, LibItsHttp__XmlMessageBodyTyp
    }
  }
  
  if (it->second.find("<findService") != std::string::npos) {
    urn__ietf__params__xml__ns__lost1::FindService find_service;
    find_service.decode(urn__ietf__params__xml__ns__lost1::FindService_descr_, decoding_buffer, TTCN_EncDec::CT_XER, XER_EXTENDED);
    msg.findServiceRequest() = find_service;
  } else if (it->second.find("<findServiceResponse") != std::string::npos) {
  TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT);
  TTCN_EncDec::clear_error();
  TTCN_Buffer decoding_buffer(p_data);
  
  if (it->second.find("<findServiceResponse") != std::string::npos) {
    loggers::get_instance().warning("lost_codec::decode: Process FindServiceResponse");
    urn__ietf__params__xml__ns__lost1::FindServiceResponse find_service_response;
    find_service_response.decode(urn__ietf__params__xml__ns__lost1::FindServiceResponse_descr_, decoding_buffer, TTCN_EncDec::CT_XER, XER_EXTENDED);
    msg.findServiceResponse() = find_service_response;
 } else if (it->second.find("<findService") != std::string::npos) {
    urn__ietf__params__xml__ns__lost1::FindService find_service;
    find_service.decode(urn__ietf__params__xml__ns__lost1::FindService_descr_, decoding_buffer, TTCN_EncDec::CT_XER, XER_EXTENDED);
    msg.findServiceRequest() = find_service;
  } else {
    loggers::get_instance().warning("lost_codec::decode: Unsupported variant");
    return -1;
+9 −18
Original line number Diff line number Diff line
@@ -3,14 +3,14 @@

LibCommon_Time.PX_TAC := 30.0

LibItsHttp_Pics.PICS_HEADER_HOST := "location-information-service.azurewebsites.net"
#LibItsHttp_Pics.PICS_HEADER_HOST := "location-information-service.azurewebsites.net"
LibItsHttp_Pics.PICS_HEADER_HOST := "ptsv2.com"

LibNg112_Pics.PICS_LIS_URI := "/api/held"
#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>+331234567891</uri>" # Circle location
#LibNg112_Pixits.PX_DEVICE_URI_TEL := "<uri>+331234567892</uri>" # Civic 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_NUMBER_POINT := { 43.616891, 7.053179 }
LibNg112_Pixits.PX_CIRCLE_POS := { 43.617174, 7.05275 }
LibNg112_Pixits.PX_CIRCLE_RADIUS := 15.000
@@ -31,14 +31,10 @@ LogEventTypes:= Yes

[TESTPORT_PARAMETERS]
# In this section you can specify parameters that are passed to Test Ports.
<<<<<<< HEAD
system.SIPP.params := "SIP/UDP(dst_ip=192.168.1.250,dst_port=5060,src_ip=192.168.1.253,src_port=5060)/ETH(mac_src=080027d2b658,mac_dst=90fd61e61902,eth_type=0800)/PCAP(mac_src=080027d2b658,nic=eth1,filter=and udp port 12345)"
system.httpPort.params := "HTTP/TCP(debug=1,server=httpbin.org,port=80,use_ssl=0)"
=======
system.httpPort.params := "HTTP(codecs=lost:lost_codec;held:held_codec)/TCP(debug=1,server=location-information-service.azurewebsites.net,port=80,use_ssl=0)"
#system.httpPort.params := "HTTP(codecs=lost:lost_codec;held:held_codec)/TCP(debug=1,server=ptsv2.com,port=80,use_ssl=0)"
#system.httpPort.params := "HTTP(codecs=lost:lost_codec;held:held_codec)/TCP(debug=1,server=location-information-service.azurewebsites.net,port=80,use_ssl=0)"
system.httpPort.params := "HTTP(codecs=lost:lost_codec;held:held_codec)/TCP(debug=1,server=ptsv2.com,port=80,use_ssl=0)"

#system.SIPP.params := "SIP/UDP(dst_ip=192.168.1.250,dst_port=5060,src_ip=192.168.1.253,src_port=5060)/ETH(mac_src=080027d2b658,mac_dst=90fd61e61902,eth_type=0800)/PCAP(mac_src=080027d2b658,nic=eth1,filter=and udp port 12345)"
>>>>>>> TTCN_3_Developments

[DEFINE]
# In this section you can create macro definitions,
@@ -63,20 +59,15 @@ 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.
<<<<<<< HEAD
#AtsNg112_TestCases.TC_1
AtsNg112_TestCases.TC_2
=======
#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_GET_BV_01
#AtsNg112_TestCases.TC_LIS_HTTP_GET_BV_01
#AtsNg112_TestCases.TC_LIS_HTTP_GET_BV_02
#AtsNg112_TestCases.TC_ECRF_HTTP_POST_BV_01
>>>>>>> TTCN_3_Developments
AtsNg112_TestCases.TC_ECRF_HTTP_POST_BV_01

[GROUPS]
# In this section you can specify groups of hosts. These groups can be used inside the
+3 −2
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ chmod 775 ${VAGRANT_DIR}
# Execution path
RUN_PATH="${0%/*}"
PATH_DEV_EMCOM=`pwd`/../../etsi_emcom
SRC_EMCOM_PATH=~/dev/STF549_Ng112

# Update ETSI Framework files
echo 'Merging ETSI Framework files'
@@ -157,7 +158,7 @@ done
echo 'Update TTCN-3 files'
TTCN_3_ORG_PATH=${SRC_EMCOM_PATH}/ttcn
TTCN_3_DST_PATH=${PATH_DEV_EMCOM}/src
TTCN_3_ATS_LIST='AtsNg112 LibEmcom/LibNg112 LibCommon LibSip LibItsHttp'
TTCN_3_ATS_LIST='AtsNg112 LibEmcom/LibNg112 LibCommon LibSip LibHttp'
for i in ${TTCN_3_ATS_LIST}
do
    # TTCN-3 files
@@ -207,7 +208,7 @@ do
    fi
done

TTCN_3_LIB_LIST='LibHttp LibPemea'
TTCN_3_LIB_LIST='TestCodec'
for i in ${TTCN_3_LIB_LIST}
do
    LIST_TTCN_FILES=`find ${TTCN_3_ORG_PATH}/$i -name "*.ttcn" -type f`
+1 −7
Original line number Diff line number Diff line
@@ -35,13 +35,7 @@ module LibNg112_Pics {
  /**
   * @desc 
   */
  modulepar charstring PICS_LIS_URI := "/location";
  
  /**
   * @desc HTTP POST Uris
   * @see RFC 2616 Hypertext Transfer Protocol -- HTTP/1.1
   */
  //  modulepar request_uri_list PICS_LIS_REQUEST_URIs := { "/api/held", "/api/held", "/api/held" }; //{ "/t/9rk8l-1531130342/post", "/t/r143f-1528105031/post", "/t/6ouem-1531201238/post" };
  modulepar charstring PICS_LIS_URI := "/api/held";
  
  /**
   * @desc