[asterisk-dev] [Code Review] New version of sip_outbound_address test

wdoekes reviewboard at asterisk.org
Fri Oct 5 03:14:32 CDT 2012


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

Ship it!


See remarks below and feel free to commit.


/asterisk/trunk/tests/channels/SIP/sip2cause/run-test
<https://reviewboard.asterisk.org/r/2131/#comment13956>

    Was this meant to be in this commit?



/asterisk/trunk/tests/channels/SIP/sip_outbound_address/originator.py
<https://reviewboard.asterisk.org/r/2131/#comment13954>

    > I'd rather an exception be thrown and things crash and burn horribly if self.ami is None when unexpected.
    
    Crash and burn it should. But it will anyway without the assignment:
    
    >>> A.ami = None
    >>> A.ami.do_stuff()
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    AttributeError: 'NoneType' object has no attribute 'do_stuff'
    
    >>> A.bmi.do_stuff()
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    AttributeError: class A has no attribute 'bmi'
    
    In fact, touching it will raise the exception earlier.
    
    pass_ami_around(A.ami) will work while
    pass_ami_around(A.bmi) will notify us of the missing attribute.



/asterisk/trunk/tests/channels/SIP/sip_outbound_address/originator.py
<https://reviewboard.asterisk.org/r/2131/#comment13953>

    Move assignment to dest upward for one less dict lookup and one less line?



/asterisk/trunk/tests/channels/SIP/sip_outbound_address/originator.py
<https://reviewboard.asterisk.org/r/2131/#comment13952>

    No spaces here:
    
    application='Echo'



/asterisk/trunk/tests/manager/login/run-test
<https://reviewboard.asterisk.org/r/2131/#comment13955>

    Was this meant to be in the same commit?


- wdoekes


On Oct. 4, 2012, 5:51 p.m., Mark Michelson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2131/
> -----------------------------------------------------------
> 
> (Updated Oct. 4, 2012, 5:51 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> This is a rewrite of the sip_outbound_address test. This test had a "skip" flag set on it in apparently because the test was bouncing. Unfortunately, not having this test enabled resulted in the issue ASTERISK-19677.
> 
> The test was likely bouncing due to some odd timing being used (combination of Wait() dialplan app plus some sleep() calls in the test code). I've rewritten the test to no longer use Lua and instead use Python. It uses the SIPpTestCase. This test becomes either the second or third to have an "originator" module used alongside the SIPpTestCase. Perhaps it's time to consider making this a module central to the test suite?
> 
> As far as the test details are concerned, the test mostly is the same. The same extensions.conf is used and the same destinations are dialed. Now, instead of having the SIPp scenario that answers send back DTMF, the SIPp scenario simply answers and then hangs up. The test can be determined to pass or fail based on whether the SIPp scenario succeeds or fails. It will fail if Asterisk were to route the request to the wrong destination. This has made the test much simpler than it previously was.
> 
> 
> Diffs
> -----
> 
>   /asterisk/trunk/tests/channels/SIP/sip2cause/run-test 3480 
>   /asterisk/trunk/tests/channels/SIP/sip_outbound_address/configs/ast1/extensions.conf 3480 
>   /asterisk/trunk/tests/channels/SIP/sip_outbound_address/configs/ast1/sip.conf 3480 
>   /asterisk/trunk/tests/channels/SIP/sip_outbound_address/originator.py PRE-CREATION 
>   /asterisk/trunk/tests/channels/SIP/sip_outbound_address/run-test 3480 
>   /asterisk/trunk/tests/channels/SIP/sip_outbound_address/sipp/dtmf_2833_1.pcap UNKNOWN 
>   /asterisk/trunk/tests/channels/SIP/sip_outbound_address/sipp/dtmf_2833_2.pcap UNKNOWN 
>   /asterisk/trunk/tests/channels/SIP/sip_outbound_address/sipp/dtmf_2833_pound.pcap UNKNOWN 
>   /asterisk/trunk/tests/channels/SIP/sip_outbound_address/sipp/uas.xml PRE-CREATION 
>   /asterisk/trunk/tests/channels/SIP/sip_outbound_address/sipp/uas1.xml 3480 
>   /asterisk/trunk/tests/channels/SIP/sip_outbound_address/sipp/uas2.xml 3480 
>   /asterisk/trunk/tests/channels/SIP/sip_outbound_address/test-config.yaml 3480 
>   /asterisk/trunk/tests/channels/SIP/sip_outbound_address/test.lua 3480 
>   /asterisk/trunk/tests/manager/login/run-test 3480 
> 
> Diff: https://reviewboard.asterisk.org/r/2131/diff
> 
> 
> Testing
> -------
> 
> Test passes with current 1.8 version of Asterisk.
> 
> 
> Thanks,
> 
> Mark
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20121005/266eb623/attachment-0001.htm>


More information about the asterisk-dev mailing list