[asterisk-dev] Valgrind support in Asterisk Test Suite

Matthew Jordan mjordan at digium.com
Wed Oct 23 08:19:21 CDT 2013


On Wed, Oct 23, 2013 at 3:40 AM, nitesh bansal <nitesh.bansal at gmail.com>wrote:

> Hi Scott,
>
> Command line option is passed to the master script runtests.py and
> asterisk is spawned from the child script run-test, presently there isn't
> anyway of passing the argument from master script to
> child script. I'll try and figure out the best way to share data between
> these two scripts?
>
>
There's really two ways tests are executed:

(1) In the manner you just described, where a process is spawned that
executes a run-test script
(2) Using the pluggable module framework. This will execute TestRunner,
which will - based on the YAML - construct the objects in the test and run
them

For tests that use the second approach, passing a new command line
parameter is trivial - the only thing that gets updated is TestRunner.
However, the first approach is problematic. As Paul's commit that removed
valgrind noted, the problem with command line parameters is that they
impact every run-test in the testsuite - which can also cross language
boundaries as well (there are still some lua tests in the testsuite).

I'd recommend against command line parameters for that reason. If you make
the usage of valgrind configured via the YAML, then - for the most part -
all you'll have to do is update TestConfig to parse the option; TestCase to
make use of the option and pass it to Asterisk (the library); and Asterisk
(library) to spawn valgrind with Asterisk as opposed to Asterisk directly.
That will capture a good 80% of the tests in the TestSuite, without having
to modify any of them.

Matt

-- 
Matthew Jordan
Digium, Inc. | Engineering Manager
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com & http://asterisk.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20131023/572f1c2c/attachment.html>


More information about the asterisk-dev mailing list