[asterisk-commits] qwell: testsuite/asterisk/trunk r1846 - /asterisk/trunk/tests/cdr/cdr_userfield/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Aug 16 10:26:04 CDT 2011


Author: qwell
Date: Tue Aug 16 10:26:00 2011
New Revision: 1846

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=1846
Log:
Remove soundcard dependency from cdr/cdr_userfield/

Modified:
    asterisk/trunk/tests/cdr/cdr_userfield/run-test
    asterisk/trunk/tests/cdr/cdr_userfield/test-config.yaml

Modified: asterisk/trunk/tests/cdr/cdr_userfield/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/cdr/cdr_userfield/run-test?view=diff&rev=1846&r1=1845&r2=1846
==============================================================================
--- asterisk/trunk/tests/cdr/cdr_userfield/run-test (original)
+++ asterisk/trunk/tests/cdr/cdr_userfield/run-test Tue Aug 16 10:26:00 2011
@@ -16,6 +16,7 @@
 from asterisk.ami import AMI
 from twisted.internet import reactor
 import logging
+import re
 
 workingdir = "/tmp/asterisk-testsuite/cdr_userfield"
 testdir = "tests/cdr/cdr_userfield"
@@ -36,7 +37,7 @@
 
     def start(self, ami):
         ami.registerEvent('Hangup', self.end)
-        self.ast1.cli_exec("console dial 1 at default")
+        ami.originate(channel = "Local/1 at default", application = "Echo")
 
     def stop_asterisk(self):
         self.ast1.stop()
@@ -48,16 +49,22 @@
         self.stop_asterisk()
 
     def end(self, ami, event):
+        if not re.match(".*;2$", event['channel']):
+                return
         self.stop_reactor()
 
         cdr1 = AsteriskCSVCDR(fn="%s/var/log/asterisk/cdr-csv/Master.csv" % (self.ast1.base))
 
         cdr1_expect = AsteriskCSVCDR(records=[AsteriskCSVCDRLine(accountcode="",
             source="", destination="1", dcontext="default", callerid="",
-            channel="Console/dsp", dchannel="", lastapp="Hangup", lastarg="",
+            channel="Local/1 at default;2", dchannel="", lastapp="Hangup", lastarg="",
             disposition="ANSWERED", amaflags="DOCUMENTATION", userfield="bazinga")])
 
-        if cdr1_expect.match(cdr1):
+        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
+
+        if cdr1_expect[0].match(cdr1[0]):
             print "Success"
             self.passed = True
         else:

Modified: asterisk/trunk/tests/cdr/cdr_userfield/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/cdr/cdr_userfield/test-config.yaml?view=diff&rev=1846&r1=1845&r2=1846
==============================================================================
--- asterisk/trunk/tests/cdr/cdr_userfield/test-config.yaml (original)
+++ asterisk/trunk/tests/cdr/cdr_userfield/test-config.yaml Tue Aug 16 10:26:00 2011
@@ -8,4 +8,3 @@
     dependencies:
         - python : 'twisted'
         - python : 'starpy'
-        - custom : 'soundcard'




More information about the asterisk-commits mailing list