[asterisk-commits] qwell: testsuite/asterisk/trunk r1845 - in /asterisk/trunk/tests/cdr/cdr_unan...

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


Author: qwell
Date: Tue Aug 16 10:21:16 2011
New Revision: 1845

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

Modified:
    asterisk/trunk/tests/cdr/cdr_unanswered_yes/configs/ast1/extensions.conf
    asterisk/trunk/tests/cdr/cdr_unanswered_yes/run-test
    asterisk/trunk/tests/cdr/cdr_unanswered_yes/test-config.yaml

Modified: asterisk/trunk/tests/cdr/cdr_unanswered_yes/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/cdr/cdr_unanswered_yes/configs/ast1/extensions.conf?view=diff&rev=1845&r1=1844&r2=1845
==============================================================================
--- asterisk/trunk/tests/cdr/cdr_unanswered_yes/configs/ast1/extensions.conf (original)
+++ asterisk/trunk/tests/cdr/cdr_unanswered_yes/configs/ast1/extensions.conf Tue Aug 16 10:21:16 2011
@@ -5,4 +5,4 @@
 [globals]
 
 [default]
-exten => 1,1,Hangup
+exten => 1,1,Hangup()

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=1845&r1=1844&r2=1845
==============================================================================
--- asterisk/trunk/tests/cdr/cdr_unanswered_yes/run-test (original)
+++ asterisk/trunk/tests/cdr/cdr_unanswered_yes/run-test Tue Aug 16 10:21:16 2011
@@ -16,6 +16,7 @@
 from asterisk.ami import AMI
 from twisted.internet import reactor
 import logging
+import re
 
 workingdir = "/tmp/asterisk-testsuite/cdr_unanswered_yes"
 testdir = "tests/cdr/cdr_unanswered_yes"
@@ -24,11 +25,10 @@
     def __init__(self):
         self.passed = False
 
-        ast1 = Asterisk(base=workingdir)
-        ast1.install_configs("%s/configs/ast1" % (testdir))
+        self.ast1 = Asterisk(base=workingdir)
+        self.ast1.install_configs("%s/configs/ast1" % (testdir))
 
-        ast1.start()
-        self.ast1 = ast1
+        self.ast1.start()
 
         reactor.callLater(30, self.stop_reactor)
 
@@ -37,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", async = True)
 
     def stop_asterisk(self):
         self.ast1.stop()
@@ -49,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="NO ANSWER", amaflags="DOCUMENTATION")])
 
-        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_unanswered_yes/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/cdr/cdr_unanswered_yes/test-config.yaml?view=diff&rev=1845&r1=1844&r2=1845
==============================================================================
--- asterisk/trunk/tests/cdr/cdr_unanswered_yes/test-config.yaml (original)
+++ asterisk/trunk/tests/cdr/cdr_unanswered_yes/test-config.yaml Tue Aug 16 10:21:16 2011
@@ -8,4 +8,3 @@
     dependencies:
         - python : 'twisted'
         - python : 'starpy'
-        - custom : 'soundcard'




More information about the asterisk-commits mailing list