Commit 57402bdb authored by Garcia's avatar Garcia
Browse files

Add support of GNU oSip

parent 1c3d8144
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ LibSip__SIPTypesAndValues::REGISTER__Request,
LibSip__SIPTypesAndValues::REGISTER__Request>
{
public:
  explicit sip_codec_register_request() : codec<LibSip__SIPTypesAndValues::REGISTER__Request, LibSip__SIPTypesAndValues::REGISTER__Request>(), _sip_message{nullptr} { };
  explicit sip_codec_register_request() : codec<LibSip__SIPTypesAndValues::REGISTER__Request, LibSip__SIPTypesAndValues::REGISTER__Request>() { };
  virtual ~sip_codec_register_request() { };

  virtual int encode (const LibSip__SIPTypesAndValues::REGISTER__Request& msg, OCTETSTRING& data);
+5 −4
Original line number Diff line number Diff line
@@ -106,13 +106,13 @@ TTCN_FILES=`find .. -name '*.ttcn*'`
if [ "${OSTYPE}" == "cygwin" ]
then
    rm ../bin/*.exe ../lib/*.dll
    compiler.exe -e -f -g -l -L -M -O -t -R -U none ${TTCN_FILES} 2>&1 3>&1 | tee build.log
    compiler.exe -e -f -g -l -L -M -n -O -t -R -U none ${TTCN_FILES} 2>&1 3>&1 | tee build.log
    if [ "$?" == "1" ]
    then
        f_exit "Failed to compile ATS" 4
    fi
else
    compiler -e -f -g -l -L -M -O -t -R -U none ${TTCN_FILES} 2>&1 3>&1 | tee build.log
    compiler -e -f -g -l -L -M -n -O -t -R -U none ${TTCN_FILES} 2>&1 3>&1 | tee build.log
    if [ "$?" == "1" ]
    then 
        f_exit "Failed to generate ATS source code" 6
@@ -192,8 +192,8 @@ else
    fi
    LDFLAGS_DEBUG_MODE='s/LDFLAGS = /LDFLAGS = -g -pthread -fstack-check -fstack-protector/g'
fi
ADD_INCLUDE='/CPPFLAGS = /a\\CPPFLAGS += -I/usr/local/share -I$(PATH_DEV_EMCOM)/include -I$(PATH_DEV_EMCOM)/framework/include -I../include -I../../LibEmcom/Common/include -I../../LibEmcom/LibPemea/include -I$(HOME_INC) -I.'
ADD_LIBRARIES='s/LINUX_LIBS = -lxml2/LINUX_LIBS = -lrt -lxml2 -lpcap -lstdc++fs -lssl/g'
ADD_INCLUDE='/CPPFLAGS = /a\\CPPFLAGS += -I/usr/local/share -I$(PATH_DEV_EMCOM)/include -I$(PATH_DEV_EMCOM)/framework/include -I../include -I../../LibEmcom/Common/include -I../../LibEmcom/LibNg112/include -I$(HOME_FRAMEWORKS)/osip/include -I$(HOME_INC) -I.'
ADD_LIBRARIES='s/LINUX_LIBS = -lxml2/LINUX_LIBS = -lrt -lxml2 -lpcap -lstdc++fs -lssl -L\$\(HOME_FRAMEWORKS\)\/osip\/src\/osipparser2\/\.libs -losipparser2/g'
sed --in-place "${CXXFLAGS_DEBUG_MODE}" ./Makefile 
sed --in-place "${LDFLAGS_DEBUG_MODE}" ./Makefile
sed --in-place "${ADD_INCLUDE}" ./Makefile
@@ -237,5 +237,6 @@ if [ "$?" == "1" ]
then
    f_exit "Failed to generate ATS source code" 9
fi
export LD_LIBRARY_PATH=~/tmp/osip_aurelihein/src/osipparser2/.libs:$LD_LIBRARY_PATH
../bin/Ats${ATS_NAME} -v
f_exit "Build done successfully" 0
+5 −5
Original line number Diff line number Diff line
#!/bin/bash
#set -e
#set -vx
set -vx

function f_exit {
    cd ${CURPWD}
@@ -106,13 +106,13 @@ TTCN_FILES=`find .. -name '*.ttcn*'`
if [ "${OSTYPE}" == "cygwin" ]
then
    rm ../bin/*.exe ../lib/*.dll
    compiler.exe -e -f -g -l -L -M -O -t -R -U none ${TTCN_FILES} 2>&1 3>&1 | tee build.log
    compiler.exe -e -f -g -l -L -M -n -O -t -R -U none ${TTCN_FILES} 2>&1 3>&1 | tee build.log
    if [ "$?" == "1" ]
    then
        f_exit "Failed to compile ATS" 4
    fi
else
    compiler -e -f -g -l -L -M -O -t -R -U none ${TTCN_FILES} 2>&1 3>&1 | tee build.log
    compiler -e -f -g -l -L -M -n -O -t -R -U none ${TTCN_FILES} 2>&1 3>&1 | tee build.log
    if [ "$?" == "1" ]
    then 
        f_exit "Failed to generate ATS source code" 6
@@ -192,8 +192,8 @@ else
    fi
    LDFLAGS_DEBUG_MODE='s/LDFLAGS = /LDFLAGS = -g -pthread -fstack-check -fstack-protector/g'
fi
ADD_INCLUDE='/CPPFLAGS = /a\\CPPFLAGS += -I/usr/local/share -I$(PATH_DEV_EMCOM)/include -I$(PATH_DEV_EMCOM)/framework/include -I../include -I../../LibEmcom/Common/include -I../../LibEmcom/LibPemea/include -I$(HOME_INC) -I.'
ADD_LIBRARIES='s/LINUX_LIBS = -lxml2/LINUX_LIBS = -lrt -lxml2 -lstdc++fs -lssl/g'
ADD_INCLUDE='/CPPFLAGS = /a\\CPPFLAGS += -I/usr/local/share -I$(PATH_DEV_EMCOM)/include -I$(PATH_DEV_EMCOM)/framework/include -I../include -I../../LibEmcom/Common/include -I../../LibEmcom/LibNg112/include -I$(HOME_FRAMEWORKS)/osip/include -I$(HOME_INC) -I.'
ADD_LIBRARIES='s/LINUX_LIBS = -lxml2/LINUX_LIBS = -lrt -lxml2 -lpcap -lstdc++fs -lssl -L\$\(HOME_FRAMEWORKS\)\/osip\/src\/osipparser2\/\.libs -losipparser2/g'
sed --in-place "${CXXFLAGS_DEBUG_MODE}" ./Makefile 
sed --in-place "${LDFLAGS_DEBUG_MODE}" ./Makefile
sed --in-place "${ADD_INCLUDE}" ./Makefile
+79 −20
Original line number Diff line number Diff line
@@ -39,20 +39,13 @@ module AtsNg112_TestCases {
    import from LibNg112_Pics all;
    import from LibNg112_Pixits all;
    
//    testcase TC_1() runs on SipComponent system TestAdapter {
//        
//        map(self:SIPP, system:SIPP);
//        
//        
//        unmap(self:SIPP, system:SIPP);
//    }
    
    /**
     * @desc "IUT successfully processes all mandatory HTTP headers when it receives a HTTP POST request" 
     * @desc "IUT successfully responds with a Point when it receives a HTTP POST location request without 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"
     *           "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"
     * @remark PICS Selection PICS_HTTP_POST_REQUEST PICS_LOCATION_HELD
     */
    testcase TC_LIS_HTTP_POST_BV_01() runs on HttpComponent system TestAdapter {
        // Local variables
@@ -79,11 +72,11 @@ module AtsNg112_TestCases {
                                                        PICS_LISP_URI,
                                                        v_headers,
                                                        m_http_message_body_xml(
                                                                                XmlBody: { locationRequest := valueof(m_locationRequest(
                                                                                                                                        m_device({PX_DEVICE_URI}).elem_list, 
                                                                                                                                        m_locationTypeType(m_locationTypeBase_all))) 
                                                                                         }
        ))));
                                                                                m_body_xml_location_request(
                                                                                                            m_locationRequest(
                                                                                                                              m_device({PX_DEVICE_URI}).elem_list
                                                                               )))
        )));
        f_selfOrClientSyncAndVerdictTestBody(c_prDone, e_success);
        
        // Test body
