<p>Jenkins2 <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/6064">View Change</a></p><div style="white-space:pre-wrap">Approvals:
George Joseph: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved
Jenkins2: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">tests/apps/voicemail: Speed up tests<br><br>apps/voicemail/authenticate_extensions:<br>apps/voicemail/authenticate_invalid_mailbox:<br>apps/voicemail/authenticate_invalid_password:<br>apps/voicemail/authenticate_nominal:<br><br>Put '#' at end of mailbox and password to shave off time from the test<br>time. The '#' tells voicemail we are done sending digits so it doesn't<br>have to wait two seconds for each prompt for more digits that are not<br>coming.<br><br>Change-Id: Ia34abf359f018cce3e5de4c075f241bc9e5b5767<br>---<br>M tests/apps/voicemail/authenticate_extensions/run-test<br>M tests/apps/voicemail/authenticate_invalid_mailbox/run-test<br>M tests/apps/voicemail/authenticate_invalid_password/run-test<br>M tests/apps/voicemail/authenticate_nominal/run-test<br>4 files changed, 30 insertions(+), 19 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/tests/apps/voicemail/authenticate_extensions/run-test b/tests/apps/voicemail/authenticate_extensions/run-test<br>index 7f02556..602da32 100755<br>--- a/tests/apps/voicemail/authenticate_extensions/run-test<br>+++ b/tests/apps/voicemail/authenticate_extensions/run-test<br>@@ -35,14 +35,14 @@<br> if state == 'PLAYBACK':<br> message = event.get('message')<br> if message == 'vm-login':<br>- self.voice_mail_test.send_dtmf("1234")<br>+ self.voice_mail_test.send_dtmf("1234#")<br>+ self.voice_mail_test.reset_timeout()<br> elif message == 'vm-password':<br> """<br> Instead of sending a password, ask to be transferred to the<br> attendant extension<br> """<br>- self.voice_mail_test.send_dtmf("*")<br>- self.voice_mail_test.reset_timeout()<br>+ self.voice_mail_test.send_dtmf("*#")<br> elif message == 'vm-incorrect-mailbox':<br> logger.warn("We failed to pass a valid mailbox - failing the test")<br> self.voice_mail_test.passed = False<br>@@ -74,7 +74,7 @@<br> message = event.get('message')<br> if message == 'vm-login':<br> """ Don't login - just ask to be transferred """<br>- self.voice_mail_test.send_dtmf("*")<br>+ self.voice_mail_test.send_dtmf("*#")<br> self.voice_mail_test.reset_timeout()<br> elif message == 'vm-password':<br> logger.warn("We were asked a password instead of being transferred - failing the test")<br>diff --git a/tests/apps/voicemail/authenticate_invalid_mailbox/run-test b/tests/apps/voicemail/authenticate_invalid_mailbox/run-test<br>index 6b9a6ac..17095be 100755<br>--- a/tests/apps/voicemail/authenticate_invalid_mailbox/run-test<br>+++ b/tests/apps/voicemail/authenticate_invalid_mailbox/run-test<br>@@ -36,14 +36,15 @@<br> if state == 'PLAYBACK':<br> message = event.get('message')<br> if message == 'vm-login' or message == 'vm-incorrect-mailbox':<br>- self.voice_mail_test.send_dtmf("5555")<br>+ self.voice_mail_test.send_dtmf("5678#")<br> self.voice_mail_test.reset_timeout()<br> self.login_attempts += 1<br>- if (self.login_attempts == 3):<br>- logger.info("Failed to login 3 times - setting test result to Pass")<br>- self.voice_mail_test.passed = True<br> elif message == 'vm-password':<br>- self.voice_mail_test.send_dtmf("1234")<br>+ self.voice_mail_test.send_dtmf("1234#")<br>+ elif message == 'vm-incorrect':<br>+ if (self.login_attempts == 3):<br>+ logger.info("Good, mailbox and password didn't login after 3 tries")<br>+ self.voice_mail_test.passed = True<br> elif message == 'vm-goodbye':<br> self.voice_mail_test.hangup()<br> else:<br>diff --git a/tests/apps/voicemail/authenticate_invalid_password/run-test b/tests/apps/voicemail/authenticate_invalid_password/run-test<br>index a8951c3..ec389b9 100755<br>--- a/tests/apps/voicemail/authenticate_invalid_password/run-test<br>+++ b/tests/apps/voicemail/authenticate_invalid_password/run-test<br>@@ -29,22 +29,27 @@<br> <br> def __init__(self, controller, voiceMailTest):<br> VoiceMailState.__init__(self, controller, voiceMailTest)<br>+ self.login_attempts = 0<br> <br> def handle_state_change(self, ami, event):<br> state = event['state']<br> if state == 'PLAYBACK':<br> message = event.get('message')<br> if message == 'vm-login' or message == 'vm-incorrect-mailbox':<br>- self.voice_mail_test.send_dtmf("1234")<br>- elif message == 'vm-password':<br>- self.voice_mail_test.send_dtmf("5555")<br>+ self.voice_mail_test.send_dtmf("1234#")<br> self.voice_mail_test.reset_timeout()<br>+ self.login_attempts += 1<br>+ elif message == 'vm-password':<br>+ self.voice_mail_test.send_dtmf("5555#")<br>+ elif message == 'vm-incorrect':<br>+ if (self.login_attempts == 3):<br>+ logger.info("Good, mailbox and password didn't login after 3 tries")<br> elif message == 'vm-goodbye':<br> self.voice_mail_test.hangup()<br> else:<br> self.handle_default_state(event)<br> elif state == 'AUTHENTICATED':<br>- logger.warn("We authenticated with an invalid mailbox - failing the test")<br>+ logger.warn("We authenticated with an invalid password - failing the test")<br> self.voice_mail_test.passed = False<br> self.voice_mail_test.stop_reactor()<br> else:<br>@@ -61,20 +66,25 @@<br> <br> def __init__(self, controller, voiceMailTest):<br> VoiceMailState.__init__(self, controller, voiceMailTest)<br>+ self.login_attempts = 0<br> <br> def handle_state_change(self, ami, event):<br> state = event['state']<br> if state == 'PLAYBACK':<br> message = event.get('message')<br> if message == 'vm-password':<br>- self.voice_mail_test.send_dtmf("5555")<br>+ self.voice_mail_test.send_dtmf("5555#")<br> self.voice_mail_test.reset_timeout()<br>+ self.login_attempts += 1<br>+ elif message == 'vm-incorrect':<br>+ if (self.login_attempts == 3):<br>+ logger.info("Good, just password didn't login after 3 tries")<br> elif message == 'vm-goodbye':<br> self.voice_mail_test.hangup()<br> else:<br> self.handle_default_state(event)<br> elif state == 'AUTHENTICATED':<br>- logger.warn("We authenticated with an invalid mailbox - failing the test")<br>+ logger.warn("We authenticated with an invalid password - failing the test")<br> self.voice_mail_test.passed = False<br> self.voice_mail_test.stop_reactor()<br> else:<br>diff --git a/tests/apps/voicemail/authenticate_nominal/run-test b/tests/apps/voicemail/authenticate_nominal/run-test<br>index dba79da..49b182f 100755<br>--- a/tests/apps/voicemail/authenticate_nominal/run-test<br>+++ b/tests/apps/voicemail/authenticate_nominal/run-test<br>@@ -37,10 +37,10 @@<br> if state == 'PLAYBACK':<br> message = event.get('message')<br> if message == 'vm-login':<br>- self.voice_mail_test.send_dtmf(self.mailbox)<br>- elif message == 'vm-password':<br>- self.voice_mail_test.send_dtmf(self.password)<br>+ self.voice_mail_test.send_dtmf(self.mailbox + "#")<br> self.voice_mail_test.reset_timeout()<br>+ elif message == 'vm-password':<br>+ self.voice_mail_test.send_dtmf(self.password + "#")<br> elif message == 'vm-incorrect-mailbox':<br> logger.warn("Failed to authenticate properly, failing test")<br> self.voice_mail_test.passed = False<br>@@ -74,7 +74,7 @@<br> if state == 'PLAYBACK':<br> message = event.get('message')<br> if message == 'vm-password':<br>- self.voice_mail_test.send_dtmf(self.password)<br>+ self.voice_mail_test.send_dtmf(self.password + "#")<br> self.voice_mail_test.reset_timeout()<br> elif message == 'vm-incorrect-mailbox' or message == 'vm-incorrect':<br> logger.warn("Failed to authenticate properly, failing test")<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6064">change 6064</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/6064"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: testsuite </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: Ia34abf359f018cce3e5de4c075f241bc9e5b5767 </div>
<div style="display:none"> Gerrit-Change-Number: 6064 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>