Commit 1b5d5f19 authored by Michael Proestler's avatar Michael Proestler
Browse files

Add TC_ESRP_FIND_SERVICE_BV_03

add mocks, add configuration
parent 71322d91
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -32,6 +32,9 @@ LogEventTypes:= Yes
Ecrf.httpPort.params := "HTTP(codecs=lost:lost_codec)/TCP(debug=1,server_mode=1,local_port=8080,use_ssl=0)"
EcrfRedirectTarget.httpPort.params := "HTTP(codecs=lost:lost_codec)/TCP(debug=1,server_mode=1,local_port=8082,use_ssl=0)"

# LIS
Lis.httpPort.params := "HTTP(codecs=held:held_codec)/TCP(debug=1,server_mode=1,local_port=8084,use_ssl=0)"

#system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=host.docker.internal,port=8090,use_ssl=0)"
#system.SIPP.params := "SIP/TCP(debug=1,server_mode=1,local_port=5070,use_ssl=0)"

+57 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">

<!-- This program is free software; you can redistribute it and/or      -->
<!-- modify it under the terms of the GNU General Public License as     -->
<!-- published by the Free Software Foundation; either version 2 of the -->
<!-- License, or (at your option) any later version.                    -->
<!--                                                                    -->
<!-- This program is distributed in the hope that it will be useful,    -->
<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of     -->
<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      -->
<!-- GNU General Public License for more details.                       -->
<!--                                                                    -->
<!-- You should have received a copy of the GNU General Public License  -->
<!-- along with this program; if not, write to the                      -->
<!-- Free Software Foundation, Inc.,                                    -->
<!-- 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA             -->
<!--                                                                    -->
<!--                 Sipp default 'uac' scenario.                       -->
<!--                                                                    -->

<scenario name="Basic Sipstone UAC">
  <!-- In client mode (sipp placing calls), the Call-ID MUST be         -->
  <!-- generated by sipp. To do so, use [call_id] keyword.                -->
  
  <send>
    <![CDATA[

      INVITE sip:[service]@127.0.0.1:5080 SIP/2.0
      Via: SIP/2.0/TCP [local_ip]:[local_port]
      From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number]
      To: sut <sip:[service]@127.0.0.1:5080>
      Call-ID: [call_id]
      Cseq: 1 INVITE
      Contact: sip:sipp@[local_ip]:[local_port]
      Max-Forwards: 70
      Subject: Performance Test
      Content-Type: application/sdp
      Content-Length: [len]

      v=0
      o=FAST_V2R1 2006 2007 IN IP4 155.11.49.64
      s=-
      t=0 0
      m=audio 10500 RTP/AVP 8 0 18 4 96 97
      c=IN IP4 conftest.plugtests.net
      a=rtpmap:0 PCMU/8000
      a=rtpmap:18 G729/8000
      a=rtpmap:4 G723/8000
      a=rtpmap:96 AMR/8000
      a=rtpmap:97 telephone-event/8000
      a=fmtp:97 0-15
      a=sendrecv
    ]]>
  </send>  
</scenario>
+38 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">

<!-- This program is free software; you can redistribute it and/or      -->
<!-- modify it under the terms of the GNU General Public License as     -->
<!-- published by the Free Software Foundation; either version 2 of the -->
<!-- License, or (at your option) any later version.                    -->
<!--                                                                    -->
<!-- This program is distributed in the hope that it will be useful,    -->
<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of     -->
<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      -->
<!-- GNU General Public License for more details.                       -->
<!--                                                                    -->
<!-- You should have received a copy of the GNU General Public License  -->
<!-- along with this program; if not, write to the                      -->
<!-- Free Software Foundation, Inc.,                                    -->
<!-- 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA             -->
<!--                                                                    -->
<!--                 Sipp default 'uac' scenario.                       -->
<!--                                                                    -->

<scenario name="Basic Sipstone UAC">
  <!-- In client mode (sipp placing calls), the Call-ID MUST be         -->
  <!-- generated by sipp. To do so, use [call_id] keyword.                -->
  
  <recv request="INVITE">
      <action>          
          <exec command="./onInvite.sh"></exec>
      </action>
  </recv>

  <pause milliseconds="3000">
    <action>
      <exec command="sipp -t t1 -trace_msg -m 1 -sf Outgoing.xml 127.0.0.1:5080"></exec>
    </action>
  </pause>    
</scenario>
+28 −0
Original line number Diff line number Diff line
echo "Retrieve Location from LIS" >> http.log
curl --location --request POST 'http://127.0.0.1:8084' \
--header 'Content-Type: application/held+xml' \
--data-raw '<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<locationRequest xmlns="urn:ietf:params:xml:ns:geopriv:held">
	<device xmlns="urn:ietf:params:xml:ns:geopriv:held:id">
	    <uri>sip:carol-01@demo.gridgears.io</uri>
    </device>
</locationRequest>' >> http.log

sleep 2

echo "Retrieve Next Hop from ECRF" >> http.log
curl --location --request POST 'http://127.0.0.1:8080' \
--header 'Content-Type: application/lost+xml' \
--data-raw '<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<findService xmlns="urn:ietf:params:xml:ns:lost1" recursive='\''true'\''>
	<location id="6020688f1ce1896d" profile="geodetic-2d">
        <gs:Circle srsName="urn:ogc:def:crs:EPSG::4326" xmlns:gml="http://www.opengis.net/gml" xmlns:gs="http://www.opengis.net/pidflo/1.0">
            <gml:pos>43.58206959563555 6.974515914916991</gml:pos>
              <gs:radius uom="urn:ogc:def:uom:EPSG::9001">200.0</gs:radius>
        </gs:Circle>     
	</location>
	<path>
		<via source="ecrf1.gridgears.plugtests.net"/>		
	</path>
	<service>urn:service:sos.police</service>
</findService>' >> http.log
 No newline at end of file
+40 −0
Original line number Diff line number Diff line
@@ -189,6 +189,46 @@ module AtsESRP_Functions {
        }
    }

    group LocationRequest {
        import from urn_ietf_params_xml_ns_geopriv_held all;

        function f_awaitingLocationRequest(template (present) LocationRequest p_locationRequest) runs on HttpComponent return HttpMessage{
            var HttpMessage v_request;

            template HttpMessage v_expected_request := mw_http_request(
                                                mw_http_request_post(?,?,
                                                      mw_http_message_body_xml(
                                                                mw_body_xml_location_request(p_locationRequest)
                                                        )
                                                )
                                            );
            
            alt {
                [] httpPort.receive(v_expected_request) -> value v_request {
                    tc_ac.stop;
                }
                []  tc_ac.timeout {
                        log("*** " & testcasename() & ": INCONC: Expected message not received ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                }            
            }

            return v_request;
        }

        function f_sendLocationResponse(template (value) LocationResponse p_locationResponse) runs on HttpComponent {
            // Local variables
            var Headers v_headers;            
            
            f_init_default_headers_list("application/held+xml", -, v_headers);
            httpPort.send(
                            m_http_response(
                                            m_http_response_ok(
                                                                {xml_body := m_body_xml_location_response(p_locationResponse)},
                                                                v_headers)));
        }

    }
    group QueueState {
        function f_awaitingSubscribeQueueState() runs on HttpSipComponent {
            var LibSip_SIPTypesAndValues.Request v_request;
Loading