[asterisk-commits] mjordan: testsuite/asterisk/trunk r2093 - in /asterisk/trunk/tests/apps/voice...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Sep 8 06:33:19 CDT 2011


Author: mjordan
Date: Thu Sep  8 06:33:15 2011
New Revision: 2093

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=2093
Log:
Added nominal voicemail tests

The following tests that check nominal execution of voicemail applications were
added: func_vmcount, check_voicemail_nominal, check_voicemail_new_user, and
authenticate_nominal.  The test leave_voicemail_nominal was updated.

Added:
    asterisk/trunk/tests/apps/voicemail/authenticate_nominal/
      - copied from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/authenticate_nominal/
    asterisk/trunk/tests/apps/voicemail/authenticate_nominal/configs/
      - copied from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/authenticate_nominal/configs/
    asterisk/trunk/tests/apps/voicemail/authenticate_nominal/configs/ast1/
      - copied from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/authenticate_nominal/configs/ast1/
    asterisk/trunk/tests/apps/voicemail/authenticate_nominal/configs/ast1/extensions.conf
      - copied unchanged from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/authenticate_nominal/configs/ast1/extensions.conf
    asterisk/trunk/tests/apps/voicemail/authenticate_nominal/configs/ast1/sip.conf
      - copied unchanged from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/authenticate_nominal/configs/ast1/sip.conf
    asterisk/trunk/tests/apps/voicemail/authenticate_nominal/configs/ast1/voicemail.conf
      - copied unchanged from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/authenticate_nominal/configs/ast1/voicemail.conf
    asterisk/trunk/tests/apps/voicemail/authenticate_nominal/configs/ast2/
      - copied from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/authenticate_nominal/configs/ast2/
    asterisk/trunk/tests/apps/voicemail/authenticate_nominal/configs/ast2/extensions.conf
      - copied unchanged from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/authenticate_nominal/configs/ast2/extensions.conf
    asterisk/trunk/tests/apps/voicemail/authenticate_nominal/configs/ast2/sip.conf
      - copied unchanged from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/authenticate_nominal/configs/ast2/sip.conf
    asterisk/trunk/tests/apps/voicemail/authenticate_nominal/run-test
      - copied unchanged from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/authenticate_nominal/run-test
    asterisk/trunk/tests/apps/voicemail/authenticate_nominal/test-config.yaml
      - copied unchanged from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/authenticate_nominal/test-config.yaml
    asterisk/trunk/tests/apps/voicemail/check_voicemail_new_user/
      - copied from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_new_user/
    asterisk/trunk/tests/apps/voicemail/check_voicemail_new_user/configs/
      - copied from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_new_user/configs/
    asterisk/trunk/tests/apps/voicemail/check_voicemail_new_user/configs/ast1/
      - copied from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_new_user/configs/ast1/
    asterisk/trunk/tests/apps/voicemail/check_voicemail_new_user/configs/ast1/extensions.conf
      - copied unchanged from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_new_user/configs/ast1/extensions.conf
    asterisk/trunk/tests/apps/voicemail/check_voicemail_new_user/configs/ast1/sip.conf
      - copied unchanged from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_new_user/configs/ast1/sip.conf
    asterisk/trunk/tests/apps/voicemail/check_voicemail_new_user/configs/ast1/voicemail.conf
      - copied unchanged from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_new_user/configs/ast1/voicemail.conf
    asterisk/trunk/tests/apps/voicemail/check_voicemail_new_user/configs/ast2/
      - copied from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_new_user/configs/ast2/
    asterisk/trunk/tests/apps/voicemail/check_voicemail_new_user/configs/ast2/extensions.conf
      - copied unchanged from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_new_user/configs/ast2/extensions.conf
    asterisk/trunk/tests/apps/voicemail/check_voicemail_new_user/configs/ast2/sip.conf
      - copied unchanged from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_new_user/configs/ast2/sip.conf
    asterisk/trunk/tests/apps/voicemail/check_voicemail_new_user/run-test
      - copied unchanged from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_new_user/run-test
    asterisk/trunk/tests/apps/voicemail/check_voicemail_new_user/test-config.yaml
      - copied unchanged from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_new_user/test-config.yaml
    asterisk/trunk/tests/apps/voicemail/check_voicemail_nominal/
      - copied from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_nominal/
    asterisk/trunk/tests/apps/voicemail/check_voicemail_nominal/configs/
      - copied from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_nominal/configs/
    asterisk/trunk/tests/apps/voicemail/check_voicemail_nominal/configs/ast1/
      - copied from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_nominal/configs/ast1/
    asterisk/trunk/tests/apps/voicemail/check_voicemail_nominal/configs/ast1/extensions.conf
      - copied unchanged from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_nominal/configs/ast1/extensions.conf
    asterisk/trunk/tests/apps/voicemail/check_voicemail_nominal/configs/ast1/sip.conf
      - copied unchanged from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_nominal/configs/ast1/sip.conf
    asterisk/trunk/tests/apps/voicemail/check_voicemail_nominal/configs/ast1/voicemail.conf
      - copied unchanged from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_nominal/configs/ast1/voicemail.conf
    asterisk/trunk/tests/apps/voicemail/check_voicemail_nominal/configs/ast2/
      - copied from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_nominal/configs/ast2/
    asterisk/trunk/tests/apps/voicemail/check_voicemail_nominal/configs/ast2/extensions.conf
      - copied unchanged from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_nominal/configs/ast2/extensions.conf
    asterisk/trunk/tests/apps/voicemail/check_voicemail_nominal/configs/ast2/sip.conf
      - copied unchanged from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_nominal/configs/ast2/sip.conf
    asterisk/trunk/tests/apps/voicemail/check_voicemail_nominal/run-test
      - copied unchanged from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_nominal/run-test
    asterisk/trunk/tests/apps/voicemail/check_voicemail_nominal/test-config.yaml
      - copied unchanged from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_nominal/test-config.yaml
    asterisk/trunk/tests/apps/voicemail/func_vmcount/
      - copied from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/func_vmcount/
    asterisk/trunk/tests/apps/voicemail/func_vmcount/configs/
      - copied from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/func_vmcount/configs/
    asterisk/trunk/tests/apps/voicemail/func_vmcount/configs/ast1/
      - copied from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/func_vmcount/configs/ast1/
    asterisk/trunk/tests/apps/voicemail/func_vmcount/configs/ast1/extensions.conf
      - copied unchanged from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/func_vmcount/configs/ast1/extensions.conf
    asterisk/trunk/tests/apps/voicemail/func_vmcount/configs/ast1/voicemail.conf
      - copied unchanged from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/func_vmcount/configs/ast1/voicemail.conf
    asterisk/trunk/tests/apps/voicemail/func_vmcount/run-test
      - copied unchanged from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/func_vmcount/run-test
    asterisk/trunk/tests/apps/voicemail/func_vmcount/test-config.yaml
      - copied unchanged from r2091, asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/func_vmcount/test-config.yaml
