[asterisk-commits] sgriepentrog: testsuite/asterisk/trunk r4800 - in /asterisk/trunk: lib/python...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Mar 7 09:56:45 CST 2014


Author: sgriepentrog
Date: Fri Mar  7 09:56:40 2014
New Revision: 4800

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=4800
Log:
testsuite: manager origintate channel with unique id

Insures that correct UniqueId and LinkedId values are
set when channels are created with and without the id
given on origination.

Note: this test requires an update to starpy to pass
the channel id values.

(issue ASTERISK-23120)
Review: https://reviewboard.asterisk.org/r/3243/


Added:
    asterisk/trunk/tests/manager/originate/
    asterisk/trunk/tests/manager/originate/configs/
    asterisk/trunk/tests/manager/originate/configs/ast1/
    asterisk/trunk/tests/manager/originate/configs/ast1/extensions.conf   (with props)
    asterisk/trunk/tests/manager/originate/test-config.yaml   (with props)
Modified:
    asterisk/trunk/lib/python/asterisk/test_case.py
    asterisk/trunk/tests/manager/tests.yaml

Modified: asterisk/trunk/lib/python/asterisk/test_case.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/lib/python/asterisk/test_case.py?view=diff&rev=4800&r1=4799&r2=4800
==============================================================================
--- asterisk/trunk/lib/python/asterisk/test_case.py (original)
+++ asterisk/trunk/lib/python/asterisk/test_case.py Fri Mar  7 09:56:40 2014
@@ -712,12 +712,18 @@
         msg = "Originating call to %s" % call_details['channel']
         if 'async' not in call_details:
             call_details['async'] = False
+        if 'channelid' not in call_details:
+            call_details['channelid'] = None
+        if 'otherchannelid' not in call_details:
+            call_details['otherchannelid'] = None
         if 'application' in call_details:
             msg += " with application %s" % call_details['application']
             deferred = ami.originate(channel=call_details['channel'],
                                      application=call_details['application'],
                                      variable=call_details['variable'],
-                                     async=call_details['async'])
+                                     async=call_details['async'],
+                                     channelid=call_details['channelid'],
+                                     otherchannelid=call_details['otherchannelid'])
         else:
             msg += " to %s@%s at %s" % (call_details['exten'],
                                         call_details['context'],
@@ -727,7 +733,9 @@
                                      exten=call_details['exten'],
                                      priority=call_details['priority'],
                                      variable=call_details['variable'],
-                                     async=call_details['async'])
+                                     async=call_details['async'],
+                                     channelid=call_details['channelid'],
+                                     otherchannelid=call_details['otherchannelid'])
         if self._ignore_originate_failures:
             deferred.addErrback(__swallow_originate_error)
         else:

Added: asterisk/trunk/tests/manager/originate/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/manager/originate/configs/ast1/extensions.conf?view=auto&rev=4800
==============================================================================
--- asterisk/trunk/tests/manager/originate/configs/ast1/extensions.conf (added)
+++ asterisk/trunk/tests/manager/originate/configs/ast1/extensions.conf Fri Mar  7 09:56:40 2014
@@ -1,0 +1,16 @@
+[default]
+
+exten => one,1,NoOp()
+    same => n,Answer()
+	same => n,Wait(1)
+    same => n,Hangup()
+
+exten => two,1,NoOp()
+    same => n,Answer()
+	same => n,Wait(1)
+    same => n,Hangup()
+
+exten => three,1,NoOp()
+    same => n,Answer()
+	same => n,Wait(1)
+    same => n,Hangup()

