[asterisk-commits] kmoore: testsuite/asterisk/trunk r4151 - /asterisk/trunk/tests/bridge/dial_LS...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Sep 10 14:22:11 CDT 2013


Author: kmoore
Date: Tue Sep 10 14:19:01 2013
New Revision: 4151

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=4151
Log:
Account for a race condition in the Dial() L and S options test

Modified:
    asterisk/trunk/tests/bridge/dial_LS_options/Tester.py

Modified: asterisk/trunk/tests/bridge/dial_LS_options/Tester.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/bridge/dial_LS_options/Tester.py?view=diff&rev=4151&r1=4150&r2=4151
==============================================================================
--- asterisk/trunk/tests/bridge/dial_LS_options/Tester.py (original)
+++ asterisk/trunk/tests/bridge/dial_LS_options/Tester.py Tue Sep 10 14:19:01 2013
@@ -99,14 +99,18 @@
                     (self.current_call['numwarnings'], self.num_warnings))
             self.test_object.set_passed(False)
 
-        triggers = 1
+        max_triggers = 1
         if self.current_call['hangup_style'] == 'BRIDGE_TIMELIMIT' \
             and AsteriskVersion() >= AsteriskVersion('12'):
-            triggers = 2
+            max_triggers = 2
 
-        if triggers != self.num_hangup_triggers:
-            LOGGER.error("We expected %d hangup trigger(s) but got %d" %
-                    (triggers, self.num_hangup_triggers))
+        if 1 != self.num_hangup_triggers and max_triggers != self.num_hangup_triggers:
+            if max_triggers == 2:
+                LOGGER.error("We expected 1 or 2 hangup triggers but got %d" %
+                        (self.num_hangup_triggers))
+            else:
+                LOGGER.error("We expected 1 hangup trigger but got %d" %
+                        (self.num_hangup_triggers))
             self.test_object.set_passed(False)
 
         # Reset the variables for the next call




More information about the asterisk-commits mailing list