[asterisk-commits] kharwell: testsuite/asterisk/trunk r4389 - in /asterisk/trunk/tests/channels/...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Dec 2 10:47:26 CST 2013


Author: kharwell
Date: Mon Dec  2 10:47:21 2013
New Revision: 4389

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=4389
Log:
Testsuite - pjsip: AMI commands and events

Tests the following AMI actions and their corresponding events for res_pjsip:

PJSIPShowEndpoint
PJSIPShowEndpoints
PJSIPShowRegistrationsInbound
PJSIPShowRegistrationsOutbound
PJSIPShowSubscriptionsInbound

(issue ASTERISK-22609)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2958/

Added:
    asterisk/trunk/tests/channels/pjsip/ami/
    asterisk/trunk/tests/channels/pjsip/ami/show_endpoint/
    asterisk/trunk/tests/channels/pjsip/ami/show_endpoint/AMISendTest.py   (with props)
    asterisk/trunk/tests/channels/pjsip/ami/show_endpoint/configs/
    asterisk/trunk/tests/channels/pjsip/ami/show_endpoint/configs/ast1/
    asterisk/trunk/tests/channels/pjsip/ami/show_endpoint/configs/ast1/pjsip.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/ami/show_endpoint/test-config.yaml   (with props)
    asterisk/trunk/tests/channels/pjsip/ami/show_endpoints/
    asterisk/trunk/tests/channels/pjsip/ami/show_endpoints/AMISendTest.py   (with props)
    asterisk/trunk/tests/channels/pjsip/ami/show_endpoints/configs/
    asterisk/trunk/tests/channels/pjsip/ami/show_endpoints/configs/ast1/
    asterisk/trunk/tests/channels/pjsip/ami/show_endpoints/configs/ast1/pjsip.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/ami/show_endpoints/test-config.yaml   (with props)
    asterisk/trunk/tests/channels/pjsip/ami/show_registrations_inbound/
    asterisk/trunk/tests/channels/pjsip/ami/show_registrations_inbound/AMISendTest.py   (with props)
    asterisk/trunk/tests/channels/pjsip/ami/show_registrations_inbound/configs/
    asterisk/trunk/tests/channels/pjsip/ami/show_registrations_inbound/configs/ast1/
    asterisk/trunk/tests/channels/pjsip/ami/show_registrations_inbound/configs/ast1/pjsip.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/ami/show_registrations_inbound/test-config.yaml   (with props)
    asterisk/trunk/tests/channels/pjsip/ami/show_registrations_outbound/
    asterisk/trunk/tests/channels/pjsip/ami/show_registrations_outbound/AMISendTest.py   (with props)
    asterisk/trunk/tests/channels/pjsip/ami/show_registrations_outbound/configs/
    asterisk/trunk/tests/channels/pjsip/ami/show_registrations_outbound/configs/ast1/
    asterisk/trunk/tests/channels/pjsip/ami/show_registrations_outbound/configs/ast1/pjsip.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/ami/show_registrations_outbound/test-config.yaml   (with props)
    asterisk/trunk/tests/channels/pjsip/ami/show_subscriptions/
    asterisk/trunk/tests/channels/pjsip/ami/show_subscriptions/AMISendTest.py   (with props)
    asterisk/trunk/tests/channels/pjsip/ami/show_subscriptions/configs/
    asterisk/trunk/tests/channels/pjsip/ami/show_subscriptions/configs/ast1/
    asterisk/trunk/tests/channels/pjsip/ami/show_subscriptions/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/ami/show_subscriptions/configs/ast1/pjsip.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/ami/show_subscriptions/configs/ast1/voicemail.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/ami/show_subscriptions/sipp/
    asterisk/trunk/tests/channels/pjsip/ami/show_subscriptions/sipp/subscribe.xml   (with props)
    asterisk/trunk/tests/channels/pjsip/ami/show_subscriptions/test-config.yaml   (with props)
    asterisk/trunk/tests/channels/pjsip/ami/tests.yaml   (with props)
Modified:
    asterisk/trunk/tests/channels/pjsip/tests.yaml

