Commit ec06883e authored by Michael Proestler's avatar Michael Proestler
Browse files

Add ECRF Request Verification

parent bcea64fa
Loading
Loading
Loading
Loading

etc/AtsESRP/ESRP.cfg

0 → 100644
+87 −0
Original line number Original line Diff line number Diff line
[MODULE_PARAMETERS]
# This section shall contain the values of all parameters that are defined in your TTCN-3 modules.

LibItsHttp_Pics.PICS_HEADER_HOST := "192.168.50.64"
LibItsHttp_Pics.PICS_HEADER_CONTENT_TYPE := "application/json"

## Add HTTP Header with Testcase Name
PX_ADD_TC_NAME_HTTP_HEADER := true

# Dequeue Registration
 


[LOGGING]
# In this section you can specify the name of the log file and the classes of events
# you want to log into the file or display on console (standard error).
#../logs/AtsNg112
LogFile := "../logs/AtsESRP/%e.%h-%r.%s"
FileMask := LOG_ALL | USER | DEBUG | MATCHING
ConsoleMask := LOG_ALL | USER | DEBUG | MATCHING
#FileMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP
#ConsoleMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP
LogSourceInfo := Stack
LogEntityName:= Yes
LogEventTypes:= Yes
#TimeStampFormat := DateTime

[TESTPORT_PARAMETERS]
# In this section you can specify parameters that are passed to Test Ports.

# ECRF
Ecrf.httpPort.params := "HTTP(codecs=lost:lost_codec)/TCP(debug=1,server_mode=1,local_port=8080,use_ssl=0)"
ForestGuide.httpPort.params := "HTTP(codecs=lost:lost_codec)/TCP(debug=1,server_mode=1,local_port=8082,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)"

#Ecrf.httpPort.params := "HTTP(codecs=lost:lost_codec)/TCP(debug=1,server_mode=1,local_port=8080,use_ssl=0)"

# SIP/PSAP
Upstream.SIPP.params := "SIP/TCP(debug=1,server=localhost,port=5060,use_ssl=0)"
Downstream.SIPP.params := "SIP/TCP(debug=1,local_port=5080,server_mode=1,use_ssl=0)"
#Psap.SIPP.params := "SIP/TCP(debug=1,server_mode=1,local_port=5070,use_ssl=0)"

[DEFINE]
# In this section you can create macro definitions,
# that can be used in other configuration file sections except [INCLUDE] and [ORDERED_INCLUDE].

[INCLUDE]
# To use configuration settings given in other configuration files,
# the configuration files just need to be listed in this section, with their full or relative pathnames.

[ORDERED_INCLUDE]
# To use configuration settings given in other configuration files,
# the configuration files just need to be listed in this section, with their full or relative pathnames.

[EXTERNAL_COMMANDS]
# This section can define external commands (shell scripts) to be executed by the ETS
# whenever a control part or test case is started or terminated.

#BeginTestCase := ""
#EndTestCase := ""
#BeginControlPart := ""
#EndControlPart := ""

[EXECUTE]
# In this section you can specify what parts of your test suite you want to execute.
AtsESRP_TestControl.control

#AtsESRP_TestCases.TC_ESRP_FIND_SERVICE_BV_01
#AtsESRP_TestCases.TC_ESRP_HTTP_DEQUEUE_REGISTRATION_TARGET_REGISTRATION_BV_01
#AtsESRP_TestCases.TC_ESRP_HTTP_DEQUEUE_REGISTRATION_TARGET_REGISTRATION_BV_02
#AtsESRP_TestCases.TC_ESRP_HTTP_DEQUEUE_REGISTRATION_TARGET_DEREGISTRATION_BV_01

[GROUPS]
# In this section you can specify groups of hosts. These groups can be used inside the
# [COMPONENTS] section to restrict the creation of certain PTCs to a given set of hosts.

[COMPONENTS]
# This section consists of rules restricting the location of created PTCs.

[MAIN_CONTROLLER]
# The options herein control the behavior of MC.
KillTimer := 10.0
LocalAddress := 127.0.0.1
TCPPort := 12000
NumHCs := 1
+5 −4
Original line number Original line Diff line number Diff line
@@ -4,9 +4,10 @@ curl --location --request POST 'http://127.0.0.1:8080' \
--data-raw '<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
--data-raw '<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<findService xmlns="urn:ietf:params:xml:ns:lost1" recursive='\''true'\''>
<findService xmlns="urn:ietf:params:xml:ns:lost1" recursive='\''true'\''>
	<location id="6020688f1ce1896d" profile="geodetic-2d">
	<location id="6020688f1ce1896d" profile="geodetic-2d">
		<gml:Point xmlns:gml="http://www.opengis.net/gml" gml:id="point1" srsName="urn:ogc:def:crs:EPSG::4326">
        <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.582070 6.974516</gml:pos>
            <gml:pos>43.58206959563555 6.974515914916991</gml:pos>
        </gml:Point>
              <gs:radius uom="urn:ogc:def:uom:EPSG::9001">200.0</gs:radius>
        </gs:Circle>     
	</location>
	</location>
	<path>
	<path>
		<via source="ecrf1.gridgears.plugtests.net"/>
		<via source="ecrf1.gridgears.plugtests.net"/>
