[asterisk-commits] qwell: testsuite/asterisk/trunk r1851 - /asterisk/trunk/tests/cdr/cdr_unanswe...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Aug 16 12:07:24 CDT 2011


Author: qwell
Date: Tue Aug 16 12:07:20 2011
New Revision: 1851

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=1851
Log:
Fix issue with CDRs being randomly ordered.

Modified:
    asterisk/trunk/tests/cdr/cdr_unanswered_yes/run-test

Modified: asterisk/trunk/tests/cdr/cdr_unanswered_yes/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/cdr/cdr_unanswered_yes/run-test?view=diff&rev=1851&r1=1850&r2=1851
==============================================================================
--- asterisk/trunk/tests/cdr/cdr_unanswered_yes/run-test (original)
+++ asterisk/trunk/tests/cdr/cdr_unanswered_yes/run-test Tue Aug 16 12:07:20 2011
@@ -60,11 +60,17 @@
             channel="Local/1 at default;2", dchannel="", lastapp="Hangup", lastarg="",
             disposition="NO ANSWER", amaflags="DOCUMENTATION")])
 
-        if re.match("Local/1 at default-....;2", cdr1[0].channel):
-                # Small hack to force channels to match.  No problem, since we just checked them ourselves.
-                cdr1[0].channel = cdr1_expect[0].channel
+        cdr1_match = None
 
-        if cdr1_expect[0].match(cdr1[0]):
+        # Find the CDR we want to match, since ordering is random.
+        for c in cdr1:
+                if re.match("Local/1 at default-....;2", c.channel):
+                        cdr1_match = c
+                        # Small hack to force channels to match.  No problem, since we just checked them ourselves.
+                        cdr1_match.channel = cdr1_expect[0].channel
+                        break
+
+        if cdr1_expect[0].match(cdr1_match):
             print "Success"
             self.passed = True
         else:




More information about the asterisk-commits mailing list