[svn-commits] mjordan: testsuite/asterisk/trunk r4039 - in /asterisk/trunk/tests/cdr: ./ cd...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Aug 19 08:15:30 CDT 2013


Author: mjordan
Date: Mon Aug 19 08:15:20 2013
New Revision: 4039

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=4039
Log:
Update cdr_fork_end_time test for Asterisk 12 changes

In Asterisk 12, forking a CDR with the 'e' flag does not reset the start and
answer times. Those are left to other flags. The module that performs the time
based checking was modified to only apply that logic to versions of Asterisk
prior to Asterisk 12.

Modified:
    asterisk/trunk/tests/cdr/cdr-tests.py
    asterisk/trunk/tests/cdr/cdr_manipulation/cdr_fork_end_time/test-config.yaml

Modified: asterisk/trunk/tests/cdr/cdr-tests.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/cdr/cdr-tests.py?view=diff&rev=4039&r1=4038&r2=4039
==============================================================================
--- asterisk/trunk/tests/cdr/cdr-tests.py (original)
+++ asterisk/trunk/tests/cdr/cdr-tests.py Mon Aug 19 08:15:20 2013
@@ -136,6 +136,34 @@
                 self.test_object.set_passed(False)
                 return
 
+        self.test_object.set_passed(True)
+
+
+
+class ForkCdrModuleEndResetTime(ForkCdrModuleEndTime):
+    ''' A class that adds some additional CDR checking of the end times on top
+    of CDRModule
+
+    In addition to checking the normal expectations, this class also checks
+    whether or not the end times of the CDRs are within some period of time
+    of each each other.
+
+    Note that this class assumes the CDRs are in cdrtest_local.
+    '''
+
+    def __init__(self, module_config, test_object):
+        super(ForkCdrModuleEndResetTime, self).__init__(module_config,
+            test_object)
+        self.entries_to_check = module_config[0]['check-entries']
+
+    def match_cdrs(self):
+        super(ForkCdrModuleEndResetTime, self).match_cdrs()
+
+        cdr1 = AsteriskCSVCDR(fn = "%s/%s/cdr-csv/%s.csv" %
+                (self.test_object.ast[0].base,
+                 self.test_object.ast[0].directories['astlogdir'],
+                 "cdrtest_local"))
+
         LOGGER.debug('Checking start/end times for forked entries')
         for i in range(len(self.entries_to_check) - 1):
             end = time.strptime(cdr1[self.entries_to_check[i]].end,

Modified: asterisk/trunk/tests/cdr/cdr_manipulation/cdr_fork_end_time/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/cdr/cdr_manipulation/cdr_fork_end_time/test-config.yaml?view=diff&rev=4039&r1=4038&r2=4039
==============================================================================
--- asterisk/trunk/tests/cdr/cdr_manipulation/cdr_fork_end_time/test-config.yaml (original)
+++ asterisk/trunk/tests/cdr/cdr_manipulation/cdr_fork_end_time/test-config.yaml Mon Aug 19 08:15:20 2013
@@ -20,7 +20,7 @@
         -
             maxversion: '12.0.0'
             config-section: 'cdr-config-pre-12'
-            typename: 'cdr-tests.ForkCdrModuleEndTime'
+            typename: 'cdr-tests.ForkCdrModuleEndResetTime'
         -
             minversion: '12.0.0'
             config-section: 'cdr-config-12'




More information about the svn-commits mailing list