[asterisk-commits] mmichelson: branch mmichelson/bridge-tests r3417 - in /asterisk/team/mmichels...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Aug 8 14:24:39 CDT 2012


Author: mmichelson
Date: Wed Aug  8 14:24:36 2012
New Revision: 3417

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=3417
Log:
Add CEL processing to the automon test.

This one was being obstinately failful since subsequent
calls would start before the previous one had all hangups
logged.

I fixed this by adding hangup detection for the UUT in the
bridge test object. This makes it so that the previous call
must complete entirely before the next call may be started.


Modified:
    asterisk/team/mmichelson/bridge-tests/lib/python/asterisk/BridgeTestCase.py
    asterisk/team/mmichelson/bridge-tests/tests/bridge/automon/test-config.yaml

Modified: asterisk/team/mmichelson/bridge-tests/lib/python/asterisk/BridgeTestCase.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mmichelson/bridge-tests/lib/python/asterisk/BridgeTestCase.py?view=diff&rev=3417&r1=3416&r2=3417
==============================================================================
--- asterisk/team/mmichelson/bridge-tests/lib/python/asterisk/BridgeTestCase.py (original)
+++ asterisk/team/mmichelson/bridge-tests/lib/python/asterisk/BridgeTestCase.py Wed Aug  8 14:24:36 2012
@@ -73,6 +73,7 @@
             self.ami_uut = ami
             self.ami_uut.registerEvent('Bridge', self.uut_bridge_callback)
             self.ami_uut.registerEvent('TestEvent', self.test_callback)
+            self.ami_uut.registerEvent('Hangup', self.hangup_callback)
             LOGGER.info("UUT AMI connected")
         elif (ami.id == 1):
             self.ami_alice = ami
@@ -111,6 +112,8 @@
         self.uut_bob_channel = None
         self.alice_hungup = False
         self.bob_hungup = False
+        self.uut_alice_hungup = False
+        self.uut_bob_hungup = False
         self.current_feature = 0
         self.infeatures = False
 
@@ -148,8 +151,16 @@
         elif ami is self.ami_alice:
             LOGGER.info("Alice has hung up")
             self.alice_hungup = True
-
-        if self.bob_hungup and self.alice_hungup:
+        elif ami is self.ami_uut:
+            if event.get('channel') == self.uut_alice_channel:
+                LOGGER.info("UUT Alice hang up")
+                self.uut_alice_hungup = True
+            elif event.get('channel') == self.uut_bob_channel:
+                LOGGER.info("UUT Bob hang up")
+                self.uut_bob_hungup = True
+
+        if (self.bob_hungup and self.alice_hungup and self.uut_alice_hungup and
+                self.uut_bob_hungup):
             # Test call has concluded move on!
             self.current_run += 1
             self.run_tests()

Modified: asterisk/team/mmichelson/bridge-tests/tests/bridge/automon/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mmichelson/bridge-tests/tests/bridge/automon/test-config.yaml?view=diff&rev=3417&r1=3416&r2=3417
==============================================================================
--- asterisk/team/mmichelson/bridge-tests/tests/bridge/automon/test-config.yaml (original)
+++ asterisk/team/mmichelson/bridge-tests/tests/bridge/automon/test-config.yaml Wed Aug  8 14:24:36 2012
@@ -13,6 +13,9 @@
         -
             config-section: 'cdr-config'
             typename: 'cdr.CDRModule'
+        -
+            config-section: 'cel-config'
+            typename: 'cel.CELModule'
 
 bridge-config:
     -
@@ -86,6 +89,329 @@
                 lastapp: 'Dial'
                 disposition: 'ANSWERED'
                 amaflags: 'DOCUMENTATION'
