[asterisk-dev] [Code Review]: ConfBridge state machine tests - marked users

Matt Jordan reviewboard at asterisk.org
Mon Oct 1 15:28:48 CDT 2012



> On Oct. 1, 2012, 3 p.m., Mark Michelson wrote:
> > /asterisk/trunk/lib/python/asterisk/apptest.py, lines 30-33
> > <https://reviewboard.asterisk.org/r/2130/diff/1/?file=31392#file31392line30>
> >
> >     Typically with a singleton, the get_instance() method will create the instance if it does not already exist. Is there any chance that some place might call get_instance prior to the creation of the instance and thus fail miserably?

No, because AppTest is the Test Object in the pluggable framework, and any pluggable modules that would reference it would be loaded afterwards.

That being said, it would be nice if it could create its own instance if one doesn't exist, if for no other reasons than (a) things should follow patterns where they can, and (b) if we ever change the order of loading things, this will still 'just work' (a whole lot of other things will break, but that's a different problem).  The trick is that would require a path to the current running test, which typically isn't available to the plugged in modules.

I'll add an option to do that and make the parameters default to something so that callers in the current implementation don't have to provide anything.


> On Oct. 1, 2012, 3 p.m., Mark Michelson wrote:
> > /asterisk/trunk/sample-yaml/apptest-config.yaml.sample, line 40
> > <https://reviewboard.asterisk.org/r/2130/diff/1/?file=31393#file31393line40>
> >
> >     s/idenfity/identify/

Fixed.


- Matt


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


On Sept. 24, 2012, 7:37 p.m., Matt Jordan wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2130/
> -----------------------------------------------------------
> 
> (Updated Sept. 24, 2012, 7:37 p.m.)
> 
> 
> Review request for Asterisk Developers, Mark Michelson and Terry Wilson.
> 
> 
> Summary
> -------
> 
> Terry's patch on https://reviewboard.asterisk.org/r/2072/ addresses a fundamental problem in the initial design of ConfBridge, in that it did not adequately define or handle the interactions between Marked, Unmarked, and non-Marked users in a conference.  It fixed the various problems reported by users (in numerous ASTERISK issues) by implementing a state machine that moves the conference into various states based on the various types of users entering/leaving the conference.
> 
> Because the correct fix to these problems redoes a portion of ConfBridge, tests need to cover the functionality to (a) ensure things continue to work at least as well as they did and (b) that future changes to ConfBridge don't break the interaction behavior between users.  This patch provides the following to the Test Suite:
> 
> 1) A python module (apptest) that allows orchestrating tests inside of a long running application using a configuration driven approach.  This uses the same approach as the VoiceMail tests and the existing two ConfBridge tests, but defers the logic of how responses to various events are handled to the YAML file.
> 
> 2) A test using this that covers the interaction of Marked users in a conference.  This covers two scenarios from a ConfBridge test plan (which will be be put up on the wiki and linked to this review later):
> 
> Marked users:
>   Conference should automatically start for marked users and those users should
>   never be in an inactive conference state.
> 
>   Actors: Marked User One
>           Marked User Two w/ Quiet flag
> 
>   Scenario:
>     Marked User One enters conference.  Marked User One is notified they have
>     entered conference.  Verify no MOH.  Marked User Two enters conference.
>     Verify no announcements played to Marked User Two.  Marked User Two leaves
>     conference.  Verify no MOH for Marked User One.  Marked User One leaves
>     conference; verify conference ends.
> 
>   Scenario:
>     Marked User Two enters conference.  Verify Marked User Two does not
>     receive notification that they have entered the conference.  Verify no MOH.
>     Marked User One enters conference.  Marked User One leaves conference.
>     Verify no MOH for Marked User Two. Marked User Two leaves conference; verify
>     conference ends.
> 
> 
> Diffs
> -----
> 
>   /asterisk/trunk/lib/python/asterisk/apptest.py PRE-CREATION 
>   /asterisk/trunk/sample-yaml/apptest-config.yaml.sample PRE-CREATION 
>   /asterisk/trunk/tests/apps/confbridge/confbridge_marked/configs/ast1/confbridge.conf PRE-CREATION 
>   /asterisk/trunk/tests/apps/confbridge/confbridge_marked/configs/ast1/extensions.conf PRE-CREATION 
>   /asterisk/trunk/tests/apps/confbridge/confbridge_marked/test-config.yaml PRE-CREATION 
>   /asterisk/trunk/lib/python/asterisk/ami.py 3437 
>   /asterisk/trunk/tests/apps/confbridge/tests.yaml 3437 
> 
> Diff: https://reviewboard.asterisk.org/r/2130/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Matt
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20121001/eb22a1a4/attachment.htm>


More information about the asterisk-dev mailing list