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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jul 26 14:10:00 CDT 2012


Author: mmichelson
Date: Thu Jul 26 14:09:56 2012
New Revision: 3367

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=3367
Log:
Add new bridge test and make some tweaks to bridge test case.

This adds a "disconnect" test that checks that the DTMF disconnect
feature works as expected. It tests that users without permission to
use the feature are denied and that users with permission properly
have the feature executed.

The reason the disconnect feature was chosen is because it also exercises
the bridge tests' ability to let hangup of a call happen externally rather
than sending an AMI hangup on its own.

There are some other miscellaneous changes made here:

* There is some additional debugging added to BridgeTestCase. This was
put in to help me to debug an issue I was seeing and I ended up keeping
it because it may be useful

* Alice and Bob no longer use the Echo app in their dialplan. This is because
I was seeing DTMF "bounce" off an endpoint and come back into the bridge, causing
unexpected feature detection to occur.

* For this test to have worked, I obviously had to put some test events into
Asterisk. I have this in a local copy and will likely end up creating a branch
of Asterisk trunk to track my additional test events.


Added:
    asterisk/team/mmichelson/bridge-tests/tests/bridge/disconnect/
    asterisk/team/mmichelson/bridge-tests/tests/bridge/disconnect/configs/
    asterisk/team/mmichelson/bridge-tests/tests/bridge/disconnect/configs/ast1/
    asterisk/team/mmichelson/bridge-tests/tests/bridge/disconnect/configs/ast1/extensions.conf   (with props)
    asterisk/team/mmichelson/bridge-tests/tests/bridge/disconnect/test-config.yaml   (with props)
Modified:
    asterisk/team/mmichelson/bridge-tests/configs/bridge/ast2/extensions.conf
    asterisk/team/mmichelson/bridge-tests/configs/bridge/ast3/extensions.conf
    asterisk/team/mmichelson/bridge-tests/lib/python/asterisk/BridgeTestCase.py
    asterisk/team/mmichelson/bridge-tests/tests/bridge/simple_bridge/test-config.yaml

Modified: asterisk/team/mmichelson/bridge-tests/configs/bridge/ast2/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mmichelson/bridge-tests/configs/bridge/ast2/extensions.conf?view=diff&rev=3367&r1=3366&r2=3367
==============================================================================
--- asterisk/team/mmichelson/bridge-tests/configs/bridge/ast2/extensions.conf (original)
+++ asterisk/team/mmichelson/bridge-tests/configs/bridge/ast2/extensions.conf Thu Jul 26 14:09:56 2012
@@ -16,5 +16,5 @@
 same => n,Hangup()
 same => n(talkdetectpass),NoOp()
 same => n,UserEvent(TalkDetect, result: pass)
-same => n,Echo()
+same => n,Wait(10000)
 same => n,Hangup()

