[asterisk-dev] [Code Review]: Testsuite: CDRTestCase and tests/cdr/originate_sip_congestion_log

jrose reviewboard at asterisk.org
Wed Aug 10 11:04:57 CDT 2011



> On Aug. 9, 2011, 12:53 p.m., mjordan wrote:
> > /asterisk/trunk/tests/cdr/tests.yaml, line 6
> > <https://reviewboard.asterisk.org/r/1357/diff/1/?file=17816#file17816line6>
> >
> >     May want to have the name of the test include "CDR", since that is what appears to be tested.  It would also match the convention of the other tests, 'cdr_unanswered_yes' and 'cdr_userfield'
> 
> jrose wrote:
>     Well, it's really not as cut and dry as that.  Some of the CDR tests have cdr in the name, some don't.  The one I was looking at the first time was just console_dial_sip_congestion.  It isn't really necessary to call them by CDR since they are in the CDR test folder.  I'll go ahead and do it though since there is really no reason not to.
> 
> mjordan wrote:
>     Missed this reply :-)
>     
>     If it isn't cut and dry, then go with whatever you think is best.  Based on the conversation and the test, I expected it to be a test of CDR - and saw that we have some other tests labelled as such.  In general, I'd expect a test name to tell me at a glance what its testing - but if its more of a SIP test, then the current name makes sense.
>     
>     So, I'd go with whatever you think makes more sense to people who have to maintain the tests.

I went with cdr_originate_sip_congestion_log.  SIP itself shouldn't be especially significant, but it does describe what kind of channel the test works with, which is consistent with the other CDR tests that exist right now that test things like this.


- jrose


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1357/#review4011
-----------------------------------------------------------


On Aug. 9, 2011, 2:34 p.m., jrose wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1357/
> -----------------------------------------------------------
> 
> (Updated Aug. 9, 2011, 2:34 p.m.)
> 
> 
> Review request for Asterisk Developers and Paul Belanger.
> 
> 
> Summary
> -------
> 
> This is a test suite addition for performing tests involving CDRs.  It should be possible now to perform most of the CDR tests simply by using AMI commands to control the call and have some CDR info supplied before hand and the whole test should just work without much input beyond that.
> 
> The test included which uses the CDRTestCase requires a patch that is still in review from:
> https://reviewboard.asterisk.org/r/1331/
> 
> If this change is OK'd, I'll go ahead and start working on a major conversion project to change most of the existing python CDR tests into CDRTestCase equivalents.
> 
> Note about CDRTestCase - It is a subclass of TestCase, so it has most of the functionality from that.  In addition, it holds CDRLines specific to individual instances of Asterisk that are running and makes adding expected lines and checking them as simple as a single function call containing the CDRLine and an index.  It should also be pretty easy to adapt the behavior for more elaborate needs.
> 
> 
> Diffs
> -----
> 
>   /asterisk/trunk/tests/cdr/tests.yaml 1822 
>   /asterisk/trunk/tests/cdr/cdr_originate_sip_congestion_log/test-config.yaml PRE-CREATION 
>   /asterisk/trunk/tests/cdr/cdr_originate_sip_congestion_log/run-test PRE-CREATION 
>   /asterisk/trunk/tests/cdr/cdr_originate_sip_congestion_log/configs/ast2/sip.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/cdr_originate_sip_congestion_log/configs/ast2/cdr.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/cdr_originate_sip_congestion_log/configs/ast2/extensions.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/cdr_originate_sip_congestion_log/configs/ast1/sip.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/cdr_originate_sip_congestion_log/configs/ast1/manager.users.conf.inc PRE-CREATION 
>   /asterisk/trunk/tests/cdr/cdr_originate_sip_congestion_log/configs/ast1/manager.general.conf.inc PRE-CREATION 
>   /asterisk/trunk/tests/cdr/cdr_originate_sip_congestion_log/configs/ast1/extensions.conf PRE-CREATION 
>   /asterisk/trunk/lib/python/asterisk/CDRTestCase.py PRE-CREATION 
>   /asterisk/trunk/tests/cdr/cdr_originate_sip_congestion_log/configs/ast1/cdr.conf PRE-CREATION 
> 
> Diff: https://reviewboard.asterisk.org/r/1357/diff
> 
> 
> Testing
> -------
> 
> The bulk of the testing was just making sure the add method and the match methods worked properly.  There was also getting the test itself working.  I'm pretty confident that this is fine as is.
> 
> 
> Thanks,
> 
> jrose
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20110810/d0400eaa/attachment.htm>


More information about the asterisk-dev mailing list