[asterisk-dev] Valgrind support in Asterisk Test Suite

Scott Griepentrog sgriepentrog at digium.com
Tue Oct 22 11:04:46 CDT 2013


I see an advantage to being able to run the entire testsuite with valgrind
triggered by a command line option.  It makes it easier to do a second pass
after a test(s) passes to find out if anything is leaking.

However, it is also probable that certain tests are designed specifically
to check asterisk under valgrind, so being able to trigger it's use should
also be a yaml option.

To avoid editing all the test scripts, I would think it easiest to put the
mechanism to run valgrind in lib/python/asterisk/asterisk.py in the
asterisk.start() function.

Possibly use an Asterisk.valgrind = True flag as a trigger for adding
valgrind to the cmd arguments,. and then also later on asterisk.stop() the
valgrind output file can be checked (assuming to start it with something
like --log-file=valgrind.log).




On Tue, Oct 22, 2013 at 10:36 AM, nitesh bansal <nitesh.bansal at gmail.com>wrote:

> Sorry for the incomplete message. Here is the complete message:
>
> Hi,
>
> I started working on it. Possible options include for running Asterisk
> under valgrind:
> 1. Pass it as a command line argument:
>          It has the advantage that you don't need to modify your config
> files depending on whether you want to run Asterisk under valgrind or not.
> But downside is that you need to modify your test cases
>          to pass the command line option upstream to TestCase class.
>
> 2. Define it in a yaml file:
>       It has the advantage that existing test scripts need not be
> modified, but downside is that you need to modify the config file everytime
> you decide to run Asterisk under valgrind.
>
> I would prefer the second option, because i don't believe that it is worth
> to modify all the existing test cases.
> Your opinions are welcome.
>
> Regards,
> Nitesh Bansal
>
>
>
>
> On Tue, Oct 22, 2013 at 5:31 PM, nitesh bansal <nitesh.bansal at gmail.com>wrote:
>
>> Hi,
>>
>> I started working on it. Possible options include for running Asterisk
>> under valgrind:
>> 1. Pass it as a command line argument:
>>          It has the advantage that you don't need to modify your config
>> files depending on whether you want to run Asterisk under valgrind or not.
>> But downside is that you need to modify your test cases
>>
>> 2. Define it in a yaml file
>>
>>
>> On Mon, Oct 21, 2013 at 10:52 PM, nitesh bansal <nitesh.bansal at gmail.com>wrote:
>>
>>> Yeah,
>>>
>>> I agree something like that should be sufficient?
>>>
>>> Regards,
>>> Nitesh Bansal
>>>
>>>
>>> On Mon, Oct 21, 2013 at 10:17 PM, Scott Griepentrog <
>>> sgriepentrog at digium.com> wrote:
>>>
>>>> If it wasn't already there, or somebody doesn't  beat me too it, I was
>>>> planning on doing a simple check of the valgrind output - not to parse it
>>>> but just to detect it as having reported something amiss and then flag the
>>>> test as failed (much in the same way that a core dump detection will).
>>>>
>>>>
>>>> On Mon, Oct 21, 2013 at 3:13 PM, nitesh bansal <nitesh.bansal at gmail.com
>>>> > wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I have tracked it down in SVN and i would be happy to continue working
>>>>> on it. Paul, i have a question for you, the time when you had valgrind
>>>>> working for you, were you
>>>>>  just running asterisk under valgrind or did you write something to
>>>>> parse valgrind output?
>>>>>
>>>>> Regards,
>>>>> Nitesh Bansal
>>>>>
>>>>>
>>>>> On Mon, Oct 21, 2013 at 8:09 PM, Paul Belanger <
>>>>> paul.belanger at polybeacon.com> wrote:
>>>>>
>>>>>> On 13-10-21 01:41 PM, Scott Griepentrog wrote:
>>>>>>
>>>>>>> Sounds like a job for Scott...
>>>>>>>
>>>>>>> I for one would feel a lot happier running patches through valgrind
>>>>>>> testing
>>>>>>> before posting it up for review.
>>>>>>>
>>>>>>> I understand the need to keep it as cmd line option though so it's
>>>>>>> not run
>>>>>>> by default.
>>>>>>>
>>>>>>>  At some point in time I actually had the testsuite working with
>>>>>> valgrind, but that was a while ago.  I know Matt added support for gdb, so
>>>>>> I don't imagine it being to hard.
>>>>>>
>>>>>> --
>>>>>> Paul Belanger | PolyBeacon, Inc.
>>>>>> Jabber: paul.belanger at polybeacon.com | IRC: pabelanger (Freenode)
>>>>>> Github: https://github.com/pabelanger | Twitter:
>>>>>> https://twitter.com/pabelanger
>>>>>>
>>>>>>
>>>>>> --
>>>>>> ______________________________**______________________________**
>>>>>> _________
>>>>>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>>>>>
>>>>>> asterisk-dev mailing list
>>>>>> To UNSUBSCRIBE or update options visit:
>>>>>>   http://lists.digium.com/**mailman/listinfo/asterisk-dev<http://lists.digium.com/mailman/listinfo/asterisk-dev>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> _____________________________________________________________________
>>>>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>>>>
>>>>> asterisk-dev mailing list
>>>>> To UNSUBSCRIBE or update options visit:
>>>>>    http://lists.digium.com/mailman/listinfo/asterisk-dev
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> [image: Digium logo]
>>>> *Scott Griepentrog*
>>>> Digium, Inc · Software Developer
>>>> 445 Jan Davis Drive NW · Huntsville, AL 35806 · US
>>>> direct/fax: +1 256 428 6239 · mobile: +1 317 507 4029
>>>> Check us out at: http://digium.com <http://www.digium.com> ·
>>>> http://asterisk.org <http://www.asterisk.org>
>>>>
>>>> --
>>>> _____________________________________________________________________
>>>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>>>
>>>> asterisk-dev mailing list
>>>> To UNSUBSCRIBE or update options visit:
>>>>    http://lists.digium.com/mailman/listinfo/asterisk-dev
>>>>
>>>
>>>
>>
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev
>



-- 
[image: Digium logo]
*Scott Griepentrog*
Digium, Inc · Software Developer
445 Jan Davis Drive NW · Huntsville, AL 35806 · US
direct/fax: +1 256 428 6239 · mobile: +1 317 507 4029
Check us out at: http://digium.com <http://www.digium.com> ·
http://asterisk.org <http://www.asterisk.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20131022/adf39f8d/attachment-0001.html>


More information about the asterisk-dev mailing list