[asterisk-commits] res pjsip: Add test for new endpoint's option "subscribe con... (testsuite[master])
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Jul 12 15:32:18 CDT 2016
Anonymous Coward #1000019 has submitted this change and it was merged.
Change subject: res_pjsip: Add test for new endpoint's option "subscribe_context"
......................................................................
res_pjsip: Add test for new endpoint's option "subscribe_context"
Test the option "subscribe_context" is used when it should be
Change-Id: I51d97eab6aa04fff9b9ddb77d985183f3056e452
---
A tests/channels/pjsip/subscriptions/subscribe_context/configs/ast1/extensions.conf
A tests/channels/pjsip/subscriptions/subscribe_context/configs/ast1/pjsip.conf
A tests/channels/pjsip/subscriptions/subscribe_context/sipp/subscribe_200.xml
A tests/channels/pjsip/subscriptions/subscribe_context/sipp/subscribe_404.xml
A tests/channels/pjsip/subscriptions/subscribe_context/test-config.yaml
M tests/channels/pjsip/subscriptions/tests.yaml
6 files changed, 151 insertions(+), 0 deletions(-)
Approvals:
George Joseph: 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/subscriptions/subscribe_context/configs/ast1/extensions.conf b/tests/channels/pjsip/subscriptions/subscribe_context/configs/ast1/extensions.conf
new file mode 100644
index 0000000..0837ee1
--- /dev/null
+++ b/tests/channels/pjsip/subscriptions/subscribe_context/configs/ast1/extensions.conf
@@ -0,0 +1,7 @@
+[general]
+
+[alice]
+exten => alice,1,Noop
+
+[alice_subscribe]
+exten => 555,hint,PJSIP/alice
diff --git a/tests/channels/pjsip/subscriptions/subscribe_context/configs/ast1/pjsip.conf b/tests/channels/pjsip/subscriptions/subscribe_context/configs/ast1/pjsip.conf
new file mode 100644
index 0000000..8ec7e20
--- /dev/null
+++ b/tests/channels/pjsip/subscriptions/subscribe_context/configs/ast1/pjsip.conf
@@ -0,0 +1,51 @@
+[local]
+type=transport
+protocol=udp
+bind=0.0.0.0
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+[endpoint_t](!)
+type=endpoint
+transport=local
+direct_media=no
+disallow=all
+allow=ulaw
+
+[aor_t](!)
+type=aor
+max_contacts=1
+
+[alice_sc_good](aor_t)
+contact=sip:alice at 127.0.0.1:5061
+
+[alice_sc_bad](aor_t)
+contact=sip:alice at 127.0.0.1:5062
+
+[alice_non_sc_good](aor_t)
+contact=sip:alice at 127.0.0.1:5063
+
+[alice_non_sc_bad](aor_t)
+contact=sip:alice at 127.0.0.1:5064
+
+[alice_sc_good](endpoint_t)
+aors=alice_sc_good
+allow_subscribe=yes
+context=alice
+subscribe_context=alice_subscribe
+
+[alice_sc_bad](endpoint_t)
+aors=alice_sc_bad
+allow_subscribe=yes
+context=alice
+subscribe_context=alice
+
+[alice_non_sc_good](endpoint_t)
+aors=alice_non_sc_good
+context=alice_subscribe
+allow_subscribe=yes
+
+[alice_non_sc_bad](endpoint_t)
+aors=alice_non_sc_bad
+context=alice
+allow_subscribe=yes
diff --git a/tests/channels/pjsip/subscriptions/subscribe_context/sipp/subscribe_200.xml b/tests/channels/pjsip/subscriptions/subscribe_context/sipp/subscribe_200.xml
new file mode 100644
index 0000000..7fe9aa3
--- /dev/null
+++ b/tests/channels/pjsip/subscriptions/subscribe_context/sipp/subscribe_200.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Subscribe">
+ <send retrans="500">
+ <![CDATA[
+ SUBSCRIBE sip:555@[remote_ip]:[remote_port] SIP/2.0
+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+ From: "[service]" <sip:[service]@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+ To: <sip:555@[remote_ip]:[remote_port]>
+ Call-ID: [call_id]
+ CSeq: 1 SUBSCRIBE
+ Contact: "[service]" <sip:[service]@[local_ip]:[local_port]>
+ Expires: 3600
+ Max-Forwards: 70
+ Event: dialog
+ Accept: application/dialog-info+xml
+ User-Agent: SIPP
+ Content-Length: 0
+
+ ]]>
+ </send>
+
+ <recv response="200" rtd="true" />
+
+</scenario>
diff --git a/tests/channels/pjsip/subscriptions/subscribe_context/sipp/subscribe_404.xml b/tests/channels/pjsip/subscriptions/subscribe_context/sipp/subscribe_404.xml
new file mode 100644
index 0000000..cb4c306
--- /dev/null
+++ b/tests/channels/pjsip/subscriptions/subscribe_context/sipp/subscribe_404.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Subscribe">
+ <send retrans="500">
+ <![CDATA[
+ SUBSCRIBE sip:555@[remote_ip]:[remote_port] SIP/2.0
+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+ From: "[service]" <sip:[service]@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+ To: <sip:555@[remote_ip]:[remote_port]>
+ Call-ID: [call_id]
+ CSeq: 1 SUBSCRIBE
+ Contact: "[service]" <sip:[service]@[local_ip]:[local_port]>
+ Expires: 3600
+ Max-Forwards: 70
+ Event: dialog
+ Accept: application/dialog-info+xml
+ User-Agent: SIPP
+ Content-Length: 0
+
+ ]]>
+ </send>
+
+ <recv response="404" rtd="true" />
+
+</scenario>
diff --git a/tests/channels/pjsip/subscriptions/subscribe_context/test-config.yaml b/tests/channels/pjsip/subscriptions/subscribe_context/test-config.yaml
new file mode 100644
index 0000000..0dfc29c
--- /dev/null
+++ b/tests/channels/pjsip/subscriptions/subscribe_context/test-config.yaml
@@ -0,0 +1,40 @@
+testinfo:
+ summary: 'Test the option "subscribe_context" is used when it should be.'
+ description: |
+ '
+ * The "subscribe_context" is specified and there is extension in this context. Result: OK.
+
+ * The "subscribe_context" is specified and there isn't extension in this context. Result: Not Found.
+
+ * The "subscribe_context" isn't specified, the "context" setting is used
+ and there is extension in the "context". Result: OK.
+
+ * The "subscribe_context" isn't specified, the "context" setting is used
+ and there isn't extension in the "context". Result: Not Found.
+ '
+
+properties:
+ minversion: '13.11.0'
+ dependencies:
+ - python : 'twisted'
+ - python : 'starpy'
+ - asterisk : 'res_pjsip'
+ - asterisk : 'res_pjsip_exten_state'
+ tags:
+ - pjsip
+
+test-modules:
+ test-object:
+ config-section: sipp-config
+ typename: 'sipp.SIPpTestCase'
+
+sipp-config:
+ reactor-timeout: 30
+ fail-on-any: True
+ test-iterations:
+ -
+ scenarios:
+ - { 'key-args': {'scenario': 'subscribe_200.xml', '-p': '5061', '-s': 'alice_sc_good'} }
+ - { 'key-args': {'scenario': 'subscribe_404.xml', '-p': '5062', '-s': 'alice_sc_bad'} }
+ - { 'key-args': {'scenario': 'subscribe_200.xml', '-p': '5063', '-s': 'alice_non_sc_good'} }
+ - { 'key-args': {'scenario': 'subscribe_404.xml', '-p': '5064', '-s': 'alice_non_sc_bad'} }
diff --git a/tests/channels/pjsip/subscriptions/tests.yaml b/tests/channels/pjsip/subscriptions/tests.yaml
index 136197d..e44b7ca 100644
--- a/tests/channels/pjsip/subscriptions/tests.yaml
+++ b/tests/channels/pjsip/subscriptions/tests.yaml
@@ -9,3 +9,4 @@
- dir: 'rls'
- test: 'mismatch'
- test: 'nat_notify'
+ - test: 'subscribe_context'
--
To view, visit https://gerrit.asterisk.org/3149
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I51d97eab6aa04fff9b9ddb77d985183f3056e452
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Alexei Gradinari <alex2grad at gmail.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
More information about the asterisk-commits
mailing list