[asterisk-dev] [Code Review] Add some CDR tests

Russell Bryant russell at digium.com
Thu Apr 29 10:29:40 CDT 2010


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


In general, I like the structure of all of these tests.  I just have a few minor comments.


/asterisk/trunk/tests/cdr/cdr_userfield/run-test
<https://reviewboard.asterisk.org/r/620/#comment4165>

    Why here instead of within the test dir?



/asterisk/trunk/tests/cdr/cdr_userfield/run-test
<https://reviewboard.asterisk.org/r/620/#comment4166>

    check for trailing whitespace



/asterisk/trunk/tests/cdr/console_dial_sip_congestion/run-test
<https://reviewboard.asterisk.org/r/620/#comment4167>

    I usually use a different main() approach, as suggested by guido:
    
    http://www.artima.com/weblogs/viewpost.jsp?thread=4829
    
    
    def main(args=None):
        if argv is None:
            argv = sys.argv
        ...
        return 0
    
    if __name__ == "__main__":
        sys.exit(main())
    
    
    That way it's easy to run things from a python console if you should decide to do so.



/asterisk/trunk/tests/tests.yaml
<https://reviewboard.asterisk.org/r/620/#comment4164>

    I think this proposed naming trend, using a directory like tree structure to help organize things


- Russell


On 2010-04-27 18:16:36, Terry Wilson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/620/
> -----------------------------------------------------------
> 
> (Updated 2010-04-27 18:16:36)
> 
> 
> Review request for Asterisk Developers and Russell Bryant.
> 
> 
> Summary
> -------
> 
> Here are 9 CDR tests. Also added is a wrapper class for starpy's AMI that does exponential backoff reconnecting on a failed connect. The better thing to do with that would be to modify starpy itself to have AMIFactory inherit from ReconnectingClientFactory instead of ClientFactory.
> 
> 
> Diffs
> -----
> 
>   /asterisk/trunk/lib/python/asterisk/ami.py PRE-CREATION 
>   /asterisk/trunk/tests/cdr/cdr_unanswered_yes/configs/cdr.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/cdr_unanswered_yes/configs/extensions.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/cdr_unanswered_yes/configs/logger.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/cdr_unanswered_yes/configs/manager.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/cdr_unanswered_yes/run-test PRE-CREATION 
>   /asterisk/trunk/tests/cdr/cdr_unanswered_yes/test-config.yaml PRE-CREATION 
>   /asterisk/trunk/tests/cdr/cdr_userfield/configs/cdr.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/cdr_userfield/configs/extensions.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/cdr_userfield/configs/logger.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/cdr_userfield/configs/manager.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/cdr_userfield/run-test PRE-CREATION 
>   /asterisk/trunk/tests/cdr/cdr_userfield/test-config.yaml PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_dial_sip_answer/configs1/extensions.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_dial_sip_answer/configs1/manager.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_dial_sip_answer/configs1/sip.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_dial_sip_answer/configs2/extensions.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_dial_sip_answer/configs2/sip.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_dial_sip_answer/configs_common/logger.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_dial_sip_answer/run-test PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_dial_sip_answer/test-config.yaml PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_dial_sip_busy/configs1/extensions.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_dial_sip_busy/configs1/manager.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_dial_sip_busy/configs1/sip.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_dial_sip_busy/configs2/extensions.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_dial_sip_busy/configs2/sip.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_dial_sip_busy/configs_common/logger.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_dial_sip_busy/run-test PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_dial_sip_busy/test-config.yaml PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_dial_sip_congestion/configs1/extensions.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_dial_sip_congestion/configs1/manager.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_dial_sip_congestion/configs1/sip.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_dial_sip_congestion/configs2/extensions.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_dial_sip_congestion/configs2/sip.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_dial_sip_congestion/configs_common/logger.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_dial_sip_congestion/run-test PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_dial_sip_congestion/test-config.yaml PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_dial_sip_transfer/configs1/extensions.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_dial_sip_transfer/configs1/manager.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_dial_sip_transfer/configs1/sip.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_dial_sip_transfer/configs2/extensions.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_dial_sip_transfer/configs2/sip.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_dial_sip_transfer/configs_common/logger.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_dial_sip_transfer/run-test PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_dial_sip_transfer/test-config.yaml PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_fork_after_busy_forward/configs1/extensions.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_fork_after_busy_forward/configs1/manager.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_fork_after_busy_forward/configs1/sip.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_fork_after_busy_forward/configs2/extensions.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_fork_after_busy_forward/configs2/sip.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_fork_after_busy_forward/configs_common/logger.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_fork_after_busy_forward/run-test PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_fork_after_busy_forward/test-config.yaml PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_fork_before_dial/configs1/extensions.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_fork_before_dial/configs1/manager.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_fork_before_dial/configs1/sip.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_fork_before_dial/configs2/extensions.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_fork_before_dial/configs2/sip.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_fork_before_dial/configs_common/logger.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_fork_before_dial/run-test PRE-CREATION 
>   /asterisk/trunk/tests/cdr/console_fork_before_dial/test-config.yaml PRE-CREATION 
>   /asterisk/trunk/tests/cdr/nocdr/configs/cdr.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/nocdr/configs/extensions.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/nocdr/configs/logger.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/nocdr/configs/manager.conf PRE-CREATION 
>   /asterisk/trunk/tests/cdr/nocdr/run-test PRE-CREATION 
>   /asterisk/trunk/tests/cdr/nocdr/test-config.yaml PRE-CREATION 
>   /asterisk/trunk/tests/tests.yaml 255 
> 
> Diff: https://reviewboard.asterisk.org/r/620/diff
> 
> 
> Testing
> -------
> 
> At one point I tested against all releases from 1.4 to 1.6.2 making sure I could make them both fail and pass. I reworked the tests to use twisted so I wouldn't have to do sleep() calls waiting for a call to end and instead just listen for manager events. I have tested on 1.4 and 1.6.2 for those changes.
> 
> 
> Thanks,
> 
> Terry
> 
>




More information about the asterisk-dev mailing list