[asterisk-dev] [Code Review] 3027: Valgrind support in TestSuite
Scott Griepentrog
reviewboard at asterisk.org
Thu Dec 12 13:31:02 CST 2013
> On Dec. 12, 2013, 12:56 p.m., opticron wrote:
> > /asterisk/trunk/runtests.py, lines 69-73
> > <https://reviewboard.asterisk.org/r/3027/diff/3/?file=49321#file49321line69>
> >
> > It would be a bit cleaner to use the glob module to get a list of matching paths and then get the length of the list.
While that's correct, it wouldn't then match the later algorithm searching for new directories- i.e. it would be possible although unlikely to have directories ast1 & ast9 resulting in instances=2 rather than 1. This bit of code was added to prevent re-copying (or in case of valgrind's xml files reparsing) the ast# directories from previous tests. I think it's better although ugly to leave this bit of code to match __archive_ast_logs(), although I am now reducing it to just:
while os.path.isdir("%s/ast%d" % (ast_directories, self.existing_ast_instances+1)):
self.existing_ast_instances += 1
- Scott
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3027/#review10399
-----------------------------------------------------------
On Dec. 10, 2013, 11:51 a.m., Scott Griepentrog wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/3027/
> -----------------------------------------------------------
>
> (Updated Dec. 10, 2013, 11:51 a.m.)
>
>
> Review request for Asterisk Developers.
>
>
> Repository: testsuite
>
>
> Description
> -------
>
> This patch adds support for running Asterisk under Valgrind (say: Val-Grinned) to check for all sorts of nasty runtime bugs. This started off with a post to asterisk-dev list by nitesh.bansal at gmail.com, and he wrote and contributed the initial version. So if you find this useful, be sure to thank him. Then I made extensive changes and additions, so if the code stinks, blame me.
>
> The following has been done:
>
> - Check runtests.py arguments for --valgrind and --valgrind-gensupp flags, pass via environ to TestCase.py
> - Note previously existing instances of ast# logs to insure we only process new log/xml files
> - Increase reactor timeout by x5 when valgrind enabled
> - Patch to reactor_stop() to insure it does even when exceptions occur in deferred stack
> - Add valgrind with correct arguments into executable path
> - After run, check valgrind.xml for errors, parse and condense them into something more managable
> - If -gensup mode enabled, write suppressions to logs/(test)/ast#/valgrind.supp that can be added (manually)
> - A default valgrind.supp "suppressions" file is in configs/ to prevent complaints about known unfixables
>
> Notes:
>
> - valgrind can be triggered by argument to runtests.py, export VALGRIND=true, or in test-config.yaml
> - configs/valgrind.supp will be used if found, but tests/(test)/configs/valgrind.supp will take precedence
> - valgrind-gensupp mode will create example suppressions file, during which no suppressions occur
>
>
> Diffs
> -----
>
> /asterisk/trunk/runtests.py 4350
> /asterisk/trunk/lib/python/asterisk/asterisk.py 4350
> /asterisk/trunk/lib/python/asterisk/Valgrind.py PRE-CREATION
> /asterisk/trunk/lib/python/asterisk/TestConfig.py 4350
> /asterisk/trunk/lib/python/asterisk/TestCase.py 4350
> /asterisk/trunk/configs/valgrind.supp PRE-CREATION
> /asterisk/trunk/README.txt 4350
>
> Diff: https://reviewboard.asterisk.org/r/3027/diff/
>
>
> Testing
> -------
>
> Tested on 64bit and 32bit CentOS, including low cpu power conditions. Some sporadic timing issues affecting AMI/twisted operation have been seen and will be corrected.
>
>
> Thanks,
>
> Scott Griepentrog
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20131212/77682179/attachment-0001.html>
More information about the asterisk-dev
mailing list