[asterisk-commits] kharwell: testsuite/asterisk/trunk r4749 - in /asterisk/trunk/tests/channels/...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Feb 27 15:18:55 CST 2014
Author: kharwell
Date: Thu Feb 27 15:18:49 2014
New Revision: 4749
URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=4749
Log:
res_pjsip_exten_state: Presence for digium phones
Test for presence for digium phones.
Review: https://reviewboard.asterisk.org/r/3240/
Added:
asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/
asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/configs/
asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/configs/ast1/
asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/configs/ast1/extensions.conf (with props)
asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/configs/ast1/pjsip.conf (with props)
asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/run-test (with props)
asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/sipp/
asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/sipp/subscribe.xml (with props)
asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/test-config.yaml (with props)
Modified:
asterisk/trunk/tests/channels/pjsip/subscribe/tests.yaml
Added: asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/configs/ast1/extensions.conf?view=auto&rev=4749
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/configs/ast1/extensions.conf Thu Feb 27 15:18:49 2014
@@ -1,0 +1,6 @@
+[general]
+
+[default]
+
+exten => alice,hint,PJSIP/alice,CustomPresence:alice
+exten => alice,1,Noop
Propchange: asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/configs/ast1/extensions.conf
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/configs/ast1/extensions.conf
------------------------------------------------------------------------------
svn:keywords = Author Date Id Rev URL
Propchange: asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/configs/ast1/extensions.conf
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/configs/ast1/pjsip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/configs/ast1/pjsip.conf?view=auto&rev=4749
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/configs/ast1/pjsip.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/configs/ast1/pjsip.conf Thu Feb 27 15:18:49 2014
@@ -1,0 +1,28 @@
+[local]
+type=transport
+protocol=udp
+bind=0.0.0.0
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+[endpoint_t](!)
+type=endpoint
+transport=local
+context=default
+direct_media=no
+disallow=all
+allow=ulaw
+
+[aor_t](!)
+type=aor
+max_contacts=1
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; alice
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+[alice](aor_t)
+contact=sip:alice at 127.0.0.1:5061
+
+[alice](endpoint_t)
+aors=alice
Propchange: asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
svn:keywords = Author Date Id Rev URL
Propchange: asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/run-test?view=auto&rev=4749
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/run-test (added)
+++ asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/run-test Thu Feb 27 15:18:49 2014
@@ -1,0 +1,53 @@
+#!/usr/bin/env python
+'''
+Copyright (C) 2014, Digium, Inc.
+Kevin Harwell <kharwell at digium.com>
+
+This program is free software, distributed under the terms of
+the GNU General Public License Version 2.
+'''
+
+import sys
+
+sys.path.append("lib/python/asterisk")
+
+from twisted.internet import reactor
+from sipp import SIPpScenario
+from test_case import TestCase
+
+class DigiumPresence(TestCase):
+ """Test case for presence on a digium phone"""
+
+ def __init__(self):
+ """Create a new instance of the DigiumPresence test case."""
+
+ super(DigiumPresence, self).__init__()
+ self.create_asterisk()
+
+ def run(self):
+ """Test execution method. Connect to AMI."""
+
+ super(DigiumPresence, self).run()
+ def _on_scenario_complete(obj):
+ """Callback handler for when the sipp scenario runs successfully."""
+ # the scenario checks for the appropriate body text
+ # so if we get here the test passed
+ self.set_passed(True)
+ self.stop_reactor()
+ return obj
+
+ # make sure alice is available
+ self.ast[0].cli_exec('presencestate change CustomPresence:alice "away,lunch,banana"')
+
+ sipp = SIPpScenario(self.test_name,
+ {'scenario':'subscribe.xml', '-p':'5061'})
+ sipp.run(self).addCallback(_on_scenario_complete)
+
+def main():
+ """Main entry point for test."""
+ test = DigiumPresence()
+ reactor.run()
+ return not test.passed
+
+if __name__ == "__main__":
+ sys.exit(main())
Propchange: asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/run-test
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/run-test
------------------------------------------------------------------------------
svn:executable = *
Propchange: asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/run-test
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/run-test
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/sipp/subscribe.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/sipp/subscribe.xml?view=auto&rev=4749
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/sipp/subscribe.xml (added)
+++ asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/sipp/subscribe.xml Thu Feb 27 15:18:49 2014
@@ -1,0 +1,48 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<scenario name="Subscribe">
+ <send retrans="500">
+ <![CDATA[
+ SUBSCRIBE sip:alice@[remote_ip]:[remote_port] SIP/2.0
+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+ From: "alice" <sip:alice@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+ To: <sip:alice@[remote_ip]:[remote_port]>
+ Call-ID: [call_id]
+ CSeq: 1 SUBSCRIBE
+ Contact: "alice" <sip:alice@[local_ip]:[local_port]>
+ Expires: 3600
+ Max-Forwards: 70
+ Event: presence
+ Accept: application/pidf+xml
+ User-Agent: Digium D40
+ Content-Length: 0
+
+ ]]>
+ </send>
+
+ <recv response="200" rtd="true" />
+
+ <recv request="NOTIFY" crlf="true">
+ <action>
+ <ereg regexp=".*\s*digium_presence type=\"away\" subtype=\"lunch\">banana" check_it="true" search_in="body" assign_to="body" />
+ </action>
+ </recv>
+
+ <Reference variables="body" />
+
+ <send>
+ <![CDATA[
+
+ SIP/2.0 200 OK
+ [last_Via:]
+ [last_From:]
+ [last_To:]
+ [last_Call-ID:]
+ [last_CSeq:]
+ Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+ Content-Length: 0
+
+ ]]>
+ </send>
+</scenario>
Propchange: asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/sipp/subscribe.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/sipp/subscribe.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Rev URL
Propchange: asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/sipp/subscribe.xml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/test-config.yaml?view=auto&rev=4749
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/test-config.yaml (added)
+++ asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/test-config.yaml Thu Feb 27 15:18:49 2014
@@ -1,0 +1,17 @@
+testinfo:
+ summary: 'Test subscribe to presence for a digium phone.'
+ description: |
+ 'Digium phones contain a specialized tag and possibly extra presence
+ information in the body of a sip notify. This tests to make sure
+ the appropriate information is received.'
+
+properties:
+ minversion: '12.1.0'
+ dependencies:
+ - python : 'twisted'
+ - python : 'starpy'
+ - asterisk : 'res_pjsip'
+ - asterisk : 'res_pjsip_exten_state'
+ - asterisk : 'res_pjsip_pidf_digium_body_supplement'
+ tags:
+ - pjsip
Propchange: asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/test-config.yaml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/test-config.yaml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Rev URL
Propchange: asterisk/trunk/tests/channels/pjsip/subscribe/digium_presence/test-config.yaml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: asterisk/trunk/tests/channels/pjsip/subscribe/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/subscribe/tests.yaml?view=diff&rev=4749&r1=4748&r2=4749
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/subscribe/tests.yaml (original)
+++ asterisk/trunk/tests/channels/pjsip/subscribe/tests.yaml Thu Feb 27 15:18:49 2014
@@ -1,3 +1,4 @@
# Enter tests here in the order they should be considered for execution:
tests:
- test: 'missing_aor'
+ - test: 'digium_presence'
More information about the asterisk-commits
mailing list