[asterisk-dev] [Code Review] 2618: testsuite - Add module for testing RESTful API

David Lee reviewboard at asterisk.org
Wed Jun 12 15:32:11 CDT 2013


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

Review request for Asterisk Developers and Matt Jordan.


Bugs: ASTERISK-21818
    https://issues.asterisk.org/jira/browse/ASTERISK-21818


Repository: testsuite


Description
-------

This patch adds a pluggable module to the Asterisk testing framework
to aid in testing the new Asterisk 12 RESTful API's.

It is similar in scope to the AMI plugable module. In the test's
test-config.yaml file, event specifications can be specified, along
with requirements for passing the test. The only requirements
implemented by this patch are count (which support >, < and exact
count) and callback (which is also where custom logic may be kicked
off on events).

The WebSocket client is implemented using autobahn's WebSocket
support[1], since that plays very nicely with our Twisted infected
framework. RESTful API invocations are made using Requests[2], since
it's an extremely convenient abstraction for HTTP.

A test for the /channels/{channelId}/continue resource was added for
the initial implementation.

 [1]: http://autobahn.ws/
 [2]: http://docs.python-requests.org/en/latest/


Diffs
-----

  /asterisk/trunk/tests/tests.yaml 3846 
  /asterisk/trunk/tests/rest_api/tests.yaml PRE-CREATION 
  /asterisk/trunk/tests/rest_api/continue/test-config.yaml PRE-CREATION 
  /asterisk/trunk/tests/rest_api/continue/rest_continue.py PRE-CREATION 
  /asterisk/trunk/tests/rest_api/continue/configs/ast1/stasis_http.conf PRE-CREATION 
  /asterisk/trunk/tests/rest_api/continue/configs/ast1/http.conf PRE-CREATION 
  /asterisk/trunk/tests/rest_api/continue/configs/ast1/extensions.conf PRE-CREATION 
  /asterisk/trunk/sample-yaml/ari-config.yaml.sample PRE-CREATION 
  /asterisk/trunk/lib/python/asterisk/TestRunner.py 3846 
  /asterisk/trunk/lib/python/asterisk/ari.py PRE-CREATION 

Diff: https://reviewboard.asterisk.org/r/2618/diff/


Testing
-------

Ran the unit test.

Also made minor changes to the test (changed config, URL's, etc.) to
verify that it would fail as expected.


Thanks,

David Lee

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


More information about the asterisk-dev mailing list