[asterisk-dev] [Code Review] 2661: Give ARI its own test object in the testsuite
David Lee
reviewboard at asterisk.org
Thu Jul 11 15:30:42 CDT 2013
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2661/#review9123
-----------------------------------------------------------
A few findings. You'll also want to update to the latest trunk, to keep up with the latest ARI changes.
/asterisk/trunk/addons/Makefile
<https://reviewboard.asterisk.org/r/2661/#comment17998>
I don't like bundling StarPy and Autobahn together like this. The Makefile should at least have different targets so that either StarPy or Autobahn can be installed independently.
/asterisk/trunk/addons/Makefile
<https://reviewboard.asterisk.org/r/2661/#comment17997>
I have misgivings about installing Autobahn from their master branch. StarPy is relatively stable, so master is pretty good. We don't know that to be the case for Autobahn.
If you want to continue to install Autobahn from source, you should checkout a tag to install from. But, preferably, shouldn't we install from PyPI using easy_install or pip?
/asterisk/trunk/lib/python/asterisk/ari.py
<https://reviewboard.asterisk.org/r/2661/#comment18002>
SyntaxError: invalid syntax
/asterisk/trunk/lib/python/asterisk/ari.py
<https://reviewboard.asterisk.org/r/2661/#comment18003>
Change /ws to /ari/events
/asterisk/trunk/tests/channels/SIP/SDP_offer_answer/run-test
<https://reviewboard.asterisk.org/r/2661/#comment17999>
Unintentional change?
- David Lee
On July 10, 2013, 10:36 a.m., Matt Jordan wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2661/
> -----------------------------------------------------------
>
> (Updated July 10, 2013, 10:36 a.m.)
>
>
> Review request for Asterisk Developers and David Lee.
>
>
> Repository: testsuite
>
>
> Description
> -------
>
> Testing ARI is a bit different than testing normal Asterisk tests. Typically, a test in the Asterisk Test Suite uses the following model:
>
> 1. Create Asterisk Instances
> 2. Wait for instances to fully boot
> 3. Connect AMI
> 4. Wait for AMI connection
> 5. Spawn channels for test
>
> Most of the test logic occurs in step number 5 - while it's possible to inject logic into the first four steps without writing a new test object, it isn't easy, particularly if what you need to do is defer the execution of one of those four steps until something else happens. In particular, ARI tests need to connect the websocket prior to step 4, as the AMI connection is what typically causes channels to be created in the dialplan and test execution to begin. If the websocket connection doesn't happen before that point, a channel may enter into the Stasis application before the websocket connects and the test will fail.
>
> This patch gives ARI its own test object so that it can properly connect the websocket prior to the AMI connection. This changes the startup routine to be:
>
> 1. Create Asterisk Instances
> 2. Wait for instances to fully boot
> 3. Connect ARI
> 4. Wait for ARI connection
> 5. Connection AMI
> 6. Wait for AMI connection
> 7. Spawn channels for test
>
> It also duplicates what we currently do for starpy for Autobahn's websocket library as well, which is what the ARI test library uses for connecting to Asterisk.
>
>
> Diffs
> -----
>
> /asterisk/trunk/addons/Makefile 3880
> /asterisk/trunk/lib/python/asterisk/ari.py 3880
> /asterisk/trunk/sample-yaml/ari-config.yaml.sample 3880
> /asterisk/trunk/tests/channels/SIP/SDP_offer_answer/run-test 3880
> /asterisk/trunk/tests/rest_api/continue/configs/ast1/ari.conf PRE-CREATION
> /asterisk/trunk/tests/rest_api/continue/configs/ast1/stasis_http.conf 3880
> /asterisk/trunk/tests/rest_api/continue/test-config.yaml 3880
>
> Diff: https://reviewboard.asterisk.org/r/2661/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Matt Jordan
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130711/ad647a9f/attachment-0001.htm>
More information about the asterisk-dev
mailing list