[asterisk-commits] transport symmetric: Add testsuite test (testsuite[master])
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Mar 17 09:41:28 CDT 2017
Anonymous Coward #1000019 has submitted this change and it was merged. ( https://gerrit.asterisk.org/5168 )
Change subject: transport_symmetric: Add testsuite test
......................................................................
transport_symmetric: Add testsuite test
Added tests for INVITE, NOTIFY and OPTIONS.
Also had to tweak sipp.py to allow -oocsf to be passed without
having to specify a full pathname.
Change-Id: I41f52d09eb015659f935af9b2505ad2aa56d13de
---
M lib/python/asterisk/sipp.py
M tests/channels/pjsip/tests.yaml
A tests/channels/pjsip/transport/symmetric/invite/configs/ast1/extensions.conf
A tests/channels/pjsip/transport/symmetric/invite/configs/ast1/pjsip.conf
A tests/channels/pjsip/transport/symmetric/invite/sipp/invite.xml
A tests/channels/pjsip/transport/symmetric/invite/test-config.yaml
A tests/channels/pjsip/transport/symmetric/notify/configs/ast1/pjsip.conf
A tests/channels/pjsip/transport/symmetric/notify/configs/ast1/voicemail.conf
A tests/channels/pjsip/transport/symmetric/notify/sipp/initial_notify.xml
A tests/channels/pjsip/transport/symmetric/notify/sipp/reg_sub.xml
A tests/channels/pjsip/transport/symmetric/notify/test-config.yaml
A tests/channels/pjsip/transport/symmetric/options/configs/ast1/pjsip.conf
A tests/channels/pjsip/transport/symmetric/options/sipp/options.xml
A tests/channels/pjsip/transport/symmetric/options/sipp/register.xml
A tests/channels/pjsip/transport/symmetric/options/test-config.yaml
A tests/channels/pjsip/transport/symmetric/tests.yaml
A tests/channels/pjsip/transport/tests.yaml
17 files changed, 633 insertions(+), 0 deletions(-)
Approvals:
Kevin Harwell: Looks good to me, but someone else must approve
Anonymous Coward #1000019: Verified
Joshua Colp: Looks good to me, approved
diff --git a/lib/python/asterisk/sipp.py b/lib/python/asterisk/sipp.py
index aa0e34b..6b4c811 100644
--- a/lib/python/asterisk/sipp.py
+++ b/lib/python/asterisk/sipp.py
@@ -667,6 +667,10 @@
default_args['-inf'] = ('%s/sipp/%s' % (
self.test_dir, default_args['-inf']))
+ if '-oocsf' in default_args:
+ default_args['-oocsf'] = ('%s/sipp/%s' % (
+ self.test_dir, default_args['-oocsf']))
+
for (key, val) in default_args.items():
sipp_args.extend([key, val])
sipp_args.extend(self.positional_args)
diff --git a/tests/channels/pjsip/tests.yaml b/tests/channels/pjsip/tests.yaml
index 086a61a..7066f00 100644
--- a/tests/channels/pjsip/tests.yaml
+++ b/tests/channels/pjsip/tests.yaml
@@ -20,6 +20,7 @@
- dir: 'statsd'
- dir: 'subscriptions'
- dir: 'transfers'
+ - dir: 'transport'
- dir: 'video_calls'
- test: 'accountcode'
- test: 'acl_call'
diff --git a/tests/channels/pjsip/transport/symmetric/invite/configs/ast1/extensions.conf b/tests/channels/pjsip/transport/symmetric/invite/configs/ast1/extensions.conf
new file mode 100644
index 0000000..1aa59f6
--- /dev/null
+++ b/tests/channels/pjsip/transport/symmetric/invite/configs/ast1/extensions.conf
@@ -0,0 +1,6 @@
+[default]
+
+exten => s,1,NoOp()
+same => n,Answer()
+same => n,Dial(PJSIP/alice,,S(1))
+same => n,Hangup()
diff --git a/tests/channels/pjsip/transport/symmetric/invite/configs/ast1/pjsip.conf b/tests/channels/pjsip/transport/symmetric/invite/configs/ast1/pjsip.conf
new file mode 100644
index 0000000..61a3430
--- /dev/null
+++ b/tests/channels/pjsip/transport/symmetric/invite/configs/ast1/pjsip.conf
@@ -0,0 +1,21 @@
+[local-transport-5066]
+type=transport
+bind=127.0.0.1:5066
+protocol=udp
+symmetric_transport=yes
+
+[local-transport]
+type=transport
+bind=127.0.0.1
+protocol=udp
+
+[alice]
+type=endpoint
+allow=g722,ulaw,alaw
+context=default
+aors=alice
+
+[alice]
+type=aor
+max_contacts=5
+contact=sip:127.0.0.1:5061\;x-ast-txp=local-transport-5066
diff --git a/tests/channels/pjsip/transport/symmetric/invite/sipp/invite.xml b/tests/channels/pjsip/transport/symmetric/invite/sipp/invite.xml
new file mode 100644
index 0000000..5458d86
--- /dev/null
+++ b/tests/channels/pjsip/transport/symmetric/invite/sipp/invite.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="UAS Test transport">
+
+ <recv request="INVITE">
+ <action>
+ <ereg regexp="127.0.0.1:5066;rport" search_in="hdr" header="Via"
+ check_it="true" assign_to="1" />
+ </action>
+ </recv>
+
+ <send retrans="500">
+ <![CDATA[
+
+ SIP/2.0 200 OK
+ [last_Via:]
+ [last_From:]
+ [last_To:];tag=[call_number]
+ [last_Call-ID:]
+ [last_CSeq:]
+ Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+ Content-Type: application/sdp
+ Content-Length: [len]
+
+ v=0
+ o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
+ s=-
+ c=IN IP[media_ip_type] [media_ip]
+ t=0 0
+ m=audio [media_port] RTP/AVP 0
+ a=rtpmap:0 PCMU/8000
+
+ ]]>
+ </send>
+
+ <recv request="ACK">
+ <action>
+ <ereg regexp="127.0.0.1:5066;rport" search_in="hdr" header="Via"
+ check_it="true" assign_to="2" />
+ </action>
+ </recv>
+
+ <recv request="BYE" crlf="true">
+ <action>
+ <ereg regexp="127.0.0.1:5066;rport" search_in="hdr" header="Via"
+ check_it="true" assign_to="3" />
+ </action>
+ </recv>
+
+ <send retrans="500">
+ <![CDATA[
+
+ SIP/2.0 200 OK
+ [last_Via:]
+ [last_From:]
+ [last_To:];tag=[call_number]
+ [last_Call-ID:]
+ [last_CSeq:]
+ Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+ Content-Length: 0
+
+ ]]>
+ </send>
+
+ <Reference variables="1,2,3" />
+</scenario>
diff --git a/tests/channels/pjsip/transport/symmetric/invite/test-config.yaml b/tests/channels/pjsip/transport/symmetric/invite/test-config.yaml
new file mode 100644
index 0000000..e3930b8
--- /dev/null
+++ b/tests/channels/pjsip/transport/symmetric/invite/test-config.yaml
@@ -0,0 +1,47 @@
+testinfo:
+ summary: 'Tests symmetric transport on INVITE'
+ description: |
+ "Two transports are defined, the first on port 5066 and the last
+ (the default) on 5060. Alice has a static contact with
+ x-ast-txp=local-transport-5066 appended to set the transport.
+ The Originator starts the call.
+
+ * Check the INVITE Via specifies 5066 as the port.
+ * Check the ACK Via specifies 5066 as the port.
+ * Check the BYE Via specifies 5066 as the port.
+ "
+
+properties:
+ minversion: '13.15.0'
+ dependencies:
+ - sipp :
+ version : 'v3.0'
+ - python: 'twisted'
+ - python: 'starpy'
+ - asterisk: 'res_pjsip'
+ - asterisk : 'chan_pjsip'
+ - asterisk : 'res_pjsip_session'
+ tags:
+ - pjsip
+
+test-modules:
+ add-test-to-search-path: 'True'
+ test-object:
+ config-section: sipp-config
+ typename: 'sipp.SIPpTestCase'
+ modules:
+ -
+ config-section: originator-alice_invite_recv
+ typename: 'pluggable_modules.Originator'
+
+originator-alice_invite_recv:
+ trigger: 'ami_connect'
+
+sipp-config:
+ reactor-timeout: 15
+ fail-on-any: True
+ test-iterations:
+ -
+ scenarios:
+ - { 'key-args': {'scenario': 'invite.xml',
+ '-p': '5061', '-s': 'alice'}, 'target': '127.0.0.1:5066'}
diff --git a/tests/channels/pjsip/transport/symmetric/notify/configs/ast1/pjsip.conf b/tests/channels/pjsip/transport/symmetric/notify/configs/ast1/pjsip.conf
new file mode 100644
index 0000000..803e212
--- /dev/null
+++ b/tests/channels/pjsip/transport/symmetric/notify/configs/ast1/pjsip.conf
@@ -0,0 +1,31 @@
+[local-transport-5066]
+type=transport
+bind=127.0.0.1:5066
+protocol=udp
+symmetric_transport=yes
+
+[local-transport]
+type=transport
+bind=127.0.0.1
+protocol=udp
+
+[alice]
+type=endpoint
+allow=g722,ulaw,alaw
+context=default
+aors=alice
+auth=alice
+mailboxes=1000 at default
+mwi_subscribe_replaces_unsolicited=no
+
+[alice]
+type=aor
+max_contacts=5
+mailboxes=1000e at default
+
+[alice]
+type=auth
+auth_type=userpass
+username=alice
+password=password
+
diff --git a/tests/channels/pjsip/transport/symmetric/notify/configs/ast1/voicemail.conf b/tests/channels/pjsip/transport/symmetric/notify/configs/ast1/voicemail.conf
new file mode 100644
index 0000000..253c745
--- /dev/null
+++ b/tests/channels/pjsip/transport/symmetric/notify/configs/ast1/voicemail.conf
@@ -0,0 +1,2 @@
+[default]
+1000 => 4242,Example Mailbox
diff --git a/tests/channels/pjsip/transport/symmetric/notify/sipp/initial_notify.xml b/tests/channels/pjsip/transport/symmetric/notify/sipp/initial_notify.xml
new file mode 100644
index 0000000..c9feaba
--- /dev/null
+++ b/tests/channels/pjsip/transport/symmetric/notify/sipp/initial_notify.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Out-of-Call NOTIFY after REGISTER">
+
+ <recv request="NOTIFY">
+ <action>
+ <ereg regexp="127.0.0.1:5066;rport" search_in="hdr" header="Via"
+ assign_to="1" />
+ </action>
+ </recv>
+
+ <!-- ereg 'check_it' doesn't work in an out-of-call scenario file because there's
+ no call to mark as failed so we have to explicitly kill sipp if the regex
+ didn't match. -->
+
+ <nop condexec="1" condexec_inverse="true">
+ <action>
+ <exec int_cmd="stop_now" />
+ </action>
+ </nop>
+
+ <send>
+ <![CDATA[
+
+ SIP/2.0 200 OK
+ [last_Via:]
+ [last_From:]
+ [last_To:]
+ [last_Call-ID:]
+ [last_CSeq:]
+ Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+ Content-Length: 0
+
+ ]]>
+ </send>
+</scenario>
diff --git a/tests/channels/pjsip/transport/symmetric/notify/sipp/reg_sub.xml b/tests/channels/pjsip/transport/symmetric/notify/sipp/reg_sub.xml
new file mode 100644
index 0000000..38f27d3
--- /dev/null
+++ b/tests/channels/pjsip/transport/symmetric/notify/sipp/reg_sub.xml
@@ -0,0 +1,210 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="REGISTER, SUBSCRIBE, unSUBSCRIBE, unREGISTER">
+ <send>
+ <![CDATA[
+
+ REGISTER sip:[remote_ip]:[remote_port] SIP/2.0
+ Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch]
+ From: "[service]" <sip:[service]@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+ To: "[service]" <sip:[service]@[remote_ip]:[remote_port]>
+ Call-ID: [call_id]
+ CSeq: 1 REGISTER
+ Max-Forwards: 70
+ Expires: 60
+ Contact: <sip:[service]@[local_ip]:[local_port]>;transport=[transport]
+ Subject: Performance Test
+ Content-Length: 0
+
+ ]]>
+ </send>
+
+ <recv response="401" auth="true" />
+
+ <send>
+ <![CDATA[
+
+ REGISTER sip:[remote_ip]:[remote_port] SIP/2.0
+ Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch]
+ From: "[service]" <sip:[service]@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+ To: "[service]" <sip:[service]@[remote_ip]:[remote_port]>
+ Call-ID: [call_id]
+ CSeq: [cseq] REGISTER
+ Max-Forwards: 70
+ Expires: 60
+ Contact: <sip:[service]@[local_ip]:[local_port]>;transport=[transport]
+ Subject: Performance Test
+ [authentication]
+ Content-Length: 0
+
+ ]]>
+ </send>
+
+ <recv response="200" crlf="true" />
+ <pause milliseconds="500" />
+
+ <send retrans="500">
+ <![CDATA[
+
+ SUBSCRIBE sip:[mbx]@[remote_ip]:[remote_port] SIP/2.0
+ Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch]
+ From: "[service]" <sip:[service]@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+ To: <sip:[service]@[remote_ip]:[remote_port]>
+ Contact: <sip:[service]@[local_ip]:[local_port]>
+ Call-ID: [call_id]
+ CSeq: [cseq] SUBSCRIBE
+ Max-Forwards: 70
+ Event: presence
+ Expires: 10
+ Supported: replaces, 100rel, timer, norefersub
+ Accept: application/pidf+xml, application/xpidf+xml, application/simple-message-summary
+ Allow-Events: presence, message-summary, refer
+ Content-Length: 0
+
+ ]]>
+ </send>
+
+ <recv response="401" auth="true" />
+
+ <send retrans="500">
+ <![CDATA[
+
+ SUBSCRIBE sip:[mbx]@[remote_ip]:[remote_port] SIP/2.0
+ Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch]
+ From: "[service]" <sip:[service]@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+ To: <sip:[service]@[remote_ip]:[remote_port]>
+ Contact: <sip:[service]@[local_ip]:[local_port]>
+ Call-ID: [call_id]
+ CSeq: [cseq] SUBSCRIBE
+ Max-Forwards: 70
+ Event: presence
+ Expires: 10
+ Supported: replaces, 100rel, timer, norefersub
+ Accept: application/pidf+xml, application/xpidf+xml, application/simple-message-summary
+ Allow-Events: presence, message-summary, refer
+ [authentication]
+ Content-Length: 0
+
+ ]]>
+ </send>
+
+ <recv response="200" crlf="true" />
+
+ <recv request="NOTIFY">
+ <action>
+ <ereg regexp="127.0.0.1:5066;rport" search_in="hdr" header="Via"
+ check_it="true" assign_to="1" />
+ </action>
+ </recv>
+ <Reference variables="1" />
+
+ <send crlf="true">
+ <![CDATA[
+
+ SIP/2.0 200 OK
+ [last_Via:]
+ [last_From:]
+ [last_To:]
+ [last_Call-ID:]
+ [last_CSeq:]
+ Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+ Content-Length: 0
+
+ ]]>
+ </send>
+
+ <pause milliseconds="500" />
+
+ <send retrans="500">
+ <![CDATA[
+
+ SUBSCRIBE sip:[mbx]@[remote_ip]:[remote_port] SIP/2.0
+ Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch]
+ From: "[service]" <sip:[service]@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+ To: <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]
+ Contact: <sip:[service]@[local_ip]:[local_port]>
+ Call-ID: [call_id]
+ CSeq: [cseq] SUBSCRIBE
+ Max-Forwards: 70
+ Event: presence
+ Expires: 0
+ Supported: replaces, 100rel, timer, norefersub
+ Accept: application/pidf+xml, application/xpidf+xml, application/simple-message-summary
+ Allow-Events: presence, message-summary, refer
+ Content-Length: 0
+
+ ]]>
+ </send>
+
+ <recv response="200" />
+
+ <recv request="NOTIFY">
+ <action>
+ <ereg regexp="127.0.0.1:5066;rport" search_in="hdr" header="Via"
+ check_it="true" assign_to="2" />
+ </action>
+ </recv>
+ <Reference variables="2" />
+
+ <send crlf="true">
+ <![CDATA[
+
+ SIP/2.0 200 OK
+ [last_Via:]
+ [last_From:]
+ [last_To:]
+ [last_Call-ID:]
+ [last_CSeq:]
+ Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+ Content-Length: 0
+
+ ]]>
+ </send>
+
+ <pause milliseconds="1000" />
+
+ <send retrans="500">
+ <![CDATA[
+
+ REGISTER sip:[remote_ip]:[remote_port] SIP/2.0
+ Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch]
+ From: "[service]" <sip:[service]@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+ To: "[service]" <sip:[service]@[remote_ip]:[remote_port]>
+ Call-ID: [call_id]
+ CSeq: [cseq] REGISTER
+ Max-Forwards: 70
+ Expires: 0
+ Contact: <sip:[service]@[local_ip]:[local_port]>;transport=[transport]
+ Subject: Performance Test
+ Content-Length: 0
+
+ ]]>
+ </send>
+
+ <recv response="401" auth="true" />
+
+ <send>
+ <![CDATA[
+
+ REGISTER sip:[remote_ip]:[remote_port] SIP/2.0
+ Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch]
+ From: "[service]" <sip:[service]@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+ To: "[service]" <sip:[service]@[remote_ip]:[remote_port]>
+ Call-ID: [call_id]
+ CSeq: [cseq] REGISTER
+ Max-Forwards: 70
+ Expires: 0
+ Contact: <sip:[service]@[local_ip]:[local_port]>;transport=[transport]
+ Subject: Performance Test
+ [authentication]
+ Content-Length: 0
+
+ ]]>
+ </send>
+
+ <recv response="200" />
+
+ <pause milliseconds="1000" />
+
+</scenario>
diff --git a/tests/channels/pjsip/transport/symmetric/notify/test-config.yaml b/tests/channels/pjsip/transport/symmetric/notify/test-config.yaml
new file mode 100644
index 0000000..154e115
--- /dev/null
+++ b/tests/channels/pjsip/transport/symmetric/notify/test-config.yaml
@@ -0,0 +1,48 @@
+testinfo:
+ summary: 'Tests symmetric transport'
+ description: |
+ "Two transports are defined, the first on port 5066 and the last
+ (the default) on 5060. The endpoint/aor allows mwi subscription
+ and unsolicited mwi.
+
+ * Send REGISTER/auth
+ * In the out-of-call scenario file, check the unsolicited NOTIFY Via
+ specifies 5066 as the port.
+ * Send SUBSCRIBE/auth
+ * check the NOTIFY Via specifies 5066 as the port.
+ * Send unSUBSCRIBE/auth
+ * check the NOTIFY Via specifies 5066 as the port.
+ * Send unREGISTER/auth
+ "
+
+properties:
+ minversion: '13.15.0'
+ dependencies:
+ - sipp :
+ version : 'v3.0'
+ - python: 'twisted'
+ - python: 'starpy'
+ - asterisk: 'res_pjsip'
+ - asterisk: 'res_pjsip_mwi'
+ tags:
+ - pjsip
+
+test-modules:
+ add-test-to-search-path: 'True'
+ test-object:
+ config-section: sipp-config
+ typename: 'sipp.SIPpTestCase'
+
+sipp-config:
+ reactor-timeout: 15
+ fail-on-any: True
+ test-iterations:
+ -
+#
+# The only way to test an unsolicited NOTIFY is in an out-of-call scenario file.
+#
+ scenarios:
+ - { 'key-args': {'scenario': 'reg_sub.xml',
+ '-oocsf': 'initial_notify.xml', '-p': '5061', '-s': 'alice',
+ '-au': 'alice', '-ap': 'password'},
+ 'ordered-args': ['-key', 'mbx', '1000'], 'target': '127.0.0.1:5066'}
diff --git a/tests/channels/pjsip/transport/symmetric/options/configs/ast1/pjsip.conf b/tests/channels/pjsip/transport/symmetric/options/configs/ast1/pjsip.conf
new file mode 100644
index 0000000..c212f55
--- /dev/null
+++ b/tests/channels/pjsip/transport/symmetric/options/configs/ast1/pjsip.conf
@@ -0,0 +1,25 @@
+[global]
+type=global
+max_initial_qualify_time=1
+
+[local-transport-5066]
+type=transport
+bind=127.0.0.1:5066
+protocol=udp
+symmetric_transport=yes
+
+[local-transport]
+type=transport
+bind=127.0.0.1
+protocol=udp
+
+[alice]
+type=endpoint
+allow=g722,ulaw,alaw
+context=default
+aors=alice
+
+[alice]
+type=aor
+max_contacts=5
+qualify_frequency=10
diff --git a/tests/channels/pjsip/transport/symmetric/options/sipp/options.xml b/tests/channels/pjsip/transport/symmetric/options/sipp/options.xml
new file mode 100644
index 0000000..699f5e9
--- /dev/null
+++ b/tests/channels/pjsip/transport/symmetric/options/sipp/options.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="UAS Test transport">
+
+ <!-- ereg 'check_it' doesn't work in an out-of-call scenario file because
+ there's no call to mark as failed so we have to explicitly kill sipp if the
+ regex didn't match. -->
+
+ <recv request="OPTIONS">
+ <action>
+ <ereg regexp="127.0.0.1:5066;rport" search_in="hdr" header="Via"
+ check_it="true" assign_to="1" />
+ </action>
+ </recv>
+ <nop condexec="1" condexec_inverse="true">
+ <action>
+ <exec int_cmd="stop_now" />
+ </action>
+ </nop>
+
+ <send>
+ <![CDATA[
+
+ SIP/2.0 200 OK
+ [last_Via:]
+ [last_From:]
+ [last_To:];tag=[call_number]
+ [last_Call-ID:]
+ [last_CSeq:]
+ Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+ Content-Length: 0
+
+ ]]>
+ </send>
+</scenario>
diff --git a/tests/channels/pjsip/transport/symmetric/options/sipp/register.xml b/tests/channels/pjsip/transport/symmetric/options/sipp/register.xml
new file mode 100644
index 0000000..d288947
--- /dev/null
+++ b/tests/channels/pjsip/transport/symmetric/options/sipp/register.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="UAS Test transport">
+
+ <send>
+ <![CDATA[
+
+ REGISTER sip:[remote_ip]:[remote_port] SIP/2.0
+ Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch]
+ From: "[service]" <sip:[service]@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+ To: "[service]" <sip:[service]@[remote_ip]:[remote_port]>
+ Call-ID: [call_id]
+ CSeq: [cseq] REGISTER
+ Max-Forwards: 70
+ Expires: 60
+ Contact: <sip:[service]@[local_ip]:[local_port]>;transport=[transport]
+ Subject: Performance Test
+ Content-Length: 0
+
+ ]]>
+ </send>
+
+ <recv response="200" crlf="true" />
+
+ <pause milliseconds="4000"/>
+
+ <send>
+ <![CDATA[
+
+ REGISTER sip:[remote_ip]:[remote_port] SIP/2.0
+ Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch]
+ From: "[service]" <sip:[service]@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+ To: "[service]" <sip:[service]@[remote_ip]:[remote_port]>
+ Call-ID: [call_id]
+ CSeq: [cseq] REGISTER
+ Max-Forwards: 70
+ Expires: 0
+ Contact: <sip:[service]@[local_ip]:[local_port]>;transport=[transport]
+ Subject: Performance Test
+ Content-Length: 0
+
+ ]]>
+ </send>
+
+ <recv response="200" crlf="true" />
+
+</scenario>
+
diff --git a/tests/channels/pjsip/transport/symmetric/options/test-config.yaml b/tests/channels/pjsip/transport/symmetric/options/test-config.yaml
new file mode 100644
index 0000000..6a59f55
--- /dev/null
+++ b/tests/channels/pjsip/transport/symmetric/options/test-config.yaml
@@ -0,0 +1,43 @@
+testinfo:
+ summary: 'Tests symmetric transport on OPTIONS'
+ description: |
+ "Two transports are defined, the first on port 5066 and the last
+ (the default) on 5060. The aor it set to send OPTIONS.
+
+ * Send REGISTER
+ * In the out-of-call scenario file, check the OPTIONS Via
+ specifies 5066 as the port.
+ * Send unREGISTER
+ "
+
+properties:
+ minversion: '13.15.0'
+ dependencies:
+ - sipp :
+ version : 'v3.0'
+ - python: 'twisted'
+ - python: 'starpy'
+ - asterisk: 'res_pjsip'
+ tags:
+ - pjsip
+
+test-modules:
+ add-test-to-search-path: 'True'
+ test-object:
+ config-section: sipp-config
+ typename: 'sipp.SIPpTestCase'
+
+sipp-config:
+ reactor-timeout: 15
+ fail-on-any: True
+ test-iterations:
+ -
+#
+# The only way to test a REGISTER and an OPTIONS is to put the
+# OPTIONS in an out-of-call scenario file.
+#
+ scenarios:
+ - { 'key-args': {'scenario': 'register.xml',
+ '-oocsf': 'options.xml',
+ '-p': '5061', '-s': 'alice', '-au': 'alice', '-ap': 'password'},
+ 'target': '127.0.0.1:5066'}
diff --git a/tests/channels/pjsip/transport/symmetric/tests.yaml b/tests/channels/pjsip/transport/symmetric/tests.yaml
new file mode 100644
index 0000000..4f4a446
--- /dev/null
+++ b/tests/channels/pjsip/transport/symmetric/tests.yaml
@@ -0,0 +1,4 @@
+tests:
+ - test: 'notify'
+ - test: 'invite'
+ - test: 'options'
diff --git a/tests/channels/pjsip/transport/tests.yaml b/tests/channels/pjsip/transport/tests.yaml
new file mode 100644
index 0000000..811f55e
--- /dev/null
+++ b/tests/channels/pjsip/transport/tests.yaml
@@ -0,0 +1,2 @@
+tests:
+ - dir: 'symmetric'
--
To view, visit https://gerrit.asterisk.org/5168
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I41f52d09eb015659f935af9b2505ad2aa56d13de
Gerrit-PatchSet: 2
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
More information about the asterisk-commits
mailing list