[svn-commits] mjordan: testsuite/asterisk/trunk r3903 - in /asterisk/trunk: lib/python/aste...
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Fri Jul 12 08:23:12 CDT 2013
Author: mjordan
Date: Fri Jul 12 08:23:10 2013
New Revision: 3903
URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=3903
Log:
Fix Local channel test execution for Asterisk versions prior to 12
The Local channel tests were failing for two reasons:
(1) The SimpleTestCase wasn't detecting the hangup of one of the Local channel halves
when that Local channel was optimized via a Masquerade. The Local channel half
gets renamed with a "<ZOMBIE>" suffix; this caused the explicit channel name
comparison to fail. We now do a partial match comparison.
(2) We need to check *something* to verify test pass/failure. We now verify that a
Masquerade event occurs when we expect it to and not when we don't.
Modified:
asterisk/trunk/lib/python/asterisk/SimpleTestCase.py
asterisk/trunk/tests/channels/local/local_app/test-config.yaml
asterisk/trunk/tests/channels/local/local_call/test-config.yaml
Modified: asterisk/trunk/lib/python/asterisk/SimpleTestCase.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/lib/python/asterisk/SimpleTestCase.py?view=diff&rev=3903&r1=3902&r2=3903
==============================================================================
--- asterisk/trunk/lib/python/asterisk/SimpleTestCase.py (original)
+++ asterisk/trunk/lib/python/asterisk/SimpleTestCase.py Fri Jul 12 08:23:10 2013
@@ -145,7 +145,7 @@
next new call '''
candidate_channel = [chan for chan in self._tracking_channels
- if chan['channel'] == event['channel']]
+ if chan['channel'] in event['channel']]
if (len(candidate_channel)):
LOGGER.debug("Channel %s hung up; removing" % event['channel'])
self._tracking_channels.remove(candidate_channel[0])
Modified: asterisk/trunk/tests/channels/local/local_app/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/local/local_app/test-config.yaml?view=diff&rev=3903&r1=3902&r2=3903
==============================================================================
--- asterisk/trunk/tests/channels/local/local_app/test-config.yaml (original)
+++ asterisk/trunk/tests/channels/local/local_app/test-config.yaml Fri Jul 12 08:23:10 2013
@@ -11,6 +11,11 @@
config-section: test-object-config
typename: 'SimpleTestCase.SimpleTestCase'
modules:
+ -
+ minversion: '1.8.0.0'
+ maxversion: '12.0.0'
+ config-section: ami-config-pre-12
+ typename: 'ami.AMIEventModule'
-
minversion: '12.0.0'
config-section: ami-config-12
@@ -32,6 +37,19 @@
exten: 'dial_foo'
context: 'default'
priority: '1'
+
+ami-config-pre-12:
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'Masquerade'
+ requirements:
+ match:
+ Clone: 'SIP/asterisk-.*'
+ Original: 'Local/dial_bar at default-.*'
+ OriginalState: 'Up'
+ count: '0'
ami-config-12:
-
Modified: asterisk/trunk/tests/channels/local/local_call/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/local/local_call/test-config.yaml?view=diff&rev=3903&r1=3902&r2=3903
==============================================================================
--- asterisk/trunk/tests/channels/local/local_call/test-config.yaml (original)
+++ asterisk/trunk/tests/channels/local/local_call/test-config.yaml Fri Jul 12 08:23:10 2013
@@ -23,6 +23,11 @@
typename: 'SimpleTestCase.SimpleTestCase'
modules:
-
+ minversion: '1.8.0.0'
+ maxversion: '12.0.0'
+ config-section: ami-config-pre-12
+ typename: 'ami.AMIEventModule'
+ -
minversion: '12.0.0'
config-section: ami-config-12
typename: 'ami.AMIEventModule'
@@ -40,6 +45,19 @@
exten: 'dial_foo'
context: 'default'
priority: '1'
+
+ami-config-pre-12:
+ -
+ type: 'headermatch'
+ conditions:
+ match:
+ Event: 'Masquerade'
+ requirements:
+ match:
+ Clone: 'SIP/asterisk-.*'
+ Original: 'Local/dial_bar at default-.*'
+ OriginalState: 'Up'
+ count: '1'
ami-config-12:
-
More information about the svn-commits
mailing list