Modified: asterisk/team/mmichelson/bridge-tests/configs/bridge/ast3/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mmichelson/bridge-tests/configs/bridge/ast3/extensions.conf?view=diff&rev=3367&r1=3366&r2=3367
==============================================================================
--- asterisk/team/mmichelson/bridge-tests/configs/bridge/ast3/extensions.conf (original)
+++ asterisk/team/mmichelson/bridge-tests/configs/bridge/ast3/extensions.conf Thu Jul 26 14:09:56 2012
@@ -7,7 +7,7 @@
 same => n,Playback(${RECORDED_FILE})
 same => n,SendDTMF(#)
 same => n,UserEvent(Connected, Channel: ${CHANNEL(name)})
-same => n,Echo()
+same => n,Wait(10000)
 same => n,Hangup()
 same => n(fail),UserEvent(DTMF, Success: False)
 same => n,Hangup()

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=3367&r1=3366&r2=3367
==============================================================================
--- asterisk/team/mmichelson/bridge-tests/lib/python/asterisk/BridgeTestCase.py (original)
+++ asterisk/team/mmichelson/bridge-tests/lib/python/asterisk/BridgeTestCase.py Thu Jul 26 14:09:56 2012
@@ -149,8 +149,10 @@
 
     def hangup_callback(self, ami, event):
         if ami is self.ami_bob:
+            LOGGER.info("Bob has hung up")
             self.bob_hungup = True
         elif ami is self.ami_alice:
+            LOGGER.info("Alice has hung up")
             self.alice_hungup = True
 
         if self.bob_hungup and self.alice_hungup:
@@ -241,7 +243,7 @@
         else:
             self.feature_success = False
 
-        LOGGER.info("Sending feature %s to %s" % (feature['what'],
+        LOGGER.info("Sending feature %s from %s" % (feature['what'],
             feature['who']))
         ami.playDTMF(channel, BridgeTestCase.FEATURE_MAP[feature['what']])
 

Added: asterisk/team/mmichelson/bridge-tests/tests/bridge/disconnect/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mmichelson/bridge-tests/tests/bridge/disconnect/configs/ast1/extensions.conf?view=auto&rev=3367
==============================================================================
--- asterisk/team/mmichelson/bridge-tests/tests/bridge/disconnect/configs/ast1/extensions.conf (added)
+++ asterisk/team/mmichelson/bridge-tests/tests/bridge/disconnect/configs/ast1/extensions.conf Thu Jul 26 14:09:56 2012
@@ -1,0 +1,7 @@
+[default]
+
+exten => alice_disconnect,1,Dial(SIP/test_call at bob,,Ht)
+same => n,Hangup()
+
+exten => bob_disconnect,1,Dial(SIP/test_call at bob,,hT)
+same => n,Hangup()

Propchange: asterisk/team/mmichelson/bridge-tests/tests/bridge/disconnect/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/mmichelson/bridge-tests/tests/bridge/disconnect/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/mmichelson/bridge-tests/tests/bridge/disconnect/configs/ast1/extensions.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/team/mmichelson/bridge-tests/tests/bridge/disconnect/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mmichelson/bridge-tests/tests/bridge/disconnect/test-config.yaml?view=auto&rev=3367
==============================================================================
--- asterisk/team/mmichelson/bridge-tests/tests/bridge/disconnect/test-config.yaml (added)
+++ asterisk/team/mmichelson/bridge-tests/tests/bridge/disconnect/test-config.yaml Thu Jul 26 14:09:56 2012
@@ -1,0 +1,42 @@
+testinfo:
+    summary: 'Test the DTMF disconnect feature'
+    description: |
+        'Set up a bridge between two endpoints and check that the DTMF disconnect
+        feature is detected properly and ends the call if detected'
+
+test-modules:
+    test-object:
+        config-section: bridge-config
+        typename: 'BridgeTestCase.BridgeTestCase'
+
+bridge-config:
+    -
+        extension: 'alice_disconnect'
+        features:
+            -
+                who: 'bob'
+                what: 'disconnect'
+                success: 'false'
+            -
+                who: 'alice'
+                what: 'disconnect'
+                success: 'true'
+    -
+        extension: 'bob_disconnect'
+        features:
+            -
+                who: 'alice'
+                what: 'disconnect'
+                success: 'false'
+            -
+                who: 'bob'
+                what: 'disconnect'
+                success: 'true'
+
+properties:
+    minversion: '11.0.0'
+    dependencies:
+        - python : 'twisted'
+        - python : 'starpy'
+    tags:
+        - bridge

Propchange: asterisk/team/mmichelson/bridge-tests/tests/bridge/disconnect/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/team/mmichelson/bridge-tests/tests/bridge/disconnect/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/team/mmichelson/bridge-tests/tests/bridge/disconnect/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: asterisk/team/mmichelson/bridge-tests/tests/bridge/simple_bridge/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mmichelson/bridge-tests/tests/bridge/simple_bridge/test-config.yaml?view=diff&rev=3367&r1=3366&r2=3367
==============================================================================
--- asterisk/team/mmichelson/bridge-tests/tests/bridge/simple_bridge/test-config.yaml (original)
+++ asterisk/team/mmichelson/bridge-tests/tests/bridge/simple_bridge/test-config.yaml Thu Jul 26 14:09:56 2012
@@ -13,19 +13,6 @@
     -
         extension: 'test_call'
         hangup: 'alice'
-        features:
-            -
-                who: 'alice'
-                what: 'atxfer'
-                success: 'false'
-            -
-                who: 'bob'
-                what: 'atxfer'
-                success: 'false'
-            -
-                who: 'alice'
-                what: 'automon'
-                success: 'true'
     -
         extension: 'test_call'
         hangup: 'bob'




More information about the asterisk-commits mailing list