[Asterisk-code-review] Fix bouncing attended transfer tests. (testsuite[master])

Mark Michelson asteriskteam at digium.com
Mon Feb 22 15:52:30 CST 2016


Mark Michelson has uploaded a new change for review.

  https://gerrit.asterisk.org/2282

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(-)


  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/82/2282/1

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: newchange
Gerrit-Change-Id: Icf9cc82329ebd3774bf5aa2c4ef76217c430673f
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Mark Michelson <mmichelson at digium.com>



More information about the asterisk-code-review mailing list