[asterisk-dev] [Code Review] 4226: Testsuite: Add tests for external interactions with ARI/Stasis

Matt Jordan reviewboard at asterisk.org
Thu Dec 4 09:07:51 CST 2014


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



asterisk/trunk/lib/python/asterisk/ari.py
<https://reviewboard.asterisk.org/r/4226/#comment24377>

    You should be able to use a comprehension here:
    
    params = dict((key, var_replace(val, values)) for key, val in self.params.iteritems())



asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/bridged/configs/ast1/extensions.conf
<https://reviewboard.asterisk.org/r/4226/#comment24383>

    You don't really need this.
    
    This applies to your other dialplan as well.



asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/bridged/configs/ast1/extensions.conf
<https://reviewboard.asterisk.org/r/4226/#comment24384>

    Add an explicit hangup. The file should also end with a new line.
    
    This applies to your other dialplan as well.



asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/bridged/test-config.yaml
<https://reviewboard.asterisk.org/r/4226/#comment24380>

    Nit: Replace "one channel" with "one Local channel".
    
    May as well be specific. This applies to all your descriptions.



asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/bridged/test-config.yaml
<https://reviewboard.asterisk.org/r/4226/#comment24381>

    Be specific in the description here. When mentioning "the Stasis channel", I'd reference a specific Local channel half, since that is what you're dealing with.
    
    This applies to all your descriptions.



asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/bridged/test-config.yaml
<https://reviewboard.asterisk.org/r/4226/#comment24382>

    Since we're likely to have failures in earlier versions, the min version for some of these should just be the next release that will contain the patch that these tests cover. In that case, it should probably be 12.8.0.



asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/tests.yaml
<https://reviewboard.asterisk.org/r/4226/#comment24379>

    It's unclear from the test name if 'bridged' and 'unbridged' refers to the external portion or the Stasis portion.
    
    I'd rename to this 'stasis_app' and 'stasis_bridge'.



asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/masq_in/attended_transfer.py
<https://reviewboard.asterisk.org/r/4226/#comment24386>

    Since these are identical, you should be able to place the python snippets in a 'shared directory' and reference that path in the YAML (by adding it to the search path). That will keep code duplication to a minimum.
    
    For an example of this, see the ForkCDR tests.



asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/masq_in/test-config.yaml
<https://reviewboard.asterisk.org/r/4226/#comment24389>

    Rework the summary to better match the test name in the test plan



asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/masq_in/test-config.yaml
<https://reviewboard.asterisk.org/r/4226/#comment24387>

    Add res_ari_bridges here as well



asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/swap_in/test-config.yaml
<https://reviewboard.asterisk.org/r/4226/#comment24388>

    Rework the summary to better match the test name in the test plan



asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/swap_in/test-config.yaml
<https://reviewboard.asterisk.org/r/4226/#comment24390>

    And put a res_ari_bridges here as well



asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/tests.yaml
<https://reviewboard.asterisk.org/r/4226/#comment24385>

    These test names only have meaning to those who are *VERY* familiar with the guts of Asterisk. As it is, looking at your names, I'd have to think pretty hard to match them against the test plan on the wiki.
    
    I'd pick names that are more descriptive of the scenarios that they are actually testing. Since this _should_ be scenarios 1.4/1.5, I'd go with:
    
    'stasis_bridge_to_stasis_app'
    'stasis_bridge_to_stasis_bridge'
    
    Keep in mind there are going to be at least 7 total tests here, some of which are going to involve swapping in/masquerading in as well - just from different sources. The names of the test should be clear enough that people can tell what the differences are. 



asterisk/trunk/tests/rest_api/external_interaction/tests.yaml
<https://reviewboard.asterisk.org/r/4226/#comment24378>

    While you're here, make this a directory as well. It will need to be one.


- Matt Jordan


