[asterisk-commits] kmoore: testsuite/asterisk/trunk r3033 - in /asterisk/trunk/tests/channels/SI...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Feb 9 15:06:14 CST 2012
Author: kmoore
Date: Thu Feb 9 15:06:05 2012
New Revision: 3033
URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=3033
Log:
Add tests to check parsing of compact and non-compact headers
This adds a header parsing test under SIP to test compact vs non-compact header
parsing and adds a place to put future header-parsing tests (in contrast with
the primarily SDP related parsing tests in codec_negotiation).
Review: https://reviewboard.asterisk.org/r/1729/
Added:
asterisk/trunk/tests/channels/SIP/header_parsing/
asterisk/trunk/tests/channels/SIP/header_parsing/configs/
asterisk/trunk/tests/channels/SIP/header_parsing/configs/ast1/
asterisk/trunk/tests/channels/SIP/header_parsing/configs/ast1/extensions.conf (with props)
asterisk/trunk/tests/channels/SIP/header_parsing/configs/ast1/sip.conf (with props)
asterisk/trunk/tests/channels/SIP/header_parsing/run-test (with props)
asterisk/trunk/tests/channels/SIP/header_parsing/sipp/
asterisk/trunk/tests/channels/SIP/header_parsing/sipp/mixed_compact.xml (with props)
asterisk/trunk/tests/channels/SIP/header_parsing/sipp/mixed_compact_inverse.xml (with props)
asterisk/trunk/tests/channels/SIP/header_parsing/test-config.yaml (with props)
Modified:
asterisk/trunk/tests/channels/SIP/tests.yaml
Added: asterisk/trunk/tests/channels/SIP/header_parsing/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/header_parsing/configs/ast1/extensions.conf?view=auto&rev=3033
==============================================================================
--- asterisk/trunk/tests/channels/SIP/header_parsing/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/channels/SIP/header_parsing/configs/ast1/extensions.conf Thu Feb 9 15:06:05 2012
@@ -1,0 +1,6 @@
+[default]
+
+exten => _.,1,NoOp()
+
+exten => test,1,Answer()
+exten => test,n,Wait(30) ; SIPp will hang up.
Propchange: asterisk/trunk/tests/channels/SIP/header_parsing/configs/ast1/extensions.conf
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/SIP/header_parsing/configs/ast1/extensions.conf
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/channels/SIP/header_parsing/configs/ast1/extensions.conf
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/SIP/header_parsing/configs/ast1/sip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/header_parsing/configs/ast1/sip.conf?view=auto&rev=3033
==============================================================================
--- asterisk/trunk/tests/channels/SIP/header_parsing/configs/ast1/sip.conf (added)
+++ asterisk/trunk/tests/channels/SIP/header_parsing/configs/ast1/sip.conf Thu Feb 9 15:06:05 2012
@@ -1,0 +1,10 @@
+[general]
+allowguest=no
+
+[guest1]
+type=user
+insecure=invite,port
+disallow=all
+allow=ulaw
+allow=h261
+allow=t140
Propchange: asterisk/trunk/tests/channels/SIP/header_parsing/configs/ast1/sip.conf
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/SIP/header_parsing/configs/ast1/sip.conf
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/channels/SIP/header_parsing/configs/ast1/sip.conf
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/SIP/header_parsing/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/header_parsing/run-test?view=auto&rev=3033
==============================================================================
--- asterisk/trunk/tests/channels/SIP/header_parsing/run-test (added)
+++ asterisk/trunk/tests/channels/SIP/header_parsing/run-test Thu Feb 9 15:06:05 2012
@@ -1,0 +1,49 @@
+#!/usr/bin/env python
+'''
+Copyright (C) 2012, Digium, Inc.
+Kinsey Moore <kmoore at digium.com>
+
+This program is free software, distributed under the terms of
+the GNU General Public License Version 2.
+'''
+
+import sys
+import os
+
+sys.path.append("lib/python")
+
+from twisted.internet import reactor
+from asterisk.sipp import SIPpTest
+
+
+WORKING_DIR = "sip/header_parsing"
+TEST_DIR = os.path.dirname(os.path.realpath(__file__))
+
+SIPP_SCENARIOS = [
+ {'scenario' : 'mixed_compact.xml',},
+ {'scenario' : 'mixed_compact_inverse.xml',},
+]
+
+# set port numberings and timeouts
+port = 5061
+def update_entry(entry):
+ global port
+ entry['-p'] = "%d" % port
+ port += 1
+
+# generate SIPP scenarios with appropriate port numbers and the config to go with it
+def main():
+ [update_entry(i) for i in SIPP_SCENARIOS]
+ test = SIPpTest(WORKING_DIR, TEST_DIR, SIPP_SCENARIOS)
+ reactor.run()
+ if not test.passed:
+ return 1
+
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
+
+
+# vim:sw=4:ts=4:expandtab:textwidth=79
Propchange: asterisk/trunk/tests/channels/SIP/header_parsing/run-test
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/SIP/header_parsing/run-test
------------------------------------------------------------------------------
svn:executable = *
Propchange: asterisk/trunk/tests/channels/SIP/header_parsing/run-test
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/channels/SIP/header_parsing/run-test
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/SIP/header_parsing/sipp/mixed_compact.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/header_parsing/sipp/mixed_compact.xml?view=auto&rev=3033
==============================================================================
--- asterisk/trunk/tests/channels/SIP/header_parsing/sipp/mixed_compact.xml (added)
+++ asterisk/trunk/tests/channels/SIP/header_parsing/sipp/mixed_compact.xml Thu Feb 9 15:06:05 2012
@@ -1,0 +1,96 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Channel Test">
+ <send retrans="500">
+ <![CDATA[
+
+ INVITE sip:test@[remote_ip]:[remote_port] SIP/2.0
+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+ From: test1 <sip:guest1@[local_ip]:[local_port]>;tag=[call_number]
+ f: test1 <sip:DOESNOTEXIST@[local_ip]:[local_port]>;tag=[call_number]
+ To: test <sip:test@[remote_ip]:[remote_port]>
+ Call-ID: [call_id]
+ CSeq: 1 INVITE
+ Contact: sip:test@[local_ip]:[local_port]
+ Max-Forwards: 70
+ Subject: Performance Test
+ User-Agent: Channel Param Test
+ Content-Type: application/sdp
+ Content-Length: [len]
+
+ v=0
+ o=guest1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
+ s=-
+ c=IN IP[media_ip_type] [media_ip]
+ t=0 0
+ m=audio 6000 RTP/AVP 0 101
+ a=rtpmap:0 PCMU/8000
+ a=rtpmap:101 telephone-event/8000
+
+ ]]>
+ </send>
+
+ <recv response="100"
+ optional="true">
+ </recv>
+
+ <recv response="180" optional="true">
+ </recv>
+
+ <recv response="183" optional="true">
+ </recv>
+
+ <recv response="200" rtd="true">
+ <action>
+ <ereg regexp="m=audio [0-9]{1,5} RTP/AVP( [0-9]{1,3})+..?a=rtpmap:0 PCMU/8000"
+ search_in="body" check_it="true" assign_to="1"/>
+ <strcmp assign_to="1" variable="1" value=""/>
+ </action>
+ </recv>
+
+ <send>
+ <![CDATA[
+
+ ACK sip:test@[remote_ip]:[remote_port] SIP/2.0
+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+ From: test1 <sip:guest1@[local_ip]:[local_port]>;tag=[call_number]
+ To: test <sip:test@[remote_ip]:[remote_port]>[peer_tag_param]
+ Call-ID: [call_id]
+ CSeq: 1 ACK
+ Contact: sip:kartoffelsalat@[local_ip]:[local_port]
+ Max-Forwards: 70
+ Subject: Performance Test
+ Content-Length: 0
+
+ ]]>
+ </send>
+
+ <send retrans="500">
+ <![CDATA[
+
+ BYE sip:test@[remote_ip]:[remote_port] SIP/2.0
+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+ From: test1 <sip:guest1@[local_ip]:[local_port]>;tag=[call_number]
+ To: test <sip:test@[remote_ip]:[remote_port]>[peer_tag_param]
+ Call-ID: [call_id]
+ CSeq: 2 BYE
+ Contact: sip:kartoffelsalat@[local_ip]:[local_port]
+ Max-Forwards: 70
+ Subject: Performance Test
+ Content-Length: 0
+
+ ]]>
+ </send>
+
+ <recv response="200" crlf="true">
+ </recv>
+
+ <!-- definition of the response time repartition table (unit is ms) -->
+ <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
+
+ <!-- definition of the call length repartition table (unit is ms) -->
+ <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
+
+</scenario>
+
Propchange: asterisk/trunk/tests/channels/SIP/header_parsing/sipp/mixed_compact.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/SIP/header_parsing/sipp/mixed_compact.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/channels/SIP/header_parsing/sipp/mixed_compact.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: asterisk/trunk/tests/channels/SIP/header_parsing/sipp/mixed_compact_inverse.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/header_parsing/sipp/mixed_compact_inverse.xml?view=auto&rev=3033
==============================================================================
--- asterisk/trunk/tests/channels/SIP/header_parsing/sipp/mixed_compact_inverse.xml (added)
+++ asterisk/trunk/tests/channels/SIP/header_parsing/sipp/mixed_compact_inverse.xml Thu Feb 9 15:06:05 2012
@@ -1,0 +1,96 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Channel Test">
+ <send retrans="500">
+ <![CDATA[
+
+ INVITE sip:test@[remote_ip]:[remote_port] SIP/2.0
+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+ f: test1 <sip:guest1@[local_ip]:[local_port]>;tag=[call_number]
+ From: test1 <sip:DOESNOTEXIST@[local_ip]:[local_port]>;tag=[call_number]
+ To: test <sip:test@[remote_ip]:[remote_port]>
+ Call-ID: [call_id]
+ CSeq: 1 INVITE
+ Contact: sip:test@[local_ip]:[local_port]
+ Max-Forwards: 70
+ Subject: Performance Test
+ User-Agent: Channel Param Test
+ Content-Type: application/sdp
+ Content-Length: [len]
+
+ v=0
+ o=guest1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
+ s=-
+ c=IN IP[media_ip_type] [media_ip]
+ t=0 0
+ m=audio 6000 RTP/AVP 0 101
+ a=rtpmap:0 PCMU/8000
+ a=rtpmap:101 telephone-event/8000
+
+ ]]>
+ </send>
+
+ <recv response="100"
+ optional="true">
+ </recv>
+
+ <recv response="180" optional="true">
+ </recv>
+
+ <recv response="183" optional="true">
+ </recv>
+
+ <recv response="200" rtd="true">
+ <action>
+ <ereg regexp="m=audio [0-9]{1,5} RTP/AVP( [0-9]{1,3})+..?a=rtpmap:0 PCMU/8000"
+ search_in="body" check_it="true" assign_to="1"/>
+ <strcmp assign_to="1" variable="1" value=""/>
+ </action>
+ </recv>
+
+ <send>
+ <![CDATA[
+
+ ACK sip:test@[remote_ip]:[remote_port] SIP/2.0
+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+ From: test1 <sip:guest1@[local_ip]:[local_port]>;tag=[call_number]
+ To: test <sip:test@[remote_ip]:[remote_port]>[peer_tag_param]
+ Call-ID: [call_id]
+ CSeq: 1 ACK
+ Contact: sip:kartoffelsalat@[local_ip]:[local_port]
+ Max-Forwards: 70
+ Subject: Performance Test
+ Content-Length: 0
+
+ ]]>
+ </send>
+
+ <send retrans="500">
+ <![CDATA[
+
+ BYE sip:test@[remote_ip]:[remote_port] SIP/2.0
+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+ From: test1 <sip:guest1@[local_ip]:[local_port]>;tag=[call_number]
+ To: test <sip:test@[remote_ip]:[remote_port]>[peer_tag_param]
+ Call-ID: [call_id]
+ CSeq: 2 BYE
+ Contact: sip:kartoffelsalat@[local_ip]:[local_port]
+ Max-Forwards: 70
+ Subject: Performance Test
+ Content-Length: 0
+
+ ]]>
+ </send>
+
+ <recv response="200" crlf="true">
+ </recv>
+
+ <!-- definition of the response time repartition table (unit is ms) -->
+ <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
+
+ <!-- definition of the call length repartition table (unit is ms) -->
+ <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
+
+</scenario>
+
Propchange: asterisk/trunk/tests/channels/SIP/header_parsing/sipp/mixed_compact_inverse.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/SIP/header_parsing/sipp/mixed_compact_inverse.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/channels/SIP/header_parsing/sipp/mixed_compact_inverse.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: asterisk/trunk/tests/channels/SIP/header_parsing/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/header_parsing/test-config.yaml?view=auto&rev=3033
==============================================================================
--- asterisk/trunk/tests/channels/SIP/header_parsing/test-config.yaml (added)
+++ asterisk/trunk/tests/channels/SIP/header_parsing/test-config.yaml Thu Feb 9 15:06:05 2012
@@ -1,0 +1,9 @@
+testinfo:
+ summary: 'Test for consistency in SIP header parsing.'
+ description: |
+ 'Use calls to ensure asterisk behaves properly with various headers.'
+
+properties:
+ minversion: '1.8.10'
+ dependencies:
+ - app : 'sipp'
Propchange: asterisk/trunk/tests/channels/SIP/header_parsing/test-config.yaml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/SIP/header_parsing/test-config.yaml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/channels/SIP/header_parsing/test-config.yaml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: asterisk/trunk/tests/channels/SIP/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/tests.yaml?view=diff&rev=3033&r1=3032&r2=3033
==============================================================================
--- asterisk/trunk/tests/channels/SIP/tests.yaml (original)
+++ asterisk/trunk/tests/channels/SIP/tests.yaml Thu Feb 9 15:06:05 2012
@@ -36,3 +36,4 @@
- test: 'nat_supertest'
- test: 'pcap_demo'
- test: 'sip_hold'
+ - test: 'header_parsing'
More information about the asterisk-commits
mailing list