[Asterisk-code-review] Add test for SIP BYE with Also header (testsuite[master])

Mark Michelson asteriskteam at digium.com
Fri Jun 12 12:05:48 CDT 2015


Mark Michelson has uploaded a new change for review.

  https://gerrit.asterisk.org/649

Change subject: Add test for SIP BYE with Also header
......................................................................

Add test for SIP BYE with Also header

This test launches ten simultaneous SIPp scenarios. Each scenario places
a call to an extension that calls a local channel. The local channel
then calls the Echo() application.

The SIPp scenarios send a BYE with Also header in order to transfer the
;1 side of the local channel to the Echo() application as well.

This test exists both to ensure that a SIP BYE with Also header
functions as expected as well as to ensure that an observed deadlock
that had previously occurred does not happen any longer.

Change-Id: I687d28a725980fb6ccbc9b8a361d2603baee522c
---
A tests/channels/SIP/sip_bye_also/configs/ast1/extensions.conf
A tests/channels/SIP/sip_bye_also/configs/ast1/sip.conf
A tests/channels/SIP/sip_bye_also/sipp/uac-bye-also.xml
A tests/channels/SIP/sip_bye_also/test-config.yaml
M tests/channels/SIP/tests.yaml
5 files changed, 153 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/49/649/1

diff --git a/tests/channels/SIP/sip_bye_also/configs/ast1/extensions.conf b/tests/channels/SIP/sip_bye_also/configs/ast1/extensions.conf
new file mode 100644
index 0000000..c73557a
--- /dev/null
+++ b/tests/channels/SIP/sip_bye_also/configs/ast1/extensions.conf
@@ -0,0 +1,9 @@
+[default]
+
+exten => echo,1,NoOp()
+same => n,Answer()
+same => n,Echo()
+same => n,Hangup()
+
+exten => 200,1,NoOp()
+same => n,Dial(Local/echo at default/n)
diff --git a/tests/channels/SIP/sip_bye_also/configs/ast1/sip.conf b/tests/channels/SIP/sip_bye_also/configs/ast1/sip.conf
new file mode 100644
index 0000000..6b6004d
--- /dev/null
+++ b/tests/channels/SIP/sip_bye_also/configs/ast1/sip.conf
@@ -0,0 +1,9 @@
+[general]
+bindaddr = 127.0.0.1
+bindport = 5060
+
+[sipp]
+type = peer
+context = default
+host = 127.0.0.1
+port = 5061
diff --git a/tests/channels/SIP/sip_bye_also/sipp/uac-bye-also.xml b/tests/channels/SIP/sip_bye_also/sipp/uac-bye-also.xml
new file mode 100644
index 0000000..2f2ccc2
--- /dev/null
+++ b/tests/channels/SIP/sip_bye_also/sipp/uac-bye-also.xml
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="SIP BYE also">
+  <!-- In client mode (sipp placing calls), the Call-ID MUST be         -->
+  <!-- generated by sipp. To do so, use [call_id] keyword.                -->
+  <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=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:8 PCMA/8000
+      a=rtpmap:0 PCMU/8000
+      a=ptime:20
+
+    ]]>
+  </send>
+
+  <recv response="100"
+        optional="true">
+  </recv>
+
+  <recv response="181"
+        optional="true">
+  </recv>
+
+  <recv response="180" optional="true">
+  </recv>
+
+  <recv response="183" 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>
+
+  <pause/>
+
+  <!-- The 'crlf' option inserts a blank line in the statistics report. -->
+  <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
+      Also: <sip:echo@[remote_ip]:[remote_port]>
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <recv response="200" crlf="true">
+  </recv>
+
+</scenario>
+
diff --git a/tests/channels/SIP/sip_bye_also/test-config.yaml b/tests/channels/SIP/sip_bye_also/test-config.yaml
new file mode 100644
index 0000000..bf441de
--- /dev/null
+++ b/tests/channels/SIP/sip_bye_also/test-config.yaml
@@ -0,0 +1,40 @@
+testinfo:
+    summary: 'Test SIP blind transfer using BYE with Also header'
+    description: |
+        'This test performs the following test:
+            * A SIPp scenario establishes a call to Asterisk
+            * The incoming call calls a Local channel
+            * The Local channel executes the Echo application
+            * The SIPp scenario sends a BYE with Also header to
+              blind transfer one side of the Local channel to the
+              Echo application
+         The scenario is run ten times in parallel. This establishes
+         that the test works, and it also ensures that a previously
+         observed deadlock in this code path does not occur.'
+
+test-modules:
+    test-object:
+        config-section: sipp-config
+        typename: 'sipp.SIPpAMIActionTestCase'
+
+sipp-config:
+    fail-on-any: True
+    test-iterations:
+        -
+            scenarios:
+                - { 'key-args': {'scenario': 'uac-bye-also.xml', '-p': '5061', '-m': '10', '-s': '200'} }
+    ami-action:
+        delay: 1
+        args:
+            Action: 'Hangup'
+            Channel: '/Local.*;1/'
+
+properties:
+    minversion: ''
+    dependencies:
+        - python: 'starpy'
+        - sipp:
+            version: 'v3.0'
+        - asterisk: 'chan_sip'
+    tags:
+        - SIP
diff --git a/tests/channels/SIP/tests.yaml b/tests/channels/SIP/tests.yaml
index 9524a68..9796d00 100644
--- a/tests/channels/SIP/tests.yaml
+++ b/tests/channels/SIP/tests.yaml
@@ -72,3 +72,4 @@
     - test: 'invite_retransmit'
     - test: 'no_ack_dialog_cleanup'
     - test: 'no_reinvite_after_491'
+    - test: 'sip_bye_also'

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I687d28a725980fb6ccbc9b8a361d2603baee522c
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Mark Michelson <mmichelson at digium.com>



More information about the asterisk-code-review mailing list