On Dec. 4, 2014, 9:01 a.m., opticron wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/4226/
> -----------------------------------------------------------
> 
> (Updated Dec. 4, 2014, 9:01 a.m.)
> 
> 
> Review request for Asterisk Developers and Mark Michelson.
> 
> 
> Bugs: ASTERISK-24537
>     https://issues.asterisk.org/jira/browse/ASTERISK-24537
> 
> 
> Repository: testsuite
> 
> 
> Description
> -------
> 
> This reorganizes existing tests that affect channels in Stasis() via external mechanisms and adds new tests to cover other interactions not yet represented in the testsuite. An additional, more comprehensive test for attended transfers has been added as well as tests for bridged and unbridged channels in Stasis() being affected by AMI Bridge and Redirect actions. The bug reported in ASTERISK-24591 was found while writing these tests.
> 
> This also modifies the ARI python libraries to allow parameters to have substituted variables.
> 
> This covers tests 1.3, 2.1.1, 2.10.1, 3.1, and 3.2 from the StasisStart/StasisEnd test plan available here: https://wiki.asterisk.org/wiki/pages/viewpage.action?pageId=30279826
> 
> The two existing attended and blind transfer tests cover tests 1.4 and 1.9.
> 
> 
> Diffs
> -----
> 
>   asterisk/trunk/tests/rest_api/tests.yaml 6018 
>   asterisk/trunk/tests/rest_api/external_interaction/tests.yaml PRE-CREATION 
>   asterisk/trunk/tests/rest_api/external_interaction/blind_transfer/test-config.yaml PRE-CREATION 
>   asterisk/trunk/tests/rest_api/external_interaction/blind_transfer/configs/ast1/pjsip.conf PRE-CREATION 
>   asterisk/trunk/tests/rest_api/external_interaction/blind_transfer/configs/ast1/extensions.conf PRE-CREATION 
>   asterisk/trunk/tests/rest_api/external_interaction/blind_transfer/blind_transfer.py PRE-CREATION 
>   asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/tests.yaml PRE-CREATION 
>   asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/swap_in/test-config.yaml PRE-CREATION 
>   asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/swap_in/sipp/referer.xml PRE-CREATION 
>   asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/swap_in/sipp/referee.xml PRE-CREATION 
>   asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/swap_in/configs/ast1/pjsip.conf PRE-CREATION 
>   asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/swap_in/configs/ast1/extensions.conf PRE-CREATION 
>   asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/swap_in/attended_transfer.py PRE-CREATION 
>   asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/masq_in/test-config.yaml PRE-CREATION 
>   asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/masq_in/sipp/referer.xml PRE-CREATION 
>   asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/masq_in/sipp/referee.xml PRE-CREATION 
>   asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/masq_in/configs/ast1/pjsip.conf PRE-CREATION 
>   asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/masq_in/configs/ast1/extensions.conf PRE-CREATION 
>   asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/masq_in/attended_transfer.py PRE-CREATION 
>   asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/unbridged/test-config.yaml PRE-CREATION 
>   asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/unbridged/configs/ast1/extensions.conf PRE-CREATION 
>   asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/tests.yaml PRE-CREATION 
>   asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/bridged/test-config.yaml PRE-CREATION 
>   asterisk/trunk/tests/rest_api/external_interaction/ami_redirect/bridged/configs/ast1/extensions.conf PRE-CREATION 
>   asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/unbridged/test-config.yaml PRE-CREATION 
>   asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/unbridged/configs/ast1/extensions.conf PRE-CREATION 
>   asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/tests.yaml PRE-CREATION 
>   asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/bridged/test-config.yaml PRE-CREATION 
>   asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/bridged/configs/ast1/extensions.conf PRE-CREATION 
>   asterisk/trunk/tests/rest_api/bridges/tests.yaml 6018 
>   asterisk/trunk/tests/rest_api/bridges/blind_transfer/test-config.yaml 6018 
>   asterisk/trunk/tests/rest_api/bridges/blind_transfer/configs/ast1/pjsip.conf 6018 
>   asterisk/trunk/tests/rest_api/bridges/blind_transfer/configs/ast1/extensions.conf 6018 
>   asterisk/trunk/tests/rest_api/bridges/blind_transfer/blind_transfer.py 6018 
>   asterisk/trunk/tests/rest_api/bridges/attended_transfer/test-config.yaml 6018 
>   asterisk/trunk/tests/rest_api/bridges/attended_transfer/sipp/referer.xml 6018 
>   asterisk/trunk/tests/rest_api/bridges/attended_transfer/sipp/referee.xml 6018 
>   asterisk/trunk/tests/rest_api/bridges/attended_transfer/configs/ast1/pjsip.conf 6018 
>   asterisk/trunk/tests/rest_api/bridges/attended_transfer/configs/ast1/extensions.conf 6018 
>   asterisk/trunk/tests/rest_api/bridges/attended_transfer/attended_transfer.py 6018 
>   asterisk/trunk/lib/python/asterisk/ari.py 6018 
> 
> Diff: https://reviewboard.asterisk.org/r/4226/diff/
> 
> 
> Testing
> -------
> 
> Ran the tests and verified they passed with the expected events when the fix in 4213 is applied.
> 
> 
> Thanks,
> 
> opticron
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20141204/8a885611/attachment-0001.html>


More information about the asterisk-dev mailing list