[Asterisk-code-review] large number of accept headers: Add PJSIP test for Accept he... (testsuite[newmaster])
Kevin Harwell
asteriskteam at digium.com
Wed Mar 7 17:23:36 CST 2018
Kevin Harwell has uploaded this change for review. ( https://gerrit.asterisk.org/8470
Change subject: large_number_of_accept_headers: Add PJSIP test for Accept headers.
......................................................................
large_number_of_accept_headers: Add PJSIP test for Accept headers.
This change adds a test which sends a SUBSCRIBE to PJSIP
containing a large number of Accept headers. If Asterisk crashes
the test fails. If the SUBSCRIBE receives a 200 OK response the
test passes.
ASTERISK-27640
Change-Id: I743941d26ba2a8a5760a718fae55963c28e032bc
(cherry picked from commit cdece6d4e82085ea7952143e52bf7054f785c3be)
---
A tests/channels/pjsip/subscriptions/large_number_of_accept_headers/configs/ast1/pjsip.conf
A tests/channels/pjsip/subscriptions/large_number_of_accept_headers/sipp/subscribe.xml
A tests/channels/pjsip/subscriptions/large_number_of_accept_headers/test-config.yaml
M tests/channels/pjsip/subscriptions/tests.yaml
4 files changed, 113 insertions(+), 0 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/70/8470/1
diff --git a/tests/channels/pjsip/subscriptions/large_number_of_accept_headers/configs/ast1/pjsip.conf b/tests/channels/pjsip/subscriptions/large_number_of_accept_headers/configs/ast1/pjsip.conf
new file mode 100644
index 0000000..d1ceff6
--- /dev/null
+++ b/tests/channels/pjsip/subscriptions/large_number_of_accept_headers/configs/ast1/pjsip.conf
@@ -0,0 +1,17 @@
+[global]
+type = global
+debug = yes
+
+[transport]
+type = transport
+protocol = udp
+bind = 127.0.0.1
+
+[sipp]
+type = endpoint
+rewrite_contact = yes
+aors = sipp
+
+[sipp]
+type = aor
+mailboxes = sipp
diff --git a/tests/channels/pjsip/subscriptions/large_number_of_accept_headers/sipp/subscribe.xml b/tests/channels/pjsip/subscriptions/large_number_of_accept_headers/sipp/subscribe.xml
new file mode 100644
index 0000000..b9bad30
--- /dev/null
+++ b/tests/channels/pjsip/subscriptions/large_number_of_accept_headers/sipp/subscribe.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="NAT NOTIFY">
+ <send retrans="500">
+ <![CDATA[
+
+ SUBSCRIBE 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]:[remote_port]>
+ Call-ID: [call_id]
+ CSeq: 1 SUBSCRIBE
+ Contact: sip:sipp at 192.168.0.1:12345
+ Max-Forwards: 70
+ Subject: Performance Test
+ Event: message-summary
+ Supported: eventlist
+ Accept: application/simple-message-summary
+ Accept: application/simple-message-summary
+ Accept: application/simple-message-summary
+ Accept: application/simple-message-summary
+ Accept: application/simple-message-summary
+ Accept: application/simple-message-summary
+ Accept: application/simple-message-summary
+ Accept: application/simple-message-summary
+ Accept: application/simple-message-summary
+ Accept: application/simple-message-summary
+ Accept: application/simple-message-summary
+ Accept: application/simple-message-summary
+ Accept: application/simple-message-summary
+ Accept: application/simple-message-summary
+ Accept: application/simple-message-summary
+ Accept: application/simple-message-summary
+ Accept: application/simple-message-summary
+ Accept: application/simple-message-summary
+ Accept: application/simple-message-summary
+ Accept: application/simple-message-summary
+ Accept: application/simple-message-summary
+ Accept: application/simple-message-summary
+ Accept: application/simple-message-summary
+ Accept: application/simple-message-summary
+ Accept: application/simple-message-summary
+ Accept: application/simple-message-summary
+ Accept: application/simple-message-summary
+ Accept: application/simple-message-summary
+ Accept: application/simple-message-summary
+ Accept: application/simple-message-summary
+ Accept: application/simple-message-summary
+ Accept: application/simple-message-summary
+ Accept: application/simple-message-summary
+ Accept: application/simple-message-summary
+ Accept: application/simple-message-summary
+ Accept: application/simple-message-summary
+ Expires: 3600
+ Content-Length: 0
+
+ ]]>
+ </send>
+
+ <recv response="100"
+ optional="true">
+ </recv>
+
+ <recv response="200" rtd="true" />
+
+</scenario>
diff --git a/tests/channels/pjsip/subscriptions/large_number_of_accept_headers/test-config.yaml b/tests/channels/pjsip/subscriptions/large_number_of_accept_headers/test-config.yaml
new file mode 100644
index 0000000..6093e9d
--- /dev/null
+++ b/tests/channels/pjsip/subscriptions/large_number_of_accept_headers/test-config.yaml
@@ -0,0 +1,28 @@
+testinfo:
+ summary: 'Ensure that sending a large number of Accept headers in a SUBSCRIBE does not crash'
+ description: |
+ 'This test runs a SIPp scenario that sends a SUBSCRIBE with a large number of Accept headers.
+ If the subscription is successful then the test passes. If a crash occurs then the test fails.'
+
+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.xml', '-s': 'sipp' }}
+properties:
+ minversion: [ '13.19.2', '15.2.2' ]
+ dependencies:
+ - python: 'twisted'
+ - python: 'starpy'
+ - asterisk: 'res_pjsip'
+ - asterisk: 'res_pjsip_pubsub'
+ - asterisk: 'res_pjsip_mwi'
+ tags:
+ - pjsip
diff --git a/tests/channels/pjsip/subscriptions/tests.yaml b/tests/channels/pjsip/subscriptions/tests.yaml
index deebc2a..5377eb0 100644
--- a/tests/channels/pjsip/subscriptions/tests.yaml
+++ b/tests/channels/pjsip/subscriptions/tests.yaml
@@ -11,3 +11,4 @@
- test: 'subscribe_context'
- test: 'unallowed'
- test: 'unknown_event_package'
+ - test: 'large_number_of_accept_headers'
--
To view, visit https://gerrit.asterisk.org/8470
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: testsuite
Gerrit-Branch: newmaster
Gerrit-MessageType: newchange
Gerrit-Change-Id: I743941d26ba2a8a5760a718fae55963c28e032bc
Gerrit-Change-Number: 8470
Gerrit-PatchSet: 1
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180307/74e16027/attachment-0001.html>
More information about the asterisk-code-review
mailing list