Modified:
    asterisk/trunk/tests/apps/voicemail/leave_voicemail_nominal/configs/ast1/extensions.conf
    asterisk/trunk/tests/apps/voicemail/leave_voicemail_nominal/configs/ast2/extensions.conf
    asterisk/trunk/tests/apps/voicemail/leave_voicemail_nominal/run-test
    asterisk/trunk/tests/apps/voicemail/leave_voicemail_nominal/test-config.yaml

Modified: asterisk/trunk/tests/apps/voicemail/leave_voicemail_nominal/configs/ast1/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/apps/voicemail/leave_voicemail_nominal/configs/ast1/extensions.conf?view=diff&rev=2093&r1=2092&r2=2093
==============================================================================
--- asterisk/trunk/tests/apps/voicemail/leave_voicemail_nominal/configs/ast1/extensions.conf (original)
+++ asterisk/trunk/tests/apps/voicemail/leave_voicemail_nominal/configs/ast1/extensions.conf Thu Sep  8 06:33:15 2011
@@ -11,9 +11,11 @@
     same => n,VoiceMail(1234 at default,u)
     same => n,GotoIf($[${VMSTATUS} = SUCCESS]?pass:fail)
     same => n(fail),UserEvent(TestResult,result: fail, status: VoiceMail failed to exit successfully - returned ${VMSTATUS})
+    same => n,Wait(2)
     same => n,Hangup()
     same => n(pass),NoOp()
     same => n,UserEvent(TestResult,result: pass, status: VoiceMail exited successfully)
+    same => n,Wait(2)
     same => n,Hangup()
 
 ;
@@ -23,9 +25,11 @@
     same => n,VoiceMail(5678 at default,b)
     same => n,GotoIf($[${VMSTATUS} = SUCCESS]?pass:fail)
     same => n(fail),UserEvent(TestResult,result: fail, status: VoiceMail failed to exit successfully - returned ${VMSTATUS})
+    same => n,Wait(2)
     same => n,Hangup()
     same => n(pass),NoOp()
     same => n,UserEvent(TestResult,result: pass, status: VoiceMail exited successfully)
+    same => n,Wait(2)
     same => n,Hangup()
 
 ;
@@ -36,9 +40,11 @@
     same => n,VoiceMail(1234 at notdefault)
     same => n,GotoIf($[${VMSTATUS} = SUCCESS]?pass:fail)
     same => n(fail),UserEvent(TestResult,result: fail, status: VoiceMail failed to exit successfully - returned ${VMSTATUS})
