[asterisk-dev] [Code Review] 4090: testsuite: add basic valgrind support

Corey Farrell reviewboard at asterisk.org
Tue Nov 18 09:51:54 CST 2014



> On Nov. 18, 2014, 9:18 a.m., Corey Farrell wrote:
> > Please discard my findings, they are minor.  I'd like to see this committed ASAP so further improvements can be made against it.
> 
> Scott Griepentrog wrote:
>     I like your idea of adding an option to pass valgrind options, but it needs to first be set to write logs to the appropriate run_x/asty directory so there isn't a conflict between multiple asterisk instances.  Then a simple parser added to check the log for critical issues that trigger a test failure, which then get included in the test results, even if in an abbreviated form.  Not sure how best to pass leak info other than just leaving it in the log though.

Upon further thought, I'm not sure it's desirable to be able to add options through the command-line.  "Extra options read from ~/.valgrindrc, $VALGRIND_OPTS, ./.valgrindrc".  So I think in most cases it would be best for people to create ./.valgrindrc.  Maybe we can add that to svn:ignore for '.'.  But as you said, getting the logs to run_x/asty dirs is more important.  Once this change is submitted I will look at putting the logs in the appropriate dir.

As for parsing the test results, I think this would require using --xml-file=, then using libxml and/or libxslt (through python, sorry I don't know the modules for this).  Anything we do to parse the text-based valgrind output will be a fragile hack.


- Corey


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


On Nov. 18, 2014, 10:49 a.m., Scott Griepentrog wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/4090/
> -----------------------------------------------------------
> 
> (Updated Nov. 18, 2014, 10:49 a.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Repository: testsuite
> 
> 
> Description
> -------
> 
> This adds very basic valgrind support, which is convenient for manual test runs but does not (yet) include support for more automated valgrind usage. 
> 
> 1) CLI flag '-V' enables valgrind (./runtests -V -t tests/test)
> 
> 2) Minimal changes to testsuite, other improvements can be added later if desired
> 
> 3) Valgrind output is picked up by error logging and shown after test run.
> 
> 4) Unlike previous valgrind attempt, this one works fine on tests with multiple asterisk instances
> 
> 
> Diffs
> -----
> 
>   /asterisk/trunk/runtests.py 5733 
>   /asterisk/trunk/lib/python/asterisk/test_case.py 5733 
>   /asterisk/trunk/lib/python/asterisk/asterisk.py 5733 
> 
> Diff: https://reviewboard.asterisk.org/r/4090/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Scott Griepentrog
> 
>

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


More information about the asterisk-dev mailing list