+31 −0
Original line number Original line Diff line number Diff line
Problem EAGAIN on socket  10 and poll_idx  is 1 
Exit problem event on socket 10 
----------------------------------------------- 2022-04-19 10:36:29.979781
TCP message sent (619 bytes):

INVITE sip:service@127.0.0.1:5080 SIP/2.0
Via: SIP/2.0/TCP 127.0.0.1:5061
From: sipp <sip:sipp@127.0.0.1:5061>;tag=1
To: sut <sip:service@127.0.0.1:5080>
Call-ID: 1-71528@127.0.0.1
Cseq: 1 INVITE
Contact: sip:sipp@127.0.0.1:5061
Max-Forwards: 70
Subject: Performance Test
Content-Type: application/sdp
Content-Length:   282

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
+52 −0
Original line number Original line Diff line number Diff line
----------------------------------------------- 2022-04-19 10:36:29.713168
TCP message received [1593] bytes :

INVITE urn:service:sos SIP/2.0
Via: SIP/2.0/UDP conftest.plugtests.net:5060;branch=z9hG4bK4cBWDxS22JjzhMaiRr
Route: <sip:esrp1.unify.plugtests.net:5060>
From: <sip:alice-06@plugtests.net>;tag=fa37JncCHryDsbzayy
To: <sip:112@plugtests.net>
Call-ID: V41mtzxlYvKWrO72tK@conftest.plugtests.net
CSeq: 1002 INVITE
Contact: <sip:alice-06@conftest.plugtests.net:5060>
Content-Type: application/sdp
Mime-Version: 2.0
Allow: INVITE,ACK,BYE,MESSAGE,OPTIONS,CANCEL
Max-Forwards: 70
Supported: 100rel
Content-Length:  1067

content-type: application/sdp

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
content-type: application/resource-lists+xml

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<tq0003:presence xmlns:tq0003='urn:ietf:params:xml:ns:pidf' xmlns:tq0002='urn:ietf:params:xml:ns:pidf:geopriv10' xmlns:tq0011='http://www.opengis.net/gml' xmlns:gml='http://www.opengis.net/gml' xmlns:tns='urn:ietf:params:xml:ns:pidf:geopriv10:basicPolicy' entity='sip:alice-06@plugtests.net'>
	<tq0003:tuple id='0ehvxv4kxwrzzbp'>
		<tq0003:status>
			<tq0002:geopriv>
				<tq0002:location-info>
					<tq0011:Point srsName='urn:ogc:def:crs:EPSG::4326'>
						<gml:pos>43.623013 7.046185</gml:pos>
					</tq0011:Point>
				</tq0002:location-info>
				<tq0002:usage-rules/>
			</tq0002:geopriv>
		</tq0003:status>
	</tq0003:tuple>
</tq0003:presence>

+63 −0
Original line number Original line Diff line number Diff line
@@ -3,6 +3,7 @@ module AtsESRP_Functions {
    import from LibItsHttp_TypesAndValues all;
    import from LibItsHttp_TypesAndValues all;
    import from LibItsHttp_TestSystem all;
    import from LibItsHttp_TestSystem all;
    import from LibItsHttp_XmlMessageBodyTypes all;
    import from LibItsHttp_XmlMessageBodyTypes all;
    import from LibItsHttp_XmlTemplates all;
    import from LibItsHttp_MessageBodyTypes all;
    import from LibItsHttp_MessageBodyTypes all;
    import from LibItsHttp_Functions all;
    import from LibItsHttp_Functions all;
    import from LibItsHttp_Pics all;
    import from LibItsHttp_Pics all;
@@ -22,6 +23,8 @@ module AtsESRP_Functions {


    import from LibNg112_DequeueRegistration all;
    import from LibNg112_DequeueRegistration all;


    import from http_www_opengis_net_pidflo_1_0 all;

    type record Statement {    
    type record Statement {    
        charstring name,
        charstring name,
        boolean val
        boolean val
@@ -114,6 +117,66 @@ module AtsESRP_Functions {
        );
        );
    }
    }


    group FindService {
        import from urn_ietf_params_xml_ns_lost1 all;

        function f_awaitingFindServiceRequest(template (present) FindService p_findServiceRequest) 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_find_service_request(p_findServiceRequest)
                                                        )
                                                )
                                            );
            
            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_assertFindServiceRequestLocation(HttpMessage p_request, template (present) Circle p_circle) return boolean {
            var universal charstring v_temp;
            var integer v_result;
            var Circle v_circle;            
            v_temp := p_request.request.body.xml_body.findServiceRequest.location_list[0].extensionPoint_list[0].elem;
            
            log("Decoding " & v_temp);            
            v_result := decvalue_unichar(v_temp, v_circle);            
            log("Result");
            log(v_circle)          
                        
            if (match(v_circle, p_circle)) {
                return true;
            } else {
                log(match(v_circle, p_circle));            
            }
            
            return false;
        }

        function f_sendFindServiceResponse(template (value) FindServiceResponse p_findServiceResponse) runs on HttpComponent {
            // Local variables
            var Headers v_headers;            
            
            f_init_default_headers_list("application/lost+xml", -, v_headers);
            httpPort.send(
                            m_http_response(
                                            m_http_response_ok(
                                                                {xml_body := m_body_xml_find_service_response(p_findServiceResponse)},
                                                                v_headers)));
        }
    }

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