[asterisk-dev] [Code Review] 2592: testsuite: Create a basic test for call pickup

Matt Jordan reviewboard at asterisk.org
Mon Jun 24 16:10:19 CDT 2013


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


One of the primary reasons for having tests is to verify functionality that shouldn't change between versions. By having a test that runs against both 11 and 12, we can ensure that regardless of AMI event differences, configuration changes, etc. - the basic functionality still works. I really think this test needs to run against 11 and 12, which will probably change how you structure this test, since the AMI events have changed so significantly.

{quote}
This test is based roughly on the directed pickup application test (but that test doesn't really work anymore).
{quote}

That's a sign that something changed. Either that test is broken, or Pickup has changed enough that valid configurations will now break.


/asterisk/trunk/tests/feature_call_pickup/configs/ast1/extensions.conf
<https://reviewboard.asterisk.org/r/2592/#comment17613>

    This is all unused as well



/asterisk/trunk/tests/feature_call_pickup/run-test
<https://reviewboard.asterisk.org/r/2592/#comment17612>

    In order to know that we didn't break Pickup, this test should be written to run against both 11 and 12.
    
    That means listening for the Dial event in 11, and, unfortunately, the Bridge event. You'll have to be careful to not process that event more times than you want.
    
    As an aside, this is part of the reason why the pluggable module framework is so nice - you can specify module instances based on Asterisk versions, change what event you want to trigger on, then have it call a callback specific to that version.



/asterisk/trunk/tests/feature_call_pickup/run-test
<https://reviewboard.asterisk.org/r/2592/#comment17611>

    Don't capitalize names in functions. See http://www.python.org/dev/peps/pep-0008/#function-names



/asterisk/trunk/tests/feature_call_pickup/run-test
<https://reviewboard.asterisk.org/r/2592/#comment17610>

    start_asterisk and stop_asterisk are virtual functions. If you don't override them, you don't need them.


- Matt Jordan


On June 5, 2013, 4:02 p.m., jrose wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2592/
> -----------------------------------------------------------
> 
> (Updated June 5, 2013, 4:02 p.m.)
> 
> 
> Review request for Asterisk Developers, kmoore and Matt Jordan.
> 
> 
> Bugs: ASTERISK-21544
>     https://issues.asterisk.org/jira/browse/ASTERISK-21544
> 
> 
> Repository: testsuite
> 
> 
> Description
> -------
> 
> This test is based roughly on the directed pickup application test (but that test doesn't really work anymore). Basically it does the following:
> 
> 1) A local channel is originated to an extension that will dial a SIP peer (faker). This SIP peer points to an unused address, so it won't answer.
> 2) Once the dial starts, Asterisk 2 dials Asterisk 1 via SIP to extension *8 (the pickup extension assigned in features.conf)
> 3) At this point the SIP channel on Asterisk 2 (sip_receive is its peername on Asterisk 1) should answer the call made by the local channel since faker is in a callgroup set for use by sip_receive. Both channels will then enter a simple bridge together.
> 
> Once https://reviewboard.asterisk.org/r/2582/ is committed I can also add the pickupsound being played as a condition for completing the test.
> 
> 
> Diffs
> -----
> 
>   /asterisk/trunk/tests/feature_call_pickup/configs/ast1/extensions.conf PRE-CREATION 
>   /asterisk/trunk/tests/feature_call_pickup/configs/ast1/features.conf PRE-CREATION 
>   /asterisk/trunk/tests/feature_call_pickup/configs/ast1/sip.conf PRE-CREATION 
>   /asterisk/trunk/tests/feature_call_pickup/configs/ast2/extensions.conf PRE-CREATION 
>   /asterisk/trunk/tests/feature_call_pickup/configs/ast2/sip.conf PRE-CREATION 
>   /asterisk/trunk/tests/feature_call_pickup/run-test PRE-CREATION 
>   /asterisk/trunk/tests/feature_call_pickup/test-config.yaml PRE-CREATION 
> 
> Diff: https://reviewboard.asterisk.org/r/2592/diff/
> 
> 
> Testing
> -------
> 
> Ran it a few times and made sure what was happening matched with log messages after the test was over. Made sure all pass conditions were actually met as well.
> 
> 
> Thanks,
> 
> jrose
> 
>

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


More information about the asterisk-dev mailing list