[asterisk-dev] [Code Review]: Add SIP INFO DTMF test to the Asterisk Test Suite
Matt Jordan
reviewboard at asterisk.org
Thu Feb 9 09:53:44 CST 2012
> On Feb. 9, 2012, 9:21 a.m., Paul Belanger wrote:
> > /asterisk/trunk/tests/channels/SIP/info_dtmf/run-test, line 43
> > <https://reviewboard.asterisk.org/r/1723/diff/4/?file=24028#file24028line43>
> >
> > redundant
>
> Matt Jordan wrote:
> No, its not. TestCase sets passed to False in its constructor.
>
> Paul Belanger wrote:
> Hmm, wouldn't we want to default the test to fail and explicitly have the test conditions change it to pass? My only concern is if we default to passed = True, and for whatever reason the test fails to execute properly, there maybe a chance the testsuite does not flag it as a failed test. And we would never know there is a problem.
That's not a problem in this case. In this particular case, it felt cleaner to determine if the test fails, rather then to determine if the test succeeds. In all cases in which we detect that the test fails and we stop the reactor prematurely, we explicitly set the passed result to False. In the case in which the test times out and we don't detect a pass/fail (which would occur if we don't receive all of the expected DTMF events), we check to see if the received DTMF events matches the expected DTMF events. If we didn't receive the correct number of DTMF events, we fail the test. If the sequence of received events is out of order, we fail the test.
If the test timed out but we actually still received all of the expected DTMF events in the expected order, then I would not consider that a failure: all of the INFO messages were sent and Asterisk turned them into DTMF events.
- Matt
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1723/#review5451
-----------------------------------------------------------
On Feb. 9, 2012, 9:15 a.m., Matt Jordan wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1723/
> -----------------------------------------------------------
>
> (Updated Feb. 9, 2012, 9:15 a.m.)
>
>
> Review request for Asterisk Developers.
>
>
> Summary
> -------
>
> This adds a test to the Asterisk Test Suite to cover the regression that was introduced in ASTERISK-18924. This test sends a sequence of SIP INFO requests containing DTMF events covering 0-9, A-D, a-d, and 10-16. This checks only for SIP INFO requests that have a Content-Type of application/dtmf-relay; the test could be expanded to cover the less used Content-Type of application/dtmf if we feel its necessary.
>
>
> This addresses bug ASTERISK-19290.
> https://issues.asterisk.org/jira/browse/ASTERISK-19290
>
>
> Diffs
> -----
>
> /asterisk/trunk/tests/channels/SIP/info_dtmf/configs/ast1/extensions.conf PRE-CREATION
> /asterisk/trunk/tests/channels/SIP/info_dtmf/configs/ast1/sip.conf PRE-CREATION
> /asterisk/trunk/tests/channels/SIP/info_dtmf/run-test PRE-CREATION
> /asterisk/trunk/tests/channels/SIP/info_dtmf/sipp/dtmf-relay.xml PRE-CREATION
> /asterisk/trunk/tests/channels/SIP/info_dtmf/sipp/dtmf.xml PRE-CREATION
> /asterisk/trunk/tests/channels/SIP/info_dtmf/test-config.yaml PRE-CREATION
> /asterisk/trunk/tests/channels/SIP/tests.yaml 3027
>
> Diff: https://reviewboard.asterisk.org/r/1723/diff
>
>
> Testing
> -------
>
>
> Thanks,
>
> Matt
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20120209/a578706d/attachment-0001.htm>
More information about the asterisk-dev
mailing list