Review Board 1.7.16


Tests for new AMI Bridging commands

Review Request #2975 - Created Oct. 29, 2013 and updated

Scott Griepentrog
12, trunk
ASTERISK-22356
Reviewers
asterisk-dev
mjordan
testsuite
Test proving basic functionality of new AMI commands added in https://reviewboard.asterisk.org/r/2973/

Also: disabled failing bridge_actions test.

 
Total:
3
Open:
3
Resolved:
0
Dropped:
0
Status:
From:
Posted (Nov. 5, 2013, 4:19 p.m.)

   

  
Whoops - I didn't write this :-)
/asterisk/trunk/tests/manager/bridge/destroy/manage_bridge.py (Diff revision 1)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
So, a large chunk of this is exactly the same from test to test. For the most part, the part of this that is not the same between tests deals with what specific AMI action is executed once the channels that have been Originated are Bridged.

I'd suggest modifying this by doing the following:

(1) Refactor out the common code into a single pluggable module. It should spawn the channels, wait for them to hangup, and end the test. This python file can be stored in the lib/python/asterisk directory. It could go into either the BridgeTestCase module, or into a new, separate module bridge.py.

This class should have a single virtual method that is called from _bridge_enter_handler when len(self.bridge_channel[bridgeid]) == 2. This individual tests will provide an implementation of that function.

(2) Each individual test should derive a class from BridgeFeature that only implements the specific function. That function should execute the AMI action.

I fully expect that this won't cover *all* of the tests in here, but I think we should strive to minimize the amount of duplicate code here and provide some basic functionality that is useful for any AMI action that manipulates a bridge.
So... I ended up fixing the bridge_actions test :-)  It's rather poorly named - it actually verifies the BridgeInfo and BridgeList AMI actions.

You can, after you've committed this, move that test under your bridge directory.

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.