Added: asterisk/trunk/tests/channels/pjsip/ami/show_endpoint/AMISendTest.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/ami/show_endpoint/AMISendTest.py?view=auto&rev=4389
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/ami/show_endpoint/AMISendTest.py (added)
+++ asterisk/trunk/tests/channels/pjsip/ami/show_endpoint/AMISendTest.py Mon Dec  2 10:47:21 2013
@@ -1,0 +1,31 @@
+#!/usr/bin/env python
+'''
+Copyright (C) 2013, 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 TestCase import TestCase
+
+ACTION = {
+    "Action":"PJSIPShowEndpoint",
+    "Endpoint":"user1"
+}
+
+class AMISendTest(TestCase):
+    def __init__(self, path=None, config=None):
+        super(AMISendTest, self).__init__(path, config)
+        self.create_asterisk()
+
+    def run(self):
+        super(AMISendTest, self).run()
+        self.create_ami_factory()
+
+    def ami_connect(self, ami):
+        ami.sendDeferred(ACTION).addCallback(ami.errorUnlessResponse)

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_endpoint/AMISendTest.py
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_endpoint/AMISendTest.py
------------------------------------------------------------------------------
    svn:executable = *

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_endpoint/AMISendTest.py
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_endpoint/AMISendTest.py
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/ami/show_endpoint/configs/ast1/pjsip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/ami/show_endpoint/configs/ast1/pjsip.conf?view=auto&rev=4389
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/ami/show_endpoint/configs/ast1/pjsip.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/ami/show_endpoint/configs/ast1/pjsip.conf Mon Dec  2 10:47:21 2013
@@ -1,0 +1,40 @@
+[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
+
+[auth_t](!)
+type=auth
+auth_type=userpass
+password=xxx
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+[user1]
+type=identify
+match=127.0.0.1
+endpoint=user1
+
+[user1](aor_t)
+contact=sip:user1 at 127.0.0.1:5062
+
+[user1](auth_t)
+username=user1
+
+[user1](endpoint_t)
+aors=user1
+auth=user1

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_endpoint/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_endpoint/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Rev URL

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_endpoint/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/ami/show_endpoint/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/ami/show_endpoint/test-config.yaml?view=auto&rev=4389
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/ami/show_endpoint/test-config.yaml (added)
+++ asterisk/trunk/tests/channels/pjsip/ami/show_endpoint/test-config.yaml Mon Dec  2 10:47:21 2013
@@ -1,0 +1,213 @@
+testinfo:
+    summary: 'Test PJSIPShowEndpoint AMI command'
+    description: |
+        Tests the AMI command PJSIPShowEndpoint in order to make sure the
+        events are appropriately raised.
+
+properties:
+    minversion: '12.0.0'
+    dependencies:
+        - sipp :
+            version : 'v3.0'
+        - asterisk : 'res_pjsip'
+
+    tags:
+        - pjsip
+
+test-modules:
+    # allow TestRunner to find and run the local test
+    add-test-to-search-path: 'True'
+    test-object:
+        config-section: object-config
+        typename: 'AMISendTest.AMISendTest'
+    modules:
+        -
+            minversion: '12.0.0'
+            config-section: 'ami-config'
+            typename: 'ami.AMIEventModule'
+
+object-config:
+    # the only way the test will stop is by timing out
+    # should be done within the specified value
+    reactor-timeout: 15
+
+ami-config:
+        -
+            type: 'headermatch'
+            conditions:
+                match:
+                    Event: 'EndpointDetail'
+            requirements:
+                match:
+                    ObjectType: 'endpoint'
+                    ObjectName: 'user1'
+                    SrtpTag32: 'false'
+                    DtlsSetup: 'active'
+                    DtlsCaPath: ''
+                    DtlsCaFile: ''
+                    DtlsCipher: ''
+                    DtlsPrivateKey: ''
+                    DtlsCertFile: ''
+                    DtlsRekey: '0'
+                    DtlsVerify: 'No'
+                    RtpEngine: 'asterisk'
+                    MwiFromUser: ''
+                    FromDomain: ''
+                    FromUser: ''
+                    SubMinExpiry: '0'
+                    AllowSubscribe: 'true'
+                    CosVideo: '0'
+                    CosAudio: '0'
+                    TosVideo: '0'
+                    TosAudio: '0'
+                    SdpSession: 'Asterisk'
+                    SdpOwner: '-'
+                    AllowTransfer: 'true'
+                    RecordOffFeature: 'automixmon'
+                    RecordOnFeature: 'automixmon'
+                    Language: ''
+                    ToneZone: ''
+                    T38UdptlIpv6: 'false'
+                    T38UdptlNat: 'false'
+                    FaxDetect: 'false'
+                    T38UdptlMaxdatagram: '0'
+                    T38UdptlEc: 'none'
+                    T38Udptl: 'false'
+                    DeviceStateBusyAt: '0'
+                    NamedPickupGroup: ''
+                    NamedCallGroup: ''
+                    PickupGroup: ''
+                    CallGroup: ''
+                    InbandProgress: 'false'
+                    OneTouchRecording: 'false'
+                    UseAvpf: 'false'
+                    MediaEncryption: 'none'
+                    AggregateMwi: 'true'
+                    Mailboxes: ''
+                    SendDiversion: 'true'
+                    SendRpid: 'false'
+                    SendPai: 'false'
+                    TrustIdOutbound: 'false'
+                    TrustIdInbound: 'false'
+                    CalleridTag: ''
+                    CalleridPrivacy: 'allowed_not_screened'
+                    Callerid: '<unknown>'
+                    DisableDirectMediaOnNat: 'false'
+                    DirectMediaGlareMitigation: 'none'
+                    ConnectedLineMethod: 'invite'
+                    DirectMediaMethod: 'invite'
+                    DirectMedia: 'false'
+                    IdentifyBy: 'username'
+                    MediaAddress: ''
+                    Aors: 'user1'
+                    OutboundAuth: ''
+                    Auth: 'user1'
+                    TimersSessExpires: '1800'
+                    TimersMinSe: '90'
+                    Timers: 'yes'
+                    100rel: 'yes'
+                    MohSuggest: 'default'
+                    OutboundProxy: ''
+                    Transport: 'local'
+                    RewriteContact: 'false'
+                    ForceRport: 'true'
+                    UsePtime: 'false'
+                    IceSupport: 'false'
+                    RtpSymmetric: 'false'
+                    RtpIpv6: 'false'
+                    DtmfMode: 'rfc4733'
+                    Context: 'default'
+                    DeviceState: 'Invalid'
+                    ActiveChannels: ''
+            count: 1
+        -
+            type: 'headermatch'
+            conditions:
+                match:
+                    Event: 'AorDetail'
+            requirements:
+                match:
+                    ObjectType: aor
+                    ObjectName: user1
+                    Mailboxes: ''
+                    RemoveExisting: 'false'
+                    MaxContacts: '1'
+                    AuthenticateQualify: 'false'
+                    QualifyFrequency: '0'
+                    DefaultExpiration: '3600'
+                    MaximumExpiration: '7200'
+                    MinimumExpiration: '60'
+                    Contacts: 'user1/sip:user1 at 127.0.0.1:5062'
+                    TotalContacts: '1'
+                    ContactsRegistered: '0'
+                    EndpointName: 'user1'
+            count: 1
+        -
+            type: 'headermatch'
+            conditions:
+                match:
+                    Event: 'AuthDetail'
+            requirements:
+                match:
+                    ObjectType: 'auth'
+                    ObjectName: 'user1'
+                    AuthType: 'userpass'
+                    NonceLifetime: '32'
+                    Realm: ''
+                    Md5Cred: ''
+                    Password: 'xxx'
+                    Username: 'user1'
+                    EndpointName: 'user1'
+            count: 1
+        -
+            type: 'headermatch'
+            conditions:
+                match:
+                    Event: 'TransportDetail'
+            requirements:
+                match:
+                    ObjectType: 'transport'
+                    ObjectName: 'local'
+                    Cos: '0'
+                    Tos: '0'
+                    LocalNet: ''
+                    Cipher: ''
+                    Method: 'unspecified'
+                    RequireClientCert: 'No'
+                    VerifyClient: 'No'
+                    VerifyServer: 'No'
+                    Domain: ''
+                    ExternalMediaAddress: ''
+                    ExternalSignalingPort: '0'
+                    ExternalSignalingAddress: ''
+                    Password: ''
+                    PrivKeyFile: ''
+                    CertFile: ''
+                    CaListFile: ''
+                    AsyncOperations: '1'
+                    Bind: '0.0.0.0:5060'
+                    Protocol: 'udp'
+                    EndpointName: 'user1'
+            count: 1
+        -
+            type: 'headermatch'
+            conditions:
+                match:
+                    Event: 'IdentifyDetail'
+            requirements:
+                match:
+                    ObjectType: 'identify'
+                    ObjectName: 'user1'
+                    Endpoint: 'user1'
+                    Match: '127.0.0.1/255.255.255.255'
+            count: 1
+        -
+            type: 'headermatch'
+            conditions:
+                match:
+                    Event: 'EndpointDetailComplete'
+            requirements:
+                match:
+                    EventList: 'Complete'
+                    ListItems: '5'
+            count: 1

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_endpoint/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_endpoint/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Rev URL

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_endpoint/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/ami/show_endpoints/AMISendTest.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/ami/show_endpoints/AMISendTest.py?view=auto&rev=4389
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/ami/show_endpoints/AMISendTest.py (added)
+++ asterisk/trunk/tests/channels/pjsip/ami/show_endpoints/AMISendTest.py Mon Dec  2 10:47:21 2013
@@ -1,0 +1,30 @@
+#!/usr/bin/env python
+'''
+Copyright (C) 2013, 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 TestCase import TestCase
+
+ACTION = {
+    "Action":"PJSIPShowEndpoints"
+}
+
+class AMISendTest(TestCase):
+    def __init__(self, path=None, config=None):
+        super(AMISendTest, self).__init__(path, config)
+        self.create_asterisk()
+
+    def run(self):
+        super(AMISendTest, self).run()
+        self.create_ami_factory()
+
+    def ami_connect(self, ami):
+        ami.sendDeferred(ACTION).addCallback(ami.errorUnlessResponse)

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_endpoints/AMISendTest.py
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_endpoints/AMISendTest.py
------------------------------------------------------------------------------
    svn:executable = *

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_endpoints/AMISendTest.py
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_endpoints/AMISendTest.py
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/ami/show_endpoints/configs/ast1/pjsip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/ami/show_endpoints/configs/ast1/pjsip.conf?view=auto&rev=4389
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/ami/show_endpoints/configs/ast1/pjsip.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/ami/show_endpoints/configs/ast1/pjsip.conf Mon Dec  2 10:47:21 2013
@@ -1,0 +1,47 @@
+[local]
+type=transport
+protocol=udp
+bind=0.0.0.0
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+[endpoint_t](!)
+type=endpoint
+transport=local
+context=default
+aors=user1
+direct_media=no
+disallow=all
+allow=ulaw
+
+[aor_t](!)
+type=aor
+max_contacts=1
+
+[auth_t](!)
+type=auth
+auth_type=userpass
+username=xxx
+password=xxx
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+[user1](aor_t)
+contact=sip:user1 at 127.0.0.1:5062
+
+[user1](auth_t)
+username=user1
+
+[user1](endpoint_t)
+aors=user1
+auth=user1
+
+[user2](aor_t)
+contact=sip:user2 at 127.0.0.1:5063
+
+[user2](auth_t)
+username=user2
+
+[user2](endpoint_t)
+aors=user2
+auth=user2

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_endpoints/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_endpoints/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Rev URL

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_endpoints/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/ami/show_endpoints/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/ami/show_endpoints/test-config.yaml?view=auto&rev=4389
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/ami/show_endpoints/test-config.yaml (added)
+++ asterisk/trunk/tests/channels/pjsip/ami/show_endpoints/test-config.yaml Mon Dec  2 10:47:21 2013
@@ -1,0 +1,62 @@
+testinfo:
+    summary: 'Test PJSIPShowEndpoints AMI command'
+    description: |
+        Tests the AMI command PJSIPShowEndpoints in order to make sure the
+        event is appropriately raised.
+
+properties:
+    minversion: '12.0.0'
+    dependencies:
+        - sipp :
+            version : 'v3.0'
+        - asterisk : 'res_pjsip'
+
+    tags:
+        - pjsip
+
+test-modules:
+    # allow TestRunner to find and run the local test
+    add-test-to-search-path: 'True'
+    test-object:
+        config-section: object-config
+        typename: 'AMISendTest.AMISendTest'
+    modules:
+        -
+            minversion: '12.0.0'
+            config-section: 'ami-config'
+            typename: 'ami.AMIEventModule'
+
+object-config:
+    # the only way the test will stop is by timing out
+    # should be done within the specified value
+    reactor-timeout: 15
+
+ami-config:
+        -
+            type: 'headermatch'
+            conditions:
+                match:
+                    Event: 'EndpointList'
+            requirements:
+                match:
+                    ObjectType: 'endpoint'
+                    ObjectName: 'user.*'
+                    Transport: 'local'
+                    Aor: 'user.*'
+                    Auths: 'user.*'
+                    OutboundAuths: ''
+                    Contacts: user1/sip:user1 at 127.0.0.1:5062|user2/sip:user2 at 127.0.0.1:5063
+                    DeviceState: 'Invalid'
+                    ActiveChannels: ''
+            count: 2
+        -
+            type: 'headermatch'
+            conditions:
+                match:
+                    Event: 'EndpointListComplete'
+            requirements:
+                match:
+                    EventList: 'Complete'
+                    ListItems: '2'
+            count: 1
+

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_endpoints/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_endpoints/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Rev URL

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_endpoints/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/ami/show_registrations_inbound/AMISendTest.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/ami/show_registrations_inbound/AMISendTest.py?view=auto&rev=4389
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/ami/show_registrations_inbound/AMISendTest.py (added)
+++ asterisk/trunk/tests/channels/pjsip/ami/show_registrations_inbound/AMISendTest.py Mon Dec  2 10:47:21 2013
@@ -1,0 +1,30 @@
+#!/usr/bin/env python
+'''
+Copyright (C) 2013, 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 TestCase import TestCase
+
+ACTION = {
+    "Action":"PJSIPShowRegistrationsInbound"
+}
+
+class AMISendTest(TestCase):
+    def __init__(self, path=None, config=None):
+        super(AMISendTest, self).__init__(path, config)
+        self.create_asterisk()
+
+    def run(self):
+        super(AMISendTest, self).run()
+        self.create_ami_factory()
+
+    def ami_connect(self, ami):
+        ami.sendDeferred(ACTION).addCallback(ami.errorUnlessResponse)

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_registrations_inbound/AMISendTest.py
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_registrations_inbound/AMISendTest.py
------------------------------------------------------------------------------
    svn:executable = *

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_registrations_inbound/AMISendTest.py
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_registrations_inbound/AMISendTest.py
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/ami/show_registrations_inbound/configs/ast1/pjsip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/ami/show_registrations_inbound/configs/ast1/pjsip.conf?view=auto&rev=4389
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/ami/show_registrations_inbound/configs/ast1/pjsip.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/ami/show_registrations_inbound/configs/ast1/pjsip.conf Mon Dec  2 10:47:21 2013
@@ -1,0 +1,33 @@
+[local]
+type=transport
+protocol=udp
+bind=0.0.0.0
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+[endpoint_t](!)
+type=endpoint
+transport=local
+context=default
+aors=user1
+direct_media=no
+disallow=all
+allow=ulaw
+
+[aor_t](!)
+type=aor
+max_contacts=1
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+[user1](aor_t)
+contact=sip:user1 at 127.0.0.1:5062
+
+[user1](endpoint_t)
+aors=user1
+
+[user2](aor_t)
+contact=sip:user2 at 127.0.0.1:5063
+
+[user2](endpoint_t)
+aors=user2

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_registrations_inbound/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_registrations_inbound/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Rev URL

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_registrations_inbound/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/ami/show_registrations_inbound/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/ami/show_registrations_inbound/test-config.yaml?view=auto&rev=4389
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/ami/show_registrations_inbound/test-config.yaml (added)
+++ asterisk/trunk/tests/channels/pjsip/ami/show_registrations_inbound/test-config.yaml Mon Dec  2 10:47:21 2013
@@ -1,0 +1,65 @@
+testinfo:
+    summary: 'Test PJSIPShowRegistrationsInbound AMI command'
+    description: |
+        Tests the AMI command PJSIPShowRegistrationsInbound in order to make
+        sure the events are appropriately raised.
+
+properties:
+    minversion: '12.0.0'
+    dependencies:
+        - sipp :
+            version : 'v3.0'
+        - asterisk : 'res_pjsip'
+
+    tags:
+        - pjsip
+
+test-modules:
+    # allow TestRunner to find and run the local test
+    add-test-to-search-path: 'True'
+    test-object:
+        config-section: object-config
+        typename: 'AMISendTest.AMISendTest'
+    modules:
+        -
+            minversion: '12.0.0'
+            config-section: 'ami-config'
+            typename: 'ami.AMIEventModule'
+
+object-config:
+    # the only way the test will stop is by timing out
+    # should be done within the specified value
+    reactor-timeout: 15
+
+ami-config:
+        -
+            type: 'headermatch'
+            conditions:
+                match:
+                    Event: 'InboundRegistrationDetail'
+            requirements:
+                match:
+                    ObjectType: 'aor'
+                    ObjectName: 'user.*'
+                    Mailboxes: ''
+                    RemoveExisting: 'false'
+                    MaxContacts: '1'
+                    AuthenticateQualify: 'false'
+                    QualifyFrequency: '0'
+                    DefaultExpiration: '3600'
+                    MaximumExpiration: '7200'
+                    MinimumExpiration: '60'
+                    Contacts: user1/sip:user1 at 127.0.0.1:5062|user2/sip:user2 at 127.0.0.1:5063
+            count: 2
+        -
+            type: 'headermatch'
+            conditions:
+                match:
+                    Event: 'InboundRegistrationDetailComplete'
+            requirements:
+                match:
+                    EventList: 'Complete'
+                    ListItems: '2'
+            count: 1
+
+

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_registrations_inbound/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_registrations_inbound/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Rev URL

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_registrations_inbound/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/ami/show_registrations_outbound/AMISendTest.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/ami/show_registrations_outbound/AMISendTest.py?view=auto&rev=4389
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/ami/show_registrations_outbound/AMISendTest.py (added)
+++ asterisk/trunk/tests/channels/pjsip/ami/show_registrations_outbound/AMISendTest.py Mon Dec  2 10:47:21 2013
@@ -1,0 +1,30 @@
+#!/usr/bin/env python
+'''
+Copyright (C) 2013, 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 TestCase import TestCase
+
+ACTION = {
+    "Action":"PJSIPShowRegistrationsOutbound"
+}
+
+class AMISendTest(TestCase):
+    def __init__(self, path=None, config=None):
+        super(AMISendTest, self).__init__(path, config)
+        self.create_asterisk()
+
+    def run(self):
+        super(AMISendTest, self).run()
+        self.create_ami_factory()
+
+    def ami_connect(self, ami):
+        ami.sendDeferred(ACTION).addCallback(ami.errorUnlessResponse)

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_registrations_outbound/AMISendTest.py
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_registrations_outbound/AMISendTest.py
------------------------------------------------------------------------------
    svn:executable = *

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_registrations_outbound/AMISendTest.py
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_registrations_outbound/AMISendTest.py
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/ami/show_registrations_outbound/configs/ast1/pjsip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/ami/show_registrations_outbound/configs/ast1/pjsip.conf?view=auto&rev=4389
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/ami/show_registrations_outbound/configs/ast1/pjsip.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/ami/show_registrations_outbound/configs/ast1/pjsip.conf Mon Dec  2 10:47:21 2013
@@ -1,0 +1,36 @@
+[local]
+type=transport
+protocol=udp
+bind=0.0.0.0
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+[auth_t](!)
+type=auth
+auth_type=userpass
+username=xxx
+password=xxx
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; outbound registration
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+[reg-auth](auth_t)
+
+[registration_t](!)
+type=registration
+transport=local
+outbound_auth=reg-auth
+retry_interval=60
+server_uri=sip:localhost
+
+[user0](registration_t)
+client_uri=sip:user0 at localhost:5060
+[user1](registration_t)
+client_uri=sip:user1 at localhost:5060
+[user2](registration_t)
+client_uri=sip:user2 at localhost:5060
+[user3](registration_t)
+client_uri=sip:user3 at localhost:5060
+[user4](registration_t)
+client_uri=sip:user4 at localhost:5060

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_registrations_outbound/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_registrations_outbound/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Rev URL

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_registrations_outbound/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/ami/show_registrations_outbound/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/ami/show_registrations_outbound/test-config.yaml?view=auto&rev=4389
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/ami/show_registrations_outbound/test-config.yaml (added)
+++ asterisk/trunk/tests/channels/pjsip/ami/show_registrations_outbound/test-config.yaml Mon Dec  2 10:47:21 2013
@@ -1,0 +1,85 @@
+testinfo:
+    summary: 'Test PJSIPShowRegistrations AMI command'
+    description: |
+        Tests the AMI command PJSIPShowRegistrationsOutbound in order to make
+        sure the events are appropriately raised.
+
+properties:
+    minversion: '12.0.0'
+    dependencies:
+        - sipp :
+            version : 'v3.0'
+        - asterisk : 'res_pjsip'
+
+    tags:
+        - pjsip
+
+test-modules:
+    # allow TestRunner to find and run the local test
+    add-test-to-search-path: 'True'
+    test-object:
+        config-section: object-config
+        typename: 'AMISendTest.AMISendTest'
+    modules:
+        -
+            minversion: '12.0.0'
+            config-section: 'ami-config'
+            typename: 'ami.AMIEventModule'
+
+object-config:
+    # the only way the test will stop is by timing out
+    # should be done within the specified value
+    reactor-timeout: 15
+
+ami-config:
+        -
+            type: 'headermatch'
+            conditions:
+                match:
+                    Event: 'OutboundRegistrationDetail'
+            requirements:
+                match:
+                    ObjectType: 'registration'
+                    ObjectName: 'user.*'
+                    OutboundAuth: 'reg-auth'
+                    AuthRejectionPermanent: 'true'
+                    MaxRetries: '10'
+                    ForbiddenRetryInterval: '0'
+                    RetryInterval: '60'
+                    Expiration: '3600'
+                    OutboundProxy: ''
+                    Transport: 'local'
+                    ContactUser: ''
+                    ClientUri: 'sip:user.*'
+                    ServerUri: 'sip:localhost'
+                    Status: 'Unregistered'
+                    NextReg: '0'
+            count: 5
+        -
+            type: 'headermatch'
+            conditions:
+                match:
+                    Event: 'AuthDetail'
+            requirements:
+                match:
+                    ObjectType: 'auth'
+                    ObjectName: 'reg-auth'
+                    AuthType: 'userpass'
+                    NonceLifetime: '32'
+                    Realm: ''
+                    Md5Cred: ''
+                    Password: 'xxx'
+                    Username: 'xxx'
+
+            count: 5
+        -
+            type: 'headermatch'
+            conditions:
+                match:
+                    Event: 'OutboundRegistrationDetailComplete'
+            requirements:
+                match:
+                    EventList: 'Complete'
+                    Registered: '0'
+                    NotRegistered: '5'
+            count: 1

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_registrations_outbound/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_registrations_outbound/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Rev URL

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_registrations_outbound/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/ami/show_subscriptions/AMISendTest.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/ami/show_subscriptions/AMISendTest.py?view=auto&rev=4389
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/ami/show_subscriptions/AMISendTest.py (added)
+++ asterisk/trunk/tests/channels/pjsip/ami/show_subscriptions/AMISendTest.py Mon Dec  2 10:47:21 2013
@@ -1,0 +1,32 @@
+#!/usr/bin/env python
+'''
+Copyright (C) 2013, 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
+import time
+
+sys.path.append("lib/python/asterisk")
+
+from sipp import SIPpTestCase
+
+ACTION = {
+    "Action":"PJSIPShowSubscriptionsInbound"
+}
+
+class AMISendTest(SIPpTestCase):
+    def __init__(self, path=None, config=None):
+        super(AMISendTest, self).__init__(path, config)
+
+    def run(self):
+        super(AMISendTest, self).run()
+
+    def ami_connect(self, ami):
+        super(AMISendTest, self).ami_connect(ami)
+        # give some time for everything to subscribe
+        time.sleep(3)
+        ami.sendDeferred(ACTION).addCallback(ami.errorUnlessResponse)

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_subscriptions/AMISendTest.py
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_subscriptions/AMISendTest.py
------------------------------------------------------------------------------
    svn:executable = *

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_subscriptions/AMISendTest.py
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/ami/show_subscriptions/AMISendTest.py
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/ami/show_subscriptions/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/ami/show_subscriptions/configs/ast1/extensions.conf?view=auto&rev=4389
==============================================================================

[... 297 lines stripped ...]



More information about the asterisk-commits mailing list