[asterisk-commits] Testsuite: channels/pjsip/basic calls/incoming/off-nominal/i... (testsuite[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jul 1 10:37:51 CDT 2016


Anonymous Coward #1000019 has submitted this change and it was merged.

Change subject: Testsuite: channels/pjsip/basic_calls/incoming/off-nominal/invalid_sdp
......................................................................


Testsuite: channels/pjsip/basic_calls/incoming/off-nominal/invalid_sdp

Test scenerios created as a response to ASTERISK-25772

Change-Id: I094b3a40255b3ee43aa50ec9be5aab24fc4b1002
---
A tests/channels/pjsip/basic_calls/incoming/off-nominal/invalid_sdp/configs/ast1/extensions.conf
A tests/channels/pjsip/basic_calls/incoming/off-nominal/invalid_sdp/configs/ast1/modules.conf.inc
A tests/channels/pjsip/basic_calls/incoming/off-nominal/invalid_sdp/configs/ast1/pjsip.conf
A tests/channels/pjsip/basic_calls/incoming/off-nominal/invalid_sdp/sipp/uac_invalid_deferred_answer.xml
A tests/channels/pjsip/basic_calls/incoming/off-nominal/invalid_sdp/sipp/uac_invalid_offer.xml
A tests/channels/pjsip/basic_calls/incoming/off-nominal/invalid_sdp/sipp/uac_missing_deferred_answer.xml
A tests/channels/pjsip/basic_calls/incoming/off-nominal/invalid_sdp/sipp/uac_valid_deferred_answer.xml
A tests/channels/pjsip/basic_calls/incoming/off-nominal/invalid_sdp/test-config.yaml
M tests/channels/pjsip/basic_calls/incoming/off-nominal/tests.yaml
9 files changed, 353 insertions(+), 0 deletions(-)

Approvals:
  Mark Michelson: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, approved



diff --git a/tests/channels/pjsip/basic_calls/incoming/off-nominal/invalid_sdp/configs/ast1/extensions.conf b/tests/channels/pjsip/basic_calls/incoming/off-nominal/invalid_sdp/configs/ast1/extensions.conf
new file mode 100644
index 0000000..1e5104d
--- /dev/null
+++ b/tests/channels/pjsip/basic_calls/incoming/off-nominal/invalid_sdp/configs/ast1/extensions.conf
@@ -0,0 +1,6 @@
+[default]
+
+exten => echo,1,NoOp()
+same => n,Answer()
+same => n,Echo()
+same => n,Hangup()
diff --git a/tests/channels/pjsip/basic_calls/incoming/off-nominal/invalid_sdp/configs/ast1/modules.conf.inc b/tests/channels/pjsip/basic_calls/incoming/off-nominal/invalid_sdp/configs/ast1/modules.conf.inc
new file mode 100644
index 0000000..4aeda6f
--- /dev/null
+++ b/tests/channels/pjsip/basic_calls/incoming/off-nominal/invalid_sdp/configs/ast1/modules.conf.inc
@@ -0,0 +1,13 @@
+; Minimize open fds in this test by not loading other VoIP channel drivers
+noload => chan_iax2.so
+noload => chan_mgcp.so
+noload => chan_unistim.so
+noload => chan_motif.so
+noload => chan_skinny.so
+noload => chan_ooh323.so
+
+; res_hep.so opens an fd on the first SIP call received, and doesn't close it after
+; the call has completed. I could either noload res_hep or set the fd test condition
+; to ignore it. It's easier to just noload.
+
+noload => res_hep.so
diff --git a/tests/channels/pjsip/basic_calls/incoming/off-nominal/invalid_sdp/configs/ast1/pjsip.conf b/tests/channels/pjsip/basic_calls/incoming/off-nominal/invalid_sdp/configs/ast1/pjsip.conf
new file mode 100644
index 0000000..d03b559
--- /dev/null
+++ b/tests/channels/pjsip/basic_calls/incoming/off-nominal/invalid_sdp/configs/ast1/pjsip.conf
@@ -0,0 +1,22 @@
+[transport]
+type=transport
+bind=127.0.0.1:5060
+protocol=udp
+
+[endpoint-template](!)
+type=endpoint
+context=default
+allow=!all,alaw,vp8
+direct_media=no
+identify_by=username
+
+[aor-template](!)
+type=aor
+
+
+[sipp](endpoint-template)
+from_user=sipp
+aors=sipp
+
+[sipp](aor-template)
+contact=sip:sipp at 127.0.0.1:5061\;transport=udp
diff --git a/tests/channels/pjsip/basic_calls/incoming/off-nominal/invalid_sdp/sipp/uac_invalid_deferred_answer.xml b/tests/channels/pjsip/basic_calls/incoming/off-nominal/invalid_sdp/sipp/uac_invalid_deferred_answer.xml
new file mode 100644
index 0000000..d9f935d
--- /dev/null
+++ b/tests/channels/pjsip/basic_calls/incoming/off-nominal/invalid_sdp/sipp/uac_invalid_deferred_answer.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+<scenario name="Deferred SDP exchange with invalid SDP answer">
+	<send retrans="500">
+		<![CDATA[
+			INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
+			Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+			From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+			To: sut <sip:[service]@[remote_ip]>
+			Call-ID: [call_id]
+			CSeq: 1 INVITE
+			Contact: <sip:sipp@[local_ip]:[local_port]>
+			Max-Forwards: 70
+			Subject: Performance Test
+			Content-Length: 0
+		]]>
+	</send>
+
+	<recv response="100" optional="true">
+	</recv>
+
+	<recv response="200" rtd="true">
+	</recv>
+
+	<send>
+		<![CDATA[
+			ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0
+			Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+			From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+			To: sut <sip:[service]@[remote_ip]>[peer_tag_param]
+			Call-ID: [call_id]
+			CSeq: 1 ACK
+			Contact: <sip:sipp@[local_ip]:[local_port]>
+			Max-Forwards: 70
+			Subject: Performance Test
+			Content-Type: application/sdp
+			Content-Length: [len]
+
+			v=0
+			o=CGPLeg607266 362679584 181339793 IN IP[local_ip_type] [local_ip]
+			s=[sipp_version]
+			c=IN IP[media_ip_type] [media_ip]
+			t=0 0
+			m=audio [media_port] RTP/AVP 8 101
+			a=rtpmap:8 PCMA/8000
+			a=rtpmap:101 telephone-event/8000
+			a=fmtp:101 0-16
+			a=ptime:20
+			a=rtcpping:F:1253985:125398578
+			m=video [media_port+2] RTP/AVP 100
+			a=inactive
+			a=rtcpping:F:1253986:125398678
+		]]>
+	</send>
+
+	<recv request="BYE" rtd="true" crlf="true">
+	</recv>
+
+	<send>
+		<![CDATA[
+			SIP/2.0 200 OK
+			[last_Via:]
+			[last_From:]
+			[last_To:]
+			[last_Call-ID:]
+			[last_CSeq:]
+			Content-Length: 0
+		]]>
+	</send>
+</scenario>
+
diff --git a/tests/channels/pjsip/basic_calls/incoming/off-nominal/invalid_sdp/sipp/uac_invalid_offer.xml b/tests/channels/pjsip/basic_calls/incoming/off-nominal/invalid_sdp/sipp/uac_invalid_offer.xml
new file mode 100644
index 0000000..3d871be
--- /dev/null
+++ b/tests/channels/pjsip/basic_calls/incoming/off-nominal/invalid_sdp/sipp/uac_invalid_offer.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+<scenario name="Invalid SDP offer">
+	<send retrans="500">
+		<![CDATA[
+			INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
+			Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+			From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+			To: sut <sip:[service]@[remote_ip]>
+			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=CGPLeg607266 362679584 181339793 IN IP[local_ip_type] [local_ip]
+			s=[sipp_version]
+			c=IN IP[media_ip_type] [media_ip]
+			t=0 0
+			m=audio [media_port] RTP/AVP 8 101
+			a=rtpmap:8 PCMA/8000
+			a=rtpmap:101 telephone-event/8000
+			a=fmtp:101 0-16
+			a=ptime:20
+			a=rtcpping:F:1253985:125398578
+			m=video [media_port+2] RTP/AVP 100
+			a=inactive
+			a=rtcpping:F:1253986:125398678
+		]]>
+	</send>
+
+	<recv response="100" optional="true">
+	</recv>
+
+	<recv response="400" rtd="true">
+	</recv>
+
+	<send>
+		<![CDATA[
+			ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0
+			Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+			From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+			To: sut <sip:[service]@[remote_ip]>[peer_tag_param]
+			Call-ID: [call_id]
+			CSeq: 1 ACK
+			Contact: <sip:sipp@[local_ip]:[local_port]>
+			Max-Forwards: 70
+			Subject: Performance Test
+			Content-Length: 0
+		]]>
+	</send>
+</scenario>
+
diff --git a/tests/channels/pjsip/basic_calls/incoming/off-nominal/invalid_sdp/sipp/uac_missing_deferred_answer.xml b/tests/channels/pjsip/basic_calls/incoming/off-nominal/invalid_sdp/sipp/uac_missing_deferred_answer.xml
new file mode 100644
index 0000000..ae61d51
--- /dev/null
+++ b/tests/channels/pjsip/basic_calls/incoming/off-nominal/invalid_sdp/sipp/uac_missing_deferred_answer.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+<scenario name="Deferred SDP exchange with missing SDP answer">
+	<send retrans="500">
+		<![CDATA[
+			INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
+			Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+			From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+			To: sut <sip:[service]@[remote_ip]>
+			Call-ID: [call_id]
+			CSeq: 1 INVITE
+			Contact: <sip:sipp@[local_ip]:[local_port]>
+			Max-Forwards: 70
+			Subject: Performance Test
+			Content-Length: 0
+		]]>
+	</send>
+
+	<recv response="100" optional="true">
+	</recv>
+
+	<recv response="200" rtd="true">
+	</recv>
+
+	<send>
+		<![CDATA[
+			ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0
+			Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+			From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+			To: sut <sip:[service]@[remote_ip]>[peer_tag_param]
+			Call-ID: [call_id]
+			CSeq: 1 ACK
+			Contact: <sip:sipp@[local_ip]:[local_port]>
+			Max-Forwards: 70
+			Subject: Performance Test
+			Content-Length: 0
+		]]>
+	</send>
+
+	<recv request="BYE" rtd="true" crlf="true">
+	</recv>
+
+	<send>
+		<![CDATA[
+			SIP/2.0 200 OK
+			[last_Via:]
+			[last_From:]
+			[last_To:]
+			[last_Call-ID:]
+			[last_CSeq:]
+			Content-Length: 0
+		]]>
+	</send>
+</scenario>
+
diff --git a/tests/channels/pjsip/basic_calls/incoming/off-nominal/invalid_sdp/sipp/uac_valid_deferred_answer.xml b/tests/channels/pjsip/basic_calls/incoming/off-nominal/invalid_sdp/sipp/uac_valid_deferred_answer.xml
new file mode 100644
index 0000000..316fbf9
--- /dev/null
+++ b/tests/channels/pjsip/basic_calls/incoming/off-nominal/invalid_sdp/sipp/uac_valid_deferred_answer.xml
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+<scenario name="Deferred SDP exchange with valid SDP answer">
+	<send retrans="500">
+		<![CDATA[
+			INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
+			Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+			From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+			To: sut <sip:[service]@[remote_ip]>
+			Call-ID: [call_id]
+			CSeq: 1 INVITE
+			Contact: <sip:sipp@[local_ip]:[local_port]>
+			Max-Forwards: 70
+			Subject: Performance Test
+			Content-Length: 0
+		]]>
+	</send>
+
+	<recv response="100" optional="true">
+	</recv>
+
+	<recv response="200" rtd="true">
+	</recv>
+
+	<send>
+		<![CDATA[
+			ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0
+			Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+			From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+			To: sut <sip:[service]@[remote_ip]>[peer_tag_param]
+			Call-ID: [call_id]
+			CSeq: 1 ACK
+			Contact: <sip:sipp@[local_ip]:[local_port]>
+			Max-Forwards: 70
+			Subject: Performance Test
+			Content-Type: application/sdp
+			Content-Length: [len]
+
+			v=0
+			o=CGPLeg607266 362679584 181339793 IN IP[local_ip_type] [local_ip]
+			s=[sipp_version]
+			c=IN IP[media_ip_type] [media_ip]
+			t=0 0
+			m=audio [media_port] RTP/AVP 8 101
+			a=rtpmap:8 PCMA/8000
+			a=rtpmap:101 telephone-event/8000
+			a=fmtp:101 0-16
+			a=ptime:20
+			a=rtcpping:F:1253985:125398578
+			m=video [media_port+2] RTP/AVP 100
+			a=rtpmap:100 VP8/90000
+			a=inactive
+			a=rtcpping:F:1253986:125398678
+		]]>
+	</send>
+
+	<!-- Linger awhile in case we get some unexpected message. -->
+	<pause/>
+	<pause/>
+	<pause/>
+	<pause/>
+
+	<send retrans="500">
+		<![CDATA[
+			BYE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
+			Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+			From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+			To: sut <sip:[service]@[remote_ip]>[peer_tag_param]
+			Call-ID: [call_id]
+			CSeq: 2 BYE
+			Contact: <sip:sipp@[local_ip]:[local_port]>
+			Max-Forwards: 70
+			Subject: Performance Test
+			Content-Length: 0
+		]]>
+	</send>
+
+	<recv response="200" crlf="true">
+	</recv>
+</scenario>
+
diff --git a/tests/channels/pjsip/basic_calls/incoming/off-nominal/invalid_sdp/test-config.yaml b/tests/channels/pjsip/basic_calls/incoming/off-nominal/invalid_sdp/test-config.yaml
new file mode 100644
index 0000000..721f275
--- /dev/null
+++ b/tests/channels/pjsip/basic_calls/incoming/off-nominal/invalid_sdp/test-config.yaml
@@ -0,0 +1,48 @@
+testinfo:
+    summary: 'Test incoming calls that have invalid SDP from the caller'
+    description: |
+        'There are four scenarios being tested.
+        1) Incoming call with invalid SDP offer.  Expecting a 400 Bad Request.
+        2) Incoming call with invalid deferred SDP answer.  Call should get
+           disconnected immediately.
+        3) Incoming call with missing deferred SDP answer.  Call should get
+           disconnected immediately.
+
+        And finally to make sure the nominal case works:
+
+        4) Incoming call with valid deferred SDP answer.  Call should stay
+           connected.'
+
+test-modules:
+    test-object:
+        config-section: sipp-config
+        typename: 'sipp.SIPpTestCase'
+
+sipp-config:
+    fail-on-any: True
+    test-iterations:
+        -
+            scenarios:
+                - { 'key-args': {'-i': '127.0.0.1', '-p': '5061', '-s': 'echo', '-d': '500', 'scenario': 'uac_invalid_offer.xml'}}
+        -
+            scenarios:
+                - { 'key-args': {'-i': '127.0.0.1', '-p': '5061', '-s': 'echo', '-d': '500', 'scenario': 'uac_invalid_deferred_answer.xml'}}
+        -
+            scenarios:
+                - { 'key-args': {'-i': '127.0.0.1', '-p': '5061', '-s': 'echo', '-d': '500', 'scenario': 'uac_missing_deferred_answer.xml'}}
+        -
+            scenarios:
+                - { 'key-args': {'-i': '127.0.0.1', '-p': '5061', '-s': 'echo', '-d': '500', 'scenario': 'uac_valid_deferred_answer.xml'}}
+
+
+properties:
+    minversion: '13.11.0'
+    dependencies:
+        - sipp:
+            version: 'v3.0'
+        - asterisk: 'app_echo'
+        - asterisk: 'res_pjsip'
+        - asterisk: 'res_pjsip_session'
+        - asterisk: 'res_pjsip_sdp_rtp'
+    tags:
+        - pjsip
diff --git a/tests/channels/pjsip/basic_calls/incoming/off-nominal/tests.yaml b/tests/channels/pjsip/basic_calls/incoming/off-nominal/tests.yaml
index dc95719..e362fa3 100644
--- a/tests/channels/pjsip/basic_calls/incoming/off-nominal/tests.yaml
+++ b/tests/channels/pjsip/basic_calls/incoming/off-nominal/tests.yaml
@@ -1,4 +1,5 @@
 tests:
     - dir: 'userpass'
     - test: 'incompatible_codecs'
+    - test: 'invalid_sdp'
     - test: 'md5'

-- 
To view, visit https://gerrit.asterisk.org/3121
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I094b3a40255b3ee43aa50ec9be5aab24fc4b1002
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>



More information about the asterisk-commits mailing list