[asterisk-dev] [Code Review] 3363: Testsuite: Pluggable module for testing realtime

Mark Michelson reviewboard at asterisk.org
Thu Apr 3 15:08:30 CDT 2014



> On March 25, 2014, 5:42 p.m., opticron wrote:
> > /asterisk/trunk/lib/python/asterisk/realtime_test_module.py, line 322
> > <https://reviewboard.asterisk.org/r/3363/diff/1/?file=56114#file56114line322>
> >
> >     Just to make sure I'm clear here, we're throwing away wildcards (%) and treating them as literal matches?
> >     
> >     res_config_curl doesn't appear to directly use wildcards, but if something can use them through res_config_curl, this is going to break.

Yes, agreed that this could be problematic. After looking at queries a bit more, especially when sorcery is used, this has the potential to fail badly.


> On March 25, 2014, 5:42 p.m., opticron wrote:
> > /asterisk/trunk/lib/python/asterisk/realtime_test_module.py, line 335
> > <https://reviewboard.asterisk.org/r/3363/diff/1/?file=56114#file56114line335>
> >
> >     This resource may need "LIKE" handling as well.

Welp, this hits on the concepts of "in theory" vs. "in practice". SQL certainly has the ability to have wildcards in any where clause, but in practice, Asterisk only ever does this when retrieving multiple records.

So based on what is in Asterisk, and what is likely to ever be in Asterisk, there is no need to add the LIKE handling here. However, given what I'm likely going to have to do in order to fix the wildcard handling, adding LIKE handling everywhere I can is probably fine.


- Mark


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


On March 15, 2014, 6:34 p.m., Mark Michelson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/3363/
> -----------------------------------------------------------
> 
> (Updated March 15, 2014, 6:34 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Repository: testsuite
> 
> 
> Description
> -------
> 
> This introduces a new pluggable module to the Asterisk testsuite intended to assist in testing using realtime storage. The test module sets up an HTTP server on port 8000 and services requests Asterisk makes using its res_config_curl realtime backend. The actual data is stored in memory in python using simple dictionaries and lists. The test module configuration allows for data to be preloaded into python before Asterisk is started so that Asterisk may retrieve realtime data during startup. Once AMI is connected to Asterisk, the realtime test module hands over control to a python module so that the test may be further controlled by the test writer.
> 
> Along with the module are six realtime tests, each designed to test an operation that Asterisk can attempt. The "require" operation is not tested since we currently always claim to have the proper items stored in the expected way.
> 
> There are potential improvements that could be made, such as:
> * Memoization of HTTP resources served by the test module.
> * yaml-driven test development beyond the initial population of realtime data.
> * Potentially allow for the realtime test module to be run stand-alone so that developers can have an easy realtime store to use for testing.
> 
> None of these are enough to prevent inclusion into the test suite though.
> 
> 
> Diffs
> -----
> 
>   /asterisk/trunk/tests/tests.yaml 4836 
>   /asterisk/trunk/tests/realtime/update/update.py PRE-CREATION 
>   /asterisk/trunk/tests/realtime/update/test-config.yaml PRE-CREATION 
>   /asterisk/trunk/tests/realtime/update/configs/ast1/sorcery.conf PRE-CREATION 
>   /asterisk/trunk/tests/realtime/update/configs/ast1/extconfig.conf PRE-CREATION 
>   /asterisk/trunk/tests/realtime/tests.yaml PRE-CREATION 
>   /asterisk/trunk/tests/realtime/store/test-config.yaml PRE-CREATION 
>   /asterisk/trunk/tests/realtime/store/store.py PRE-CREATION 
>   /asterisk/trunk/tests/realtime/store/configs/ast1/sorcery.conf PRE-CREATION 
>   /asterisk/trunk/tests/realtime/store/configs/ast1/extconfig.conf PRE-CREATION 
>   /asterisk/trunk/tests/realtime/static/test-config.yaml PRE-CREATION 
>   /asterisk/trunk/tests/realtime/static/static.py PRE-CREATION 
>   /asterisk/trunk/tests/realtime/static/configs/ast1/modules.conf PRE-CREATION 
>   /asterisk/trunk/tests/realtime/static/configs/ast1/extconfig.conf PRE-CREATION 
>   /asterisk/trunk/tests/realtime/single/test-config.yaml PRE-CREATION 
>   /asterisk/trunk/tests/realtime/single/single.py PRE-CREATION 
>   /asterisk/trunk/tests/realtime/single/configs/ast1/sorcery.conf PRE-CREATION 
>   /asterisk/trunk/tests/realtime/single/configs/ast1/extconfig.conf PRE-CREATION 
>   /asterisk/trunk/tests/realtime/multi/test-config.yaml PRE-CREATION 
>   /asterisk/trunk/tests/realtime/multi/multi.py PRE-CREATION 
>   /asterisk/trunk/tests/realtime/multi/configs/ast1/sorcery.conf PRE-CREATION 
>   /asterisk/trunk/tests/realtime/multi/configs/ast1/extconfig.conf PRE-CREATION 
>   /asterisk/trunk/tests/realtime/destroy/test-config.yaml PRE-CREATION 
>   /asterisk/trunk/tests/realtime/destroy/destroy.py PRE-CREATION 
>   /asterisk/trunk/tests/realtime/destroy/configs/ast1/sorcery.conf PRE-CREATION 
>   /asterisk/trunk/tests/realtime/destroy/configs/ast1/extconfig.conf PRE-CREATION 
>   /asterisk/trunk/lib/python/asterisk/realtime_test_module.py PRE-CREATION 
> 
> Diff: https://reviewboard.asterisk.org/r/3363/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Mark Michelson
> 
>

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


More information about the asterisk-dev mailing list