[asterisk-dev] [Code Review]: Rework the leave_voicemail_contexts test
Matt Jordan
reviewboard at asterisk.org
Thu May 3 10:10:27 CDT 2012
> On May 3, 2012, 9:51 a.m., Mark Michelson wrote:
> > /asterisk/trunk/tests/apps/voicemail/leave_voicemail_contexts/run-test, lines 83-99
> > <https://reviewboard.asterisk.org/r/1893/diff/2/?file=27624#file27624line83>
> >
> > It appears that you have a potential race condition here. Say, for instance, that the ami with id 0 calls back into ami_connect() first (meaning you set self.amiReceiver). In the latter part of the method, you create a test controller and then call self.execute_test(). self.execute_test() immediately starts trying to use self.amiSender, which may not have been set yet.
> >
> > Is there something I'm not seeing here that makes sure that both self.amiSender and self.amiReceiver have been set before self.execute_test() gets called?
Yes - self.createTestController() won't create the testStateController if either self.amiSender or self.amiReceiver are None. That prevents the case where one of the AMI events starts the test before the other is received.
All that stuff is handled down in the VoiceMailTest class.
- Matt
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1893/#review6139
-----------------------------------------------------------
On May 1, 2012, 4:32 p.m., Matt Jordan wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1893/
> -----------------------------------------------------------
>
> (Updated May 1, 2012, 4:32 p.m.)
>
>
> Review request for Asterisk Developers.
>
>
> Summary
> -------
>
> This reworks the leave_voicemail_contexts test to:
> 1) Use the TEST_FRAMEWORK and test events to control the test, as opposed to a lot of Wait() statements
> 2) Actually test valid extensions that VoiceMail has a hope and a prayer of bouncing a user out to
> 3) Test the conditions that currently fail in Asterisk, namely the d(context) option failing if the extension the user attempts to go to does not exist in the current dialplan context.
>
> This review being checked in is contingent on review 1892 being approved.
>
>
> This addresses bug ASTERISK-18243.
> https://issues.asterisk.org/jira/browse/ASTERISK-18243
>
>
> Diffs
> -----
>
> /asterisk/trunk/tests/apps/voicemail/leave_voicemail_contexts/test-config.yaml 3212
> /asterisk/trunk/tests/apps/voicemail/leave_voicemail_contexts/configs/ast1/extensions.conf 3212
> /asterisk/trunk/tests/apps/voicemail/leave_voicemail_contexts/configs/ast1/voicemail.conf 3212
> /asterisk/trunk/tests/apps/voicemail/leave_voicemail_contexts/configs/ast2/extensions.conf 3212
> /asterisk/trunk/tests/apps/voicemail/leave_voicemail_contexts/run-test 3212
>
> Diff: https://reviewboard.asterisk.org/r/1893/diff
>
>
> Testing
> -------
>
>
> Thanks,
>
> Matt
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20120503/3a6b1b26/attachment.htm>
More information about the asterisk-dev
mailing list