@@ -93,8 +86,9 @@ module AtsNg112_TestCases {
                                mw_http_response(
                                                 mw_http_response_ok(
                                                                     mw_http_message_body_xml(
                                                                                              XmlBody: { locationResponse := mw_locationResponse_dummy }
            )))) {
                                                                                              mw_body_xml_location_response(
                                                                                                                            mw_locationResponse_dummy
            ))))) {
                tc_ac.stop;
                log("*** " & testcasename() & ": PASS: Security protocol version set to 3 ***");
                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
@@ -110,4 +104,69 @@ module AtsNg112_TestCases {
        f_cf_01_http_down();
    } // End of testcase TC_LIS_HTTP_POST_BV_01
    
    /**
     * @desc IUT successfully responds with a Circle when it receives a HTTP POST location request without 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
     * @remark PICS Selection PICS_HTTP_POST_REQUEST PICS_LOCATION_HELD
     */
    testcase TC_LIS_HTTP_POST_BV_02() runs on HttpComponent system TestAdapter {
        // Local variables
        var HeaderLines v_headers;
        
        // Test control
        if ((not PICS_HTTP_POST_REQUEST) or (not PICS_LOCATION_HELD)) {
            log("*** " & testcasename() & ": PICS_HTTP_POST_REQUEST and PICS_LOCATION_HELD required for executing the TC ***");
            setverdict(inconc);
            stop;
        }
        
        // Test component configuration
        f_cf_02_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_get(
                                                        PICS_LISP_URI,
                                                        v_headers,
                                                        m_http_message_body_xml(
                                                                                m_body_xml_location_request(
                                                                                                            m_locationRequest(
                                                                                                                              m_device({PX_DEVICE_URI}).elem_list
                                                                               )))
        )));
        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(
                                                                                                                            mw_locationResponse_dummy
            ))))) {
                tc_ac.stop;
                log("*** " & testcasename() & ": PASS: Security protocol version set to 3 ***");
                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_02_http_down();
    } // End of testcase TC_LIS_HTTP_POST_BV_02
    
} // End of module AtsNg112_TestCases 
+1 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ module AtsNg112_TestControl {
    control {
        if (PICS_HTTP_POST_REQUEST and PICS_LOCATION_HELD) {
            execute(TC_LIS_HTTP_POST_BV_01());
            execute(TC_LIS_HTTP_POST_BV_02());
        }
    } // End of 'control' statement