<p>Kevin Harwell has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/8470">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">large_number_of_accept_headers: Add PJSIP test for Accept headers.<br><br>This change adds a test which sends a SUBSCRIBE to PJSIP<br>containing a large number of Accept headers. If Asterisk crashes<br>the test fails. If the SUBSCRIBE receives a 200 OK response the<br>test passes.<br><br>ASTERISK-27640<br><br>Change-Id: I743941d26ba2a8a5760a718fae55963c28e032bc<br>(cherry picked from commit cdece6d4e82085ea7952143e52bf7054f785c3be)<br>---<br>A tests/channels/pjsip/subscriptions/large_number_of_accept_headers/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/subscriptions/large_number_of_accept_headers/sipp/subscribe.xml<br>A tests/channels/pjsip/subscriptions/large_number_of_accept_headers/test-config.yaml<br>M tests/channels/pjsip/subscriptions/tests.yaml<br>4 files changed, 113 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/70/8470/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">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<br>new file mode 100644<br>index 0000000..d1ceff6<br>--- /dev/null<br>+++ b/tests/channels/pjsip/subscriptions/large_number_of_accept_headers/configs/ast1/pjsip.conf<br>@@ -0,0 +1,17 @@<br>+[global]<br>+type = global<br>+debug = yes<br>+<br>+[transport]<br>+type = transport<br>+protocol = udp<br>+bind = 127.0.0.1<br>+<br>+[sipp]<br>+type = endpoint<br>+rewrite_contact = yes<br>+aors = sipp<br>+<br>+[sipp]<br>+type = aor<br>+mailboxes = sipp<br>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<br>new file mode 100644<br>index 0000000..b9bad30<br>--- /dev/null<br>+++ b/tests/channels/pjsip/subscriptions/large_number_of_accept_headers/sipp/subscribe.xml<br>@@ -0,0 +1,67 @@<br>+<?xml version="1.0" encoding="ISO-8859-1" ?><br>+<!DOCTYPE scenario SYSTEM "sipp.dtd"><br>+<br>+<scenario name="NAT NOTIFY"><br>+  <send retrans="500"><br>+    <![CDATA[<br>+<br>+      SUBSCRIBE sip:[service]@[remote_ip]:[remote_port] SIP/2.0<br>+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]<br>+      From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]<br>+      To: sut <sip:[service]@[remote_ip]:[remote_port]><br>+      Call-ID: [call_id]<br>+      CSeq: 1 SUBSCRIBE<br>+      Contact: sip:sipp@192.168.0.1:12345<br>+      Max-Forwards: 70<br>+      Subject: Performance Test<br>+      Event: message-summary<br>+      Supported: eventlist<br>+      Accept: application/simple-message-summary<br>+      Accept: application/simple-message-summary<br>+      Accept: application/simple-message-summary<br>+      Accept: application/simple-message-summary<br>+      Accept: application/simple-message-summary<br>+      Accept: application/simple-message-summary<br>+      Accept: application/simple-message-summary<br>+      Accept: application/simple-message-summary<br>+      Accept: application/simple-message-summary<br>+      Accept: application/simple-message-summary<br>+      Accept: application/simple-message-summary<br>+      Accept: application/simple-message-summary<br>+      Accept: application/simple-message-summary<br>+      Accept: application/simple-message-summary<br>+      Accept: application/simple-message-summary<br>+      Accept: application/simple-message-summary<br>+      Accept: application/simple-message-summary<br>+      Accept: application/simple-message-summary<br>+      Accept: application/simple-message-summary<br>+      Accept: application/simple-message-summary<br>+      Accept: application/simple-message-summary<br>+      Accept: application/simple-message-summary<br>+      Accept: application/simple-message-summary<br>+      Accept: application/simple-message-summary<br>+      Accept: application/simple-message-summary<br>+      Accept: application/simple-message-summary<br>+      Accept: application/simple-message-summary<br>+      Accept: application/simple-message-summary<br>+      Accept: application/simple-message-summary<br>+      Accept: application/simple-message-summary<br>+      Accept: application/simple-message-summary<br>+      Accept: application/simple-message-summary<br>+      Accept: application/simple-message-summary<br>+      Accept: application/simple-message-summary<br>+      Accept: application/simple-message-summary<br>+      Accept: application/simple-message-summary<br>+      Expires: 3600<br>+      Content-Length: 0<br>+<br>+    ]]><br>+  </send><br>+<br>+  <recv response="100"<br>+        optional="true"><br>+  </recv><br>+<br>+  <recv response="200" rtd="true" /><br>+<br>+</scenario><br>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<br>new file mode 100644<br>index 0000000..6093e9d<br>--- /dev/null<br>+++ b/tests/channels/pjsip/subscriptions/large_number_of_accept_headers/test-config.yaml<br>@@ -0,0 +1,28 @@<br>+testinfo:<br>+    summary: 'Ensure that sending a large number of Accept headers in a SUBSCRIBE does not crash'<br>+    description: |<br>+        'This test runs a SIPp scenario that sends a SUBSCRIBE with a large number of Accept headers.<br>+        If the subscription is successful then the test passes. If a crash occurs then the test fails.'<br>+<br>+test-modules:<br>+    test-object:<br>+        config-section: sipp-config<br>+        typename: 'sipp.SIPpTestCase'<br>+<br>+sipp-config:<br>+    reactor-timeout: 30<br>+    fail-on-any: True<br>+    test-iterations:<br>+        -<br>+            scenarios:<br>+                - {'key-args': { 'scenario': 'subscribe.xml', '-s': 'sipp' }}<br>+properties:<br>+    minversion: [ '13.19.2', '15.2.2' ]<br>+    dependencies:<br>+        - python: 'twisted'<br>+        - python: 'starpy'<br>+        - asterisk: 'res_pjsip'<br>+        - asterisk: 'res_pjsip_pubsub'<br>+        - asterisk: 'res_pjsip_mwi'<br>+    tags:<br>+        - pjsip<br>diff --git a/tests/channels/pjsip/subscriptions/tests.yaml b/tests/channels/pjsip/subscriptions/tests.yaml<br>index deebc2a..5377eb0 100644<br>--- a/tests/channels/pjsip/subscriptions/tests.yaml<br>+++ b/tests/channels/pjsip/subscriptions/tests.yaml<br>@@ -11,3 +11,4 @@<br>     - test: 'subscribe_context'<br>     - test: 'unallowed'<br>     - test: 'unknown_event_package'<br>+    - test: 'large_number_of_accept_headers'<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/8470">change 8470</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/8470"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: testsuite </div>
<div style="display:none"> Gerrit-Branch: newmaster </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I743941d26ba2a8a5760a718fae55963c28e032bc </div>
<div style="display:none"> Gerrit-Change-Number: 8470 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>