[Asterisk-code-review] confbridge recording: test can fail due to late CONF START R... (testsuite[16])

Kevin Harwell asteriskteam at digium.com
Tue Sep 18 12:05:15 CDT 2018


Kevin Harwell has uploaded this change for review. ( https://gerrit.asterisk.org/10181


Change subject: confbridge_recording: test can fail due to late CONF_START_RECORD event
......................................................................

confbridge_recording: test can fail due to late CONF_START_RECORD event

The test is set to change from a "start" state to an "active" state once the
channel joins the confbridge. The test also expects the CONF_START_RECORD event
to be in the "start" state, but if the channel joins the confbridge first, the
state changes and the event arrives in the "active" state.

That being the case this patch makes it so the CONF_START_RECORD event is also
checked for in the "active" state since it doesn't care when it arrives just
if it does.

Change-Id: If76b4613b79fdc60ebd4fe48a144de6b556bfb79
---
M tests/apps/confbridge/confbridge_recording/run-test
1 file changed, 8 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/81/10181/1

diff --git a/tests/apps/confbridge/confbridge_recording/run-test b/tests/apps/confbridge/confbridge_recording/run-test
index ec4a5bb..df5ef43 100755
--- a/tests/apps/confbridge/confbridge_recording/run-test
+++ b/tests/apps/confbridge/confbridge_recording/run-test
@@ -82,7 +82,8 @@
 
         state = event['state']
         if state == 'CONF_START_RECORD':
-            logger.debug("Detected CONF_START_RECORD")
+            logger.debug("State: {0} - Detected CONF_START_RECORD".format(
+                self.get_state_name()))
             self.test_case.expected_events['recordingstarted'] = True
 
     def get_state_name(self):
@@ -126,7 +127,12 @@
         """ TestEvent handler.  Check for end of recording. """
 
         state = event['state']
-        if state == 'CONF_STOP_RECORD':
+
+        if state == 'CONF_START_RECORD':
+            logger.debug("State: {0} - Detected CONF_START_RECORD".format(
+                self.get_state_name()))
+            self.test_case.expected_events['recordingstarted'] = True
+        elif state == 'CONF_STOP_RECORD':
             logger.debug("Detected CONF_STOP_RECORD")
             self.test_case.expected_events['recordingstopped'] = True
 

-- 
To view, visit https://gerrit.asterisk.org/10181
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: testsuite
Gerrit-Branch: 16
Gerrit-MessageType: newchange
Gerrit-Change-Id: If76b4613b79fdc60ebd4fe48a144de6b556bfb79
Gerrit-Change-Number: 10181
Gerrit-PatchSet: 1
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180918/7717ad05/attachment.html>


More information about the asterisk-code-review mailing list