+    same => n,Wait(2)
     same => n,Hangup()
     same => n(pass),NoOp()
     same => n,UserEvent(TestResult,result: pass, status: VoiceMail exited successfully)
+    same => n,Wait(2)
     same => n,Hangup()
 
 exten => o,1,UserEvent(TestResult,result: fail,status: failed to exit successfully through '#' key)

Modified: asterisk/trunk/tests/apps/voicemail/leave_voicemail_nominal/configs/ast2/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/apps/voicemail/leave_voicemail_nominal/configs/ast2/extensions.conf?view=diff&rev=2093&r1=2092&r2=2093
==============================================================================
--- asterisk/trunk/tests/apps/voicemail/leave_voicemail_nominal/configs/ast2/extensions.conf (original)
+++ asterisk/trunk/tests/apps/voicemail/leave_voicemail_nominal/configs/ast2/extensions.conf Thu Sep  8 06:33:15 2011
@@ -19,6 +19,9 @@
     same => n,Verbose(1, Playing back ${TALK_AUDIO})
     same => n,Playback(${TALK_AUDIO})
     same => n,Verbose(1, Hanging up Abruptly)
+    same => n,Wait(1)
+    same => n,UserEvent(TestResult,result: pass, status: VoiceMail exited successfully)
+    same => n,Wait(2)
     same => n,Hangup()
 
 exten => 9000,1,NoOp()

Modified: asterisk/trunk/tests/apps/voicemail/leave_voicemail_nominal/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/apps/voicemail/leave_voicemail_nominal/run-test?view=diff&rev=2093&r1=2092&r2=2093
==============================================================================
--- asterisk/trunk/tests/apps/voicemail/leave_voicemail_nominal/run-test (original)
+++ asterisk/trunk/tests/apps/voicemail/leave_voicemail_nominal/run-test Thu Sep  8 06:33:15 2011
@@ -10,10 +10,8 @@
 
 import sys
 import os
-import datetime
 import logging
 
-from datetime import datetime
 from twisted.internet import reactor
 
 sys.path.append("lib/python")
@@ -32,13 +30,12 @@
     testParentDir = "tests/apps/voicemail"
 
     def __init__(self):
-        TestCase.__init__(self)
-
+        super(LeaveVoicemailNominal, self).__init__()
+        self.testResultsReceived = 0
         self.create_asterisk(2)
 
     def ami_connect(self, ami):
-        logger.info("Got AMI Connect for instance " + str(ami.id))
-        TestCase.ami_connect(self, ami)
+        super(LeaveVoicemailNominal, self).ami_connect(ami)
 
         self.audioFile = os.path.join(os.getcwd(), "%s/sounds/talking" % (self.testParentDir))
 
@@ -49,21 +46,15 @@
 
             extensions = [1234,1234,5678,5678,9000]
             for extension in extensions:
-                logger.debug("Originating call to sip/ast1/" + str(extension))
+                logger.info("Originating call to sip/ast1/" + str(extension))
                 df = ami.originate("sip/ast1/" + str(extension), "sendvoicemail", str(extension), 1, None, "CallId-" + str(extension), None, None, None, {}, True )
                 df.addErrback(self.handleOriginateFailure)
-
-    def handleOriginateFailure(self, reason):
-        logger.error("Error sending originate:")
-        logger.error(reason.getTraceback())
-        self.stop_reactor()
-
-        return reason
 
     def user_event(self, ami, event):
         if event['userevent'] != 'TestResult':
             return
 
+        self.testResultsReceived += 1
         if event['result'] == "pass":
             self.passed = True
             logger.info("VoiceMail successfully exited")
@@ -72,11 +63,12 @@
             logger.warn("result: %s" % (event['result'],))
             logger.warn("error: %s" % (event['error'],))
 
-        self.stop_reactor()
-
+        if self.testResultsReceived == 5:
+            logger.debug("All results received; stopping reactor")
+            self.stop_reactor()
 
     def run(self):
-        TestCase.run(self)
+        super(LeaveVoicemailNominal, self).run()
         self.create_ami_factory(2)
 
 

Modified: asterisk/trunk/tests/apps/voicemail/leave_voicemail_nominal/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/apps/voicemail/leave_voicemail_nominal/test-config.yaml?view=diff&rev=2093&r1=2092&r2=2093
==============================================================================
--- asterisk/trunk/tests/apps/voicemail/leave_voicemail_nominal/test-config.yaml (original)
+++ asterisk/trunk/tests/apps/voicemail/leave_voicemail_nominal/test-config.yaml Thu Sep  8 06:33:15 2011
@@ -1,5 +1,4 @@
 testinfo:
-    skip: 'Skip while failures are debugged'
     summary: 'Test nominal execution of app_voicemails VoiceMail dialplan application'
     description: |
         This test verifies proper functionality of an operator leaving a voicemail.  It verifies




More information about the asterisk-commits mailing list