Commit c1b0f3e0 authored by Garcia's avatar Garcia
Browse files

Validate LIS test cases

parent d7f252aa
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -58,14 +58,21 @@ int held_codec::decode (const OCTETSTRING& p_data, LibItsHttp__XmlMessageBodyTyp
    }
  }
  
  if (it->second.find("LocationRequest") != std::string::npos) {
  if (it->second.find("<locationRequest") != std::string::npos) {
    urn__ietf__params__xml__ns__geopriv__held::LocationResponseType locationResponse;
    locationResponse.decode(urn__ietf__params__xml__ns__geopriv__held::LocationResponse_descr_, decoding_buffer, TTCN_EncDec::CT_XER, XER_EXTENDED);
    msg.locationResponse() = locationResponse;
  } else {
  } else if (it->second.find("<locationResponse") != std::string::npos) {
    urn__ietf__params__xml__ns__geopriv__held::LocationResponseType locationResponse;
    locationResponse.decode(urn__ietf__params__xml__ns__geopriv__held::LocationResponse_descr_, decoding_buffer, TTCN_EncDec::CT_XER, XER_EXTENDED);
    msg.locationResponse() = locationResponse;
  } else if (it->second.find("<error") != std::string::npos) {
    urn__ietf__params__xml__ns__geopriv__held::Error error;
    error.decode(urn__ietf__params__xml__ns__geopriv__held::Error_descr_, decoding_buffer, TTCN_EncDec::CT_XER, XER_EXTENDED);
    msg.errorType() = error;
  } else {
    loggers::get_instance().warning("held_codec::decode: Unsupported variant");
    return -1;
  }
  
  loggers::get_instance().log_msg("<<< held_codec::decode: ", (const Base_Type&)msg);
+7 −7
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ RUN echo "docker-titan-STF549" > /etc/hostname \
      libxml2-dev \
      lsof \
      ntp \
      openssh-server \
      pkg-config \
      qt5-default \
      qtmultimedia5-dev \
@@ -64,7 +65,7 @@ RUN echo "docker-titan-STF549" > /etc/hostname \
      xsltproc \
    && DEBIAN_FRONTEND=noninteractive apt-get autoremove --purge -y \
    && DEBIAN_FRONTEND=noninteractive apt-get autoclean \
    && useradd --create-home --shell /bin/bash etsi \
    && useradd --create-home --shell /bin/bash etsi --groups sudo username \
    && echo "etsi:etsi" | chpasswd \
    && adduser etsi sudo \
    && cd /home/etsi \
@@ -94,11 +95,10 @@ RUN cd /home/etsi/dev \
    && ls -ltr /home/etsi \
    && export HOME=/home/etsi \
    && cd /home/etsi/frameworks \
    && git clone https://github.com/vlm/asn1c.git asn1c \
    && cd asn1c \
    && test -f configure || autoreconf -iv \
    && git clone https://github.com/YannGarcia/osip.git osip \
    && cd osip \
    && ./configure --prefix=/home/etsi \
    && make && make install \
    && make \
    && cd /home/etsi/frameworks \
    && wget 'http://ftp.halifax.rwth-aachen.de/eclipse//technology/epp/downloads/release/oxygen/2/eclipse-cpp-oxygen-2-linux-gtk-x86_64.tar.gz' -Oeclipse-cpp-oxygen-2-linux-gtk-x86_64.tar.gz \
    && tar -zxvf ./eclipse-cpp-oxygen-2-linux-gtk-x86_64.tar.gz \
@@ -108,8 +108,8 @@ RUN cd /home/etsi/dev \
    && ./build_titan.bash \
    && . /home/etsi/devenv.bash \
    && ./update_emcom_project.bash \
    && cd ${HOME}/dev/etsi_emco/src/TestCodec/objs \
    && ../bin/testcodec_generate_makefile.bash \
    && cd ${HOME}/dev/etsi_emco/src/AtsNg112/objs \
    && ../bin/ng112.bash \
    && ../bin/run_all.bash 

CMD ["/bin/bash"]
+2 −0
Original line number Diff line number Diff line
@@ -47,6 +47,8 @@ system.httpPort.params := "HTTP(codecs=held:held_codec;html:html_codec;json:json
[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_02
AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_03

[GROUPS]
# In this section you can specify groups of hosts. These groups can be used inside the
+2 −2
Original line number Diff line number Diff line
@@ -58,9 +58,9 @@ then
    export TTCN3_LICENSE_FILE=${TTCN3_DIR}/etc/license/license.dat
    export PATH_DEV_TTCN=${HOME}/dev/ttcn3
    # ITS support
    export PATH_DEV_ITS=${HOME}/TriesAndDelete/etsi_its
    export PATH_DEV_ITS=${HOME}/dev/etsi_its
    # Emergency Communication support
    export PATH_DEV_EMCOM=${HOME}/TriesAndDelete/etsi_emcom
    export PATH_DEV_EMCOM=${HOME}/dev/etsi_emcom
fi

export BROWSER=netsurf
+48 −43
Original line number Diff line number Diff line
@@ -12,15 +12,34 @@
module AtsNg112_TestCases {
  
  // RFC5985 Held
  import from urn_ietf_params_xml_ns_geopriv_held language "XSD" all;
  import from urn_ietf_params_xml_ns_geopriv_held_id language "XSD" all;
  import from urn_ietf_params_xml_ns_pidf_geopriv10 language "XSD" all;
  import from urn_ietf_params_xml_ns_pidf_geopriv10_basicPolicy language "XSD" all;
  import from urn_ietf_params_xml_ns_geopriv_held language "XSD" all
    with {
        extension "File:../xsd/RFC5985_held.xsd";
    }
  // RFC6155 Held ID
  import from urn_ietf_params_xml_ns_geopriv_held_id language "XSD" all
    with {
        extension "File:../xsd/RFC6155_held_id.xsd";
    }
  import from urn_ietf_params_xml_ns_pidf_geopriv10 language "XSD" all
    with {
        extension "File:../xsd/RFC4119_geopriv10.xsd";
    }
  import from urn_ietf_params_xml_ns_pidf_geopriv10_basicPolicy language "XSD" all
    with {
        extension "File:../xsd/RFC4119_geopriv10_basic_policy.xsd";
    }
  
  import from urn_ietf_params_xml_ns_pidf_geopriv10_civicLoc language "XSD" all;
  import from urn_ietf_params_xml_ns_pidf_geopriv10_civicLoc language "XSD" all
    with {
        extension "File:../xsd/RFC4119_geopriv10_civicloc.xsd";
    }

  // 
  import from urn_ietf_params_xml_ns_pidf language "XSD" all;
  // RFC3863 
  import from urn_ietf_params_xml_ns_pidf language "XSD" all
    with {
        extension "File:../xsd/RFC3863_pidf.xsd";
    }
  
  // OpenGIS
  import from urn_ietf_params_xml_ns_pidf_geopriv10_geoShape language "XSD" all;
@@ -91,7 +110,7 @@ module AtsNg112_TestCases {
        httpPort.send(
                      m_http_request(
                                     m_http_request_post(
                                                         "/t/9rk8l-1531130342/post",
                                                         PICS_LIS_REQUEST_URIs[0],
                                                         v_headers,
                                                         m_http_message_body_xml(m_body_xml_location_request(
                                                                                                             m_locationRequest(
@@ -128,6 +147,7 @@ module AtsNg112_TestCases {
            v_temp := v_response.response.body.xml_body.locationResponse.elem_list[0];
            v_result := decvalue_unichar(v_temp, v_presence);
            if (v_result == 0) {
              log(match(v_presence, mw_presence)); // FIXME Required by TITAN to get details in case of mismatch
              if (match(v_presence, mw_presence)) {
                // Extract first Tuple element from Presence
                v_tuple := v_presence.tuple_list[0];
@@ -135,6 +155,7 @@ module AtsNg112_TestCases {
                // Extract Geopriv element from Tuple
                v_result := decvalue_unichar(v_temp, v_geopriv);
                if (v_result == 0) {
                  log(match(v_geopriv, mw_geopriv(mw_location_info({ ? })))); // FIXME Required by TITAN to get details in case of mismatch
                  if (match(v_geopriv, mw_geopriv(mw_location_info({ ? })))) {
                    // Extract Circle element from Tuple
                    v_temp := v_geopriv.location_info.elem_list[0];
@@ -214,7 +235,7 @@ module AtsNg112_TestCases {
        httpPort.send(
                      m_http_request(
                                     m_http_request_post(
                                                         "/t/r143f-1528105031/post",
                                                         PICS_LIS_REQUEST_URIs[1],
                                                         v_headers,
                                                         m_http_message_body_xml(m_body_xml_location_request(
                                                                                                             m_locationRequest(
@@ -251,6 +272,7 @@ module AtsNg112_TestCases {
            v_temp := v_response.response.body.xml_body.locationResponse.elem_list[0];
            v_result := decvalue_unichar(v_temp, v_presence);
            if (v_result == 0) {
              log(match(v_presence, mw_presence)); // FIXME Required by TITAN to get details in case of mismatch
              if (match(v_presence, mw_presence)) {
                // Extract first Tuple element from Presence
                v_tuple := v_presence.tuple_list[0];
@@ -258,12 +280,13 @@ module AtsNg112_TestCases {
                // Extract Geopriv element from Tuple
                v_result := decvalue_unichar(v_temp, v_geopriv);
                if (v_result == 0) {
                  log(match(v_geopriv, mw_geopriv(mw_location_info({ ? })))); // FIXME Required by TITAN to get details in case of mismatch
                  if (match(v_geopriv, mw_geopriv(mw_location_info({ ? })))) {
                    // Extract Circle element from Tuple
                    v_temp := v_geopriv.location_info.elem_list[0];
                    v_result := decvalue_unichar(v_temp, v_circle);
                    log(match(v_circle, mw_circle(mw_center_group_pos(PX_CIRCLE_POS), mw_radius(PX_CIRCLE_UOM, PX_CIRCLE_BASE), PX_SRS_NAME))); // FIXME Required by TITAN to get details in case of mismatch
                    if (match(v_circle, mw_circle(mw_center_group_pos(PX_CIRCLE_POS), mw_radius(PX_CIRCLE_UOM, PX_CIRCLE_BASE), PX_SRS_NAME))) {
                    log(match(v_circle, mw_circle(mw_center_group_pos(PX_CIRCLE_POS), mw_radius(PX_CIRCLE_UOM, (PX_CIRCLE_BASE - PX_DOUBLE_CMP_EPSILON .. PX_CIRCLE_BASE + PX_DOUBLE_CMP_EPSILON)), PX_SRS_NAME))); // FIXME Required by TITAN to get details in case of mismatch
                    if (match(v_circle, mw_circle(mw_center_group_pos(PX_CIRCLE_POS), mw_radius(PX_CIRCLE_UOM, (PX_CIRCLE_BASE - PX_DOUBLE_CMP_EPSILON .. PX_CIRCLE_BASE + PX_DOUBLE_CMP_EPSILON)), PX_SRS_NAME))) {
                      log("*** " & testcasename() & ": PASS: IUT successfully responds with a Point ***");
                      f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    } else {
@@ -338,7 +361,7 @@ module AtsNg112_TestCases {
        httpPort.send(
                      m_http_request(
                                     m_http_request_post(
                                                         "/t/r143f-1528105031/post",
                                                         PICS_LIS_REQUEST_URIs[2],
                                                         v_headers,
                                                         m_http_message_body_xml(m_body_xml_location_request(
                                                                                                             m_locationRequest(
@@ -359,30 +382,12 @@ module AtsNg112_TestCases {
                              mw_http_response(
                                               mw_http_response_ok(
                                                                   mw_http_message_body_xml(
                                                                                            mw_body_xml_location_response(
                                                                                                                          mw_locationResponse(-, ?)
                                                                                                                          ))))) -> value v_response {
            var Presence v_presence;
            var universal charstring v_temp;
            var integer v_result;
            
                                                                                            mw_body_xml_location_response_error(
                                                                                                                                mw_error_type
                                                                                                                                ))))) {
            tc_ac.stop;

            // Extract presence element from Location-Response
            v_temp := v_response.response.body.xml_body.locationResponse.elem_list[0];
            v_result := decvalue_unichar(v_temp, v_presence);
            if (v_result == 0) {
              if (match(v_presence, mw_presence)) {
            log("*** " & testcasename() & ": PASS: Error message received ***");
            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
              } else {
                log("*** " & testcasename() & ": FAIL: Unexpected response ***");
                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
              }
            } else {
              log("*** " & testcasename() & ": FAIL: Unexpected response ***");
              f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
            }
          }
          [] tc_ac.timeout {
            log("*** " & testcasename() & ": INCONC: Expected message not received ***");
@@ -439,7 +444,7 @@ module AtsNg112_TestCases {
        f_remove_headears_list({ c_header_accept }, v_headers);
        httpPort.send(
                      m_http_request(
                                     m_http_request_get(
                                     m_http_request_post(
                                                         PICS_ECRF_URI,
                                                         v_headers,
                                                         m_http_message_body_xml(
Loading