[asterisk-commits] Fix bouncing attended transfer tests. (testsuite[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Feb 25 17:20:31 CST 2016


Anonymous Coward #1000019 has submitted this change and it was merged.

Change subject: Fix bouncing attended transfer tests.
......................................................................


Fix bouncing attended transfer tests.

Within a bridge test, individual runs start when all channels from the
previous run have hung up.

The problem is that sometimes after all channels have hung up and we
decide to move on to the next run, we can get an Unlink event telling us
about the channels we already know to have hung up. The code, seeing
that a Bridge event has occurred, then locks onto the channel names in
that Bridge event. Subsequent events then refer to new channel names, so
the test ignores those events.

The fix here is to only attempt to learn channel names from Link events.
This way, if an Unlink occurs late, the test does not errantly lock onto
the channel names in that Unlink event.

Change-Id: Icf9cc82329ebd3774bf5aa2c4ef76217c430673f
---
M lib/python/asterisk/bridge_test_case.py
1 file changed, 6 insertions(+), 6 deletions(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  Mark Michelson: Looks good to me, approved
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, but someone else must approve



diff --git a/lib/python/asterisk/bridge_test_case.py b/lib/python/asterisk/bridge_test_case.py
index 27d34e1..9953c6b 100644
--- a/lib/python/asterisk/bridge_test_case.py
+++ b/lib/python/asterisk/bridge_test_case.py
@@ -309,13 +309,13 @@
         This event only applies to Asterisk 11 and earlier.
         """
 
-        if self.uut_alice_channel is None:
-            self.uut_alice_channel = event.get('channel1')
-            LOGGER.info('UUT Alice Channel: %s' % self.uut_alice_channel)
-        if self.uut_bob_channel is None:
-            self.uut_bob_channel = event.get('channel2')
-            LOGGER.info('UUT Bob Channel: %s' % self.uut_bob_channel)
         if event.get('bridgestate') == 'Link':
+            if self.uut_alice_channel is None:
+                self.uut_alice_channel = event.get('channel1')
+                LOGGER.info('UUT Alice Channel: %s' % self.uut_alice_channel)
+            if self.uut_bob_channel is None:
+                self.uut_bob_channel = event.get('channel2')
+                LOGGER.info('UUT Bob Channel: %s' % self.uut_bob_channel)
             LOGGER.debug("Bridge is up between %s and %s"
                          % (event.get('channel1'), event.get('channel2')))
             LOGGER.debug("Type of bridge is %s" % event.get('bridgetype'))

-- 
To view, visit https://gerrit.asterisk.org/2282
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Icf9cc82329ebd3774bf5aa2c4ef76217c430673f
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>



More information about the asterisk-commits mailing list