Propchange: asterisk/trunk/tests/manager/originate/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/manager/originate/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/manager/originate/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/manager/originate/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/manager/originate/test-config.yaml?view=auto&rev=4800
==============================================================================
--- asterisk/trunk/tests/manager/originate/test-config.yaml (added)
+++ asterisk/trunk/tests/manager/originate/test-config.yaml Fri Mar  7 09:56:40 2014
@@ -1,0 +1,212 @@
+testinfo:
+    summary: 'Test UniqueID on AMI Originate'
+    description: |
+        * Originate three calls:
+          1) Specifying both Unique ID's
+          2) Specifying a single Unique ID
+          3) Not specifying Unique ID
+        * Check that the AMI and CEL events all correctly match
+
+properties:
+    minversion: '12.2.0'
+    dependencies:
+        - python : 'twisted'
+        - python : 'starpy'
+    tags:
+        - manager
+
+test-modules:
+    test-object:
+        config-section: test-config
+        typename: 'test_case.SimpleTestCase'
+    modules:
+        -
+            config-section: ami-config
+            typename: 'ami.AMIEventModule'
+        -
+            config-section: cel-config
+            typename: 'ami.AMIEventModule'
+
+test-config:
+    spawn-after-hangup: True
+    expected_events: 30
+    test-iterations:
+        -
+            # test 1 - both id's creating local channel
+            channel: 'Local/one at default'
+            channelid: 'MyCustomId'
+            otherchannelid: 'MyOtherCustomId'
+            context: 'default'
+            exten: 'one'
+            priority: '1'
+        -
+            # test 2 - just the first id, second should suffix ;2
+            channel: 'Local/two at default'
+            channelid: 'OnlyOneId'
+            context: 'default'
+            exten: 'two'
+            priority: '1'
+        -
+            # test 3 - no id's specified, should revert to normal id pattern
+            channel: 'Local/three at default'
+            context: 'default'
+            exten: 'three'
+            priority: '1'
+
+ami-config:
+    # test 1
+    -
+        type: 'headermatch'
+        conditions:
+            match:
+                Event: 'Newchannel'
+                Channel: 'Local/one at default-.{7}0;1'
+        requirements:
+            match:
+                Uniqueid: 'MyCustomId'
+        count: '1'
+    -
+        type: 'headermatch'
+        conditions:
+            match:
+                Event: 'Newchannel'
+                Channel: 'Local/one at default-.{7}0;2'
+        requirements:
+            match:
+                Uniqueid: 'MyOtherCustomId'
+        count: '1'
+    -
+        type: 'headermatch'
+        conditions:
+            match:
+                Event: 'LocalBridge'
+                LocalOneChannel: 'Local/one at default-.{7}0;1'
+                LocalTwoChannel: 'Local/one at default-.{7}0;2'
+        requirements:
+            match:
+                LocalOneUniqueid: 'MyCustomId'
+                LocalTwoUniqueid: 'MyOtherCustomId'
+        count: '1'
+    -
+        type: 'headermatch'
+        conditions:
+            match:
+                Event: 'Hangup'
+                Channel: 'Local/one at default-.{7}0;1'
+        requirements:
+            match:
+                Uniqueid: 'MyCustomId'
+        count: '1'
+    -
+        type: 'headermatch'
+        conditions:
+            match:
+                Event: 'Hangup'
+                Channel: 'Local/one at default-.{7}0;2'
+        requirements:
+            match:
+                Uniqueid: 'MyOtherCustomId'
+        count: '1'
+
+    # test 2
+    -
+        type: 'headermatch'
+        conditions:
+            match:
+                Event: 'Newchannel'
+                Channel: 'Local/two at default-.{7}1;1'
+        requirements:
+            match:
+                Uniqueid: 'OnlyOneId$'
+        count: '1'
+    -
+        type: 'headermatch'
+        conditions:
+            match:
+                Event: 'Newchannel'
+                Channel: 'Local/two at default-.{7}1;2'
+        requirements:
+            match:
+                Uniqueid: 'OnlyOneId;2'
+        count: '1'
+    # test 3
+    -
+        type: 'headermatch'
+        conditions:
+            match:
+                Event: 'Newchannel'
+                Channel: 'Local/three at default-.{7}2;1'
+        requirements:
+            match:
+                UniqueId: '[0-9]{10}\.[0-9]+'
+        count: '1'
+    -
+        type: 'headermatch'
+        conditions:
+            match:
+                Event: 'Newchannel'
+                Channel: 'Local/three at default-.{7}2;2'
+        requirements:
+            match:
+                UniqueId: '[0-9]{10}\.[0-9]+'
+        count: '1'
+
+cel-config:
+    # test 1
+    -
+        type: 'cel'
+        conditions:
+            match:
+                Channel: 'Local/one at default-.{7}0;.'
+        requirements:
+            -
+                match:
+                    Channel: 'Local/one at default-.{7}0;1'
+                    EventName: 'CHAN_START'
+                    UniqueId: 'MyCustomId'
+                    LinkedId: 'MyCustomId'
+            -
+                match:
+                    Channel: 'Local/one at default-.{7}0;2'
+                    EventName: 'CHAN_START'
+                    UniqueId: 'MyOtherCustomId'
+                    LinkedId: 'MyCustomId'
+    # test 2
+    -
+        type: 'cel'
+        conditions:
+            match:
+                Channel: 'Local/two at default-.{7}1;.'
+        requirements:
+            -
+                match:
+                    Channel: 'Local/two at default-.{7}1;1'
+                    EventName: 'CHAN_START'
+                    UniqueId: 'OnlyOneId$'
+                    LinkedId: 'OnlyOneId$'
+            -
+                match:
+                    Channel: 'Local/two at default-.{7}1;2'
+                    EventName: 'CHAN_START'
+                    UniqueId: 'OnlyOneId;2'
+                    LinkedId: 'OnlyOneId$'
+    # test 3
+    -
+        type: 'cel'
+        conditions:
+            match:
+                Channel: 'Local/three at default-.{7}2;.'
+        requirements:
+            -
+                match:
+                    Channel: 'Local/three at default-.{7}2;1'
+                    EventName: 'CHAN_START'
+                    UniqueId: '[0-9]{10}\.[0-9]+'
+                    LinkedId: '[0-9]{10}\.[0-9]+'
+            -
+                match:
+                    Channel: 'Local/three at default-.{7}2;2'
+                    EventName: 'CHAN_START'
+                    UniqueId: '[0-9]{10}\.[0-9]+'
+                    LinkedId: '[0-9]{10}\.[0-9]+'
+

Propchange: asterisk/trunk/tests/manager/originate/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/manager/originate/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/manager/originate/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: asterisk/trunk/tests/manager/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/manager/tests.yaml?view=diff&rev=4800&r1=4799&r2=4800
==============================================================================
--- asterisk/trunk/tests/manager/tests.yaml (original)
+++ asterisk/trunk/tests/manager/tests.yaml Fri Mar  7 09:56:40 2014
@@ -7,5 +7,6 @@
     - test: 'acl-login'
     - test: 'bridge_actions'
     - dir:  'danger'
+    - test: 'originate'
     # Temporarily disabled while failures are debugged
     #- test: 'response-time'




More information about the asterisk-commits mailing list