+
+cel-config:
+    -
+        file: 'Master'
+        lines:
+            -
+                eventtype: 'CHAN_START'
+                cidname: 'Alice'
+                cidnum: '1234'
+                exten: 'alice_automon'
+                context: 'default'
+                channel: '.*/alice-.*'
+            -
+                eventtype: 'APP_START'
+                cidname: 'Alice'
+                cidnum: '1234'
+                dnid: 'alice_automon'
+                exten: 'alice_automon'
+                context: 'default'
+                channel: '.*/alice-.*'
+                app: 'Dial'
+            -
+                eventtype: 'CHAN_START'
+                cidname: 'Bob'
+                cidnum: '4321'
+                channel: '.*/bob-.*'
+            -
+                eventtype: 'ANSWER'
+                cidname: 'Bob'
+                cidnum: '4321'
+                channel: '.*/bob-.*'
+                app: 'AppDial'
+                appdata: '\(Outgoing Line\)'
+            -
+                eventtype: 'ANSWER'
+                cidname: 'Alice'
+                cidnum: '1234'
+                dnid: 'alice_automon'
+                exten: 'alice_automon'
+                context: 'default'
+                channel: '.*/alice-.*'
+                app: 'Dial'
+            -
+                eventtype: 'BRIDGE_START'
+                cidname: 'Alice'
+                cidnum: '1234'
+                dnid: 'alice_automon'
+                exten: 'alice_automon'
+                context: 'default'
+                channel: '.*/alice-.*'
+                app: 'Dial'
+                bridgepeer: '.*/bob-.*'
+            -
+                eventtype: 'BRIDGE_END'
+                cidname: 'Alice'
+                cidnum: '1234'
+                dnid: 'alice_automon'
+                exten: 'alice_automon'
+                context: 'default'
+                channel: '.*/alice-.*'
+                app: 'Dial'
+                bridgepeer: '.*/bob-.*'
+            -
+                eventtype: 'HANGUP'
+                cidname: 'Bob'
+                cidnum: '4321'
+                channel: '.*/bob-.*'
+                app: 'AppDial'
+                appdata: '\(Outgoing Line\)'
+                eventextra: '16,.*/alice-.*'
+            -
+                eventtype: 'CHAN_END'
+                cidname: 'Bob'
+                cidnum: '4321'
+                channel: '.*/bob-.*'
+                app: 'AppDial'
+                appdata: '\(Outgoing Line\)'
+            -
+                eventtype: 'APP_END'
+                cidname: 'Alice'
+                cidnum: '1234'
+                # XXX Oddly, dnid is blank for this event?
+                exten: 'alice_automon'
+                context: 'default'
+                channel: '.*/alice-.*'
+                app: 'Dial'
+            -
+                eventtype: 'HANGUP'
+                cidname: 'Alice'
+                cidnum: '1234'
+                dnid: 'alice_automon'
+                exten: 'alice_automon'
+                context: 'default'
+                channel: '.*/alice-.*'
+                eventextra: '16,.*/alice-.*,ANSWER'
+            -
+                eventtype: 'CHAN_END'
+                cidname: 'Alice'
+                cidnum: '1234'
+                dnid: 'alice_automon'
+                exten: 'alice_automon'
+                context: 'default'
+                channel: '.*/alice-.*'
+            -
+                eventtype: 'LINKEDID_END'
+                cidname: 'Alice'
+                cidnum: '1234'
+                dnid: 'alice_automon'
+                exten: 'alice_automon'
+                context: 'default'
+                channel: '.*/alice-.*'
+            -
+                eventtype: 'CHAN_START'
+                cidname: 'Alice'
+                cidnum: '1234'
+                exten: 'alice_automon2'
+                context: 'default'
+                channel: '.*/alice-.*'
+            -
+                eventtype: 'APP_START'
+                cidname: 'Alice'
+                cidnum: '1234'
+                dnid: 'alice_automon2'
+                exten: 'alice_automon2'
+                context: 'default'
+                channel: '.*/alice-.*'
+                app: 'Dial'
+            -
+                eventtype: 'CHAN_START'
+                cidname: 'Bob'
+                cidnum: '4321'
+                channel: '.*/bob-.*'
+            -
+                eventtype: 'ANSWER'
+                cidname: 'Bob'
+                cidnum: '4321'
+                channel: '.*/bob-.*'
+                app: 'AppDial'
+                appdata: '\(Outgoing Line\)'
+            -
+                eventtype: 'ANSWER'
+                cidname: 'Alice'
+                cidnum: '1234'
+                dnid: 'alice_automon2'
+                exten: 'alice_automon2'
+                context: 'default'
+                channel: '.*/alice-.*'
+                app: 'Dial'
+            -
+                eventtype: 'BRIDGE_START'
+                cidname: 'Alice'
+                cidnum: '1234'
+                dnid: 'alice_automon2'
+                exten: 'alice_automon2'
+                context: 'default'
+                channel: '.*/alice-.*'
+                app: 'Dial'
+                bridgepeer: '.*/bob-.*'
+            -
+                eventtype: 'BRIDGE_END'
+                cidname: 'Alice'
+                cidnum: '1234'
+                dnid: 'alice_automon2'
+                exten: 'alice_automon2'
+                context: 'default'
+                channel: '.*/alice-.*'
+                app: 'Dial'
+                bridgepeer: '.*/bob-.*'
+            -
+                eventtype: 'HANGUP'
+                cidname: 'Bob'
+                cidnum: '4321'
+                channel: '.*/bob-.*'
+                app: 'AppDial'
+                appdata: '\(Outgoing Line\)'
+                eventextra: '16,.*/alice-.*'
+            -
+                eventtype: 'CHAN_END'
+                cidname: 'Bob'
+                cidnum: '4321'
+                channel: '.*/bob-.*'
+                app: 'AppDial'
+                appdata: '\(Outgoing Line\)'
+            -
+                eventtype: 'APP_END'
+                cidname: 'Alice'
+                cidnum: '1234'
+                dnid: 'alice_automon2'
+                exten: 'alice_automon2'
+                context: 'default'
+                channel: '.*/alice-.*'
+                app: 'Dial'
+            -
+                eventtype: 'HANGUP'
+                cidname: 'Alice'
+                cidnum: '1234'
+                dnid: 'alice_automon2'
+                exten: 'alice_automon2'
+                context: 'default'
+                channel: '.*/alice-.*'
+                eventextra: '16,.*/alice-.*,ANSWER'
+            -
+                eventtype: 'CHAN_END'
+                cidname: 'Alice'
+                cidnum: '1234'
+                dnid: 'alice_automon2'
+                exten: 'alice_automon2'
+                context: 'default'
+                channel: '.*/alice-.*'
+            -
+                eventtype: 'LINKEDID_END'
+                cidname: 'Alice'
+                cidnum: '1234'
+                dnid: 'alice_automon2'
+                exten: 'alice_automon2'
+                context: 'default'
+                channel: '.*/alice-.*'
+            -
+                eventtype: 'CHAN_START'
+                cidname: 'Alice'
+                cidnum: '1234'
+                exten: 'bob_automon'
+                context: 'default'
+                channel: '.*/alice-.*'
+            -
+                eventtype: 'APP_START'
+                cidname: 'Alice'
+                cidnum: '1234'
+                dnid: 'bob_automon'
+                exten: 'bob_automon'
+                context: 'default'
+                channel: '.*/alice-.*'
+                app: 'Dial'
+            -
+                eventtype: 'CHAN_START'
+                cidname: 'Bob'
+                cidnum: '4321'
+                channel: '.*/bob-.*'
+            -
+                eventtype: 'ANSWER'
+                cidname: 'Bob'
+                cidnum: '4321'
+                channel: '.*/bob-.*'
+                app: 'AppDial'
+                appdata: '\(Outgoing Line\)'
+            -
+                eventtype: 'ANSWER'
+                cidname: 'Alice'
+                cidnum: '1234'
+                dnid: 'bob_automon'
+                exten: 'bob_automon'
+                context: 'default'
+                channel: '.*/alice-.*'
+                app: 'Dial'
+            -
+                eventtype: 'BRIDGE_START'
+                cidname: 'Alice'
+                cidnum: '1234'
+                dnid: 'bob_automon'
+                exten: 'bob_automon'
+                context: 'default'
+                channel: '.*/alice-.*'
+                app: 'Dial'
+                bridgepeer: '.*/bob-.*'
+            -
+                eventtype: 'BRIDGE_END'
+                cidname: 'Alice'
+                cidnum: '1234'
+                dnid: 'bob_automon'
+                exten: 'bob_automon'
+                context: 'default'
+                channel: '.*/alice-.*'
+                app: 'Dial'
+                bridgepeer: '.*/bob-.*'
+            -
+                eventtype: 'HANGUP'
+                cidname: 'Bob'
+                cidnum: '4321'
+                channel: '.*/bob-.*'
+                app: 'AppDial'
+                appdata: '\(Outgoing Line\)'
+                eventextra: '16,.*/alice-.*'
+            -
+                eventtype: 'CHAN_END'
+                cidname: 'Bob'
+                cidnum: '4321'
+                channel: '.*/bob-.*'
+                app: 'AppDial'
+                appdata: '\(Outgoing Line\)'
+            -
+                eventtype: 'APP_END'
+                cidname: 'Alice'
+                cidnum: '1234'
+                dnid: 'bob_automon'
+                exten: 'bob_automon'
+                context: 'default'
+                channel: '.*/alice-.*'
+                app: 'Dial'
+            -
+                eventtype: 'HANGUP'
+                cidname: 'Alice'
+                cidnum: '1234'
+                dnid: 'bob_automon'
+                exten: 'bob_automon'
+                context: 'default'
+                channel: '.*/alice-.*'
+                eventextra: '16,.*/alice-.*,ANSWER'
+            -
+                eventtype: 'CHAN_END'
+                cidname: 'Alice'
+                cidnum: '1234'
+                dnid: 'bob_automon'
+                exten: 'bob_automon'
+                context: 'default'
+                channel: '.*/alice-.*'
+            -
+                eventtype: 'LINKEDID_END'
+                cidname: 'Alice'
+                cidnum: '1234'
+                dnid: 'bob_automon'
+                exten: 'bob_automon'
+                context: 'default'
+                channel: '.*/alice-.*'
 
 properties:
     minversion: '11.0.0'




More information about the asterisk-commits mailing list