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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Apr 27 12:49:21 CDT 2012


Author: mjordan
Date: Fri Apr 27 12:49:17 2012
New Revision: 3211

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=3211
Log:
Undo modification to leave_voicemail_contexts test

Bad merge in the last revision.  The changes being made to this
test haven't been reviewed yet.

Modified:
    asterisk/trunk/tests/apps/voicemail/leave_voicemail_contexts/configs/ast2/extensions.conf
    asterisk/trunk/tests/apps/voicemail/leave_voicemail_contexts/run-test
    asterisk/trunk/tests/apps/voicemail/leave_voicemail_contexts/test-config.yaml

Modified: asterisk/trunk/tests/apps/voicemail/leave_voicemail_contexts/configs/ast2/extensions.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/apps/voicemail/leave_voicemail_contexts/configs/ast2/extensions.conf?view=diff&rev=3211&r1=3210&r2=3211
==============================================================================
--- asterisk/trunk/tests/apps/voicemail/leave_voicemail_contexts/configs/ast2/extensions.conf (original)
+++ asterisk/trunk/tests/apps/voicemail/leave_voicemail_contexts/configs/ast2/extensions.conf Fri Apr 27 12:49:17 2012
@@ -1,22 +1,18 @@
+; Tests exiting out of the VoiceMail application through various contexts
 
-[voicemailCaller]
+[sendvoicemail]
+exten => _XXXX,1,NoOp()
+    same => n,Wait(3)
+    same => n,Verbose(1, Sending ${DTMF_TO_SEND} key)
+    same => n,SendDTMF(${DTMF_TO_SEND})
+    same => n,Wait(10)
+    same => n,Hangup()
 
-exten => sendDTMF,1,NoOp()
-	same => n,Verbose(1, Sending DTMF Signal ${DTMF_TO_SEND})
-	same => n,SendDTMF(${DTMF_TO_SEND})
-	same => n,Goto(voicemailCaller,wait,1)
-
-exten => hangup,1,NoOp()
-	same => n,Verbose(1, Hanging up)
-	same => n,Hangup()
-
-exten => wait,1,NoOp()
-	same => n,Wait(10000)
-
-exten => sendAudioWithDTMF,1,NoOp()
-	same => n,Verbose(1, Sending audio file ${TALK_AUDIO})
-	same => n,Playback(${TALK_AUDIO})
-	same => n,Verbose(1, Sending DTMF Signal ${DTMF_TO_SEND})
-	same => n,SendDTMF(${DTMF_TO_SEND})
-	same => n,Goto(voicemailCaller,wait,1)
-
+exten => 9000,1,NoOp()
+    same => n,Wait(10)
+    same => n,Verbose(1, Playing back ${TALK_AUDIO})
+    same => n,Playback(${TALK_AUDIO})
+    same => n,Verbose(1, Sending ${DTMF_TO_SEND} key)
+    same => n,SendDTMF(${DTMF_TO_SEND})
+    same => n,Wait(10)
+    same => n,Hangup()

Modified: asterisk/trunk/tests/apps/voicemail/leave_voicemail_contexts/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/apps/voicemail/leave_voicemail_contexts/run-test?view=diff&rev=3211&r1=3210&r2=3211
==============================================================================
--- asterisk/trunk/tests/apps/voicemail/leave_voicemail_contexts/run-test (original)
+++ asterisk/trunk/tests/apps/voicemail/leave_voicemail_contexts/run-test Fri Apr 27 12:49:17 2012
@@ -19,36 +19,10 @@
 from asterisk.asterisk import Asterisk
 from asterisk.TestCase import TestCase
 from asterisk.voicemail import VoiceMailMailboxManagement
-from asterisk.voicemail import VoiceMailState
-from asterisk.voicemail import VoiceMailTest
 
 logger = logging.getLogger(__name__)
 
-class StartVoiceMailState(VoiceMailState):
-"""
-TestState that is the entry point for the VoiceMail application
-"""
-
-    def __init__(self, controller, voiceMailTest):
-        VoiceMailState.__init__(self, controller, voiceMailTest)
-
-    def handleStateChange(self, ami, event):
-        state = event['state']
-        if state == 'PLAYBACK':
-            message = event['message']
-
-            if message == 'vm-intro':
-                self.sendDTMF()
-                self.changeState(IntroVoiceMailState(self.controller, self.voiceMailTest))
-            else:
-                self.handleDefaultState(event)
-        else:
-            self.handleDefaultState(event)
-
-    def getStateName(self):
-        return "START"
-
-class LeaveVoicemailContexts(VoiceMailTest):
+class LeaveVoicemailContexts(TestCase):
 
     """
     The parent directory that this test resides in
@@ -69,43 +43,51 @@
 
         self.audioFile = os.path.join(os.getcwd(), "%s/sounds/talking" % (self.testParentDir))
 
-        # Record which AMI instance we've received and attempt to set up the test controller
-        if (ami.id == 0):
-            self.amiReceiver = ami
-            ami.registerEvent('UserEvent', self.user_event)
-        elif (ami.id == 1):
-            self.amiSender = ami
-            self.astSender = self.ast[self.amiSender.id]
-        self.createTestController()
-        if (self.testStateController != None):
-            startObject = StartVoiceMailState(self.testStateController, self)
-            self.testStateController.changeState(startObject)
+        ami.registerEvent('UserEvent', self.user_event)
+
+        self.ast[ami.id].cli_exec("dialplan set global TALK_AUDIO " + self.audioFile)
+        self.ast[ami.id].cli_exec("dialplan set global DTMF_TO_SEND 1")
+
+        logger.debug("AMI ID: " + str(ami.id))
+        if (ami.id != 0):
+            self.senderAmi = ami
             LeaveVoicemailContexts.executeTest(self)
+
 
     def executeTest(self):
         logger.info("Executing test [" + str(self.testCounter) + "]")
         if self.testCounter == 0:
-            # Test exiting out before leaving voicemail and going to operator extension
+            """
+            Test exiting out before leaving voicemail and going to operator extension
+            """
             self.ast[self.senderAmi.id].cli_exec("dialplan set global DTMF_TO_SEND 0")
             df = self.senderAmi.originate("sip/ast1/1234", "sendvoicemail", "1234", 1)
             df.addErrback(self.handleOriginateFailure)
         elif self.testCounter == 1:
-            # Test exiting out before leaving voicemail and going to asterisk (a) extension
+            """
+            Test exiting out before leaving voicemail and going to asterisk (a) extension
+            """
             self.ast[self.senderAmi.id].cli_exec("dialplan set global DTMF_TO_SEND *")
             df = self.senderAmi.originate("sip/ast1/1234", "sendvoicemail", "1234", 1)
             df.addErrback(self.handleOriginateFailure)
         elif self.testCounter == 2:
-            # Test exiting out before leaving voicemail and going to numeric 1 extension
+            """
+            Test exiting out before leaving voicemail and going to numeric 1 extension
+            """
             self.ast[self.senderAmi.id].cli_exec("dialplan set global DTMF_TO_SEND 1")
             df = self.senderAmi.originate("sip/ast1/1234", "sendvoicemail", "1234", 1)
             df.addErrback(self.handleOriginateFailure)
         elif self.testCounter == 3:
-            # Test exiting out before leaving voicemail and going to numeric 3 extension
+            """
+            Test exiting out before leaving voicemail and going to numeric 3 extension
+            """
             self.ast[self.senderAmi.id].cli_exec("dialplan set global DTMF_TO_SEND 3")
             df = self.senderAmi.originate("sip/ast1/5678", "sendvoicemail", "5678", 1)
             df.addErrback(self.handleOriginateFailure)
         elif self.testCounter == 4:
-            # Test exiting out before leaving voicemail and going to operator extension in a different context
+            """
+            Test exiting out before leaving voicemail and going to operator extension in a different context
+            """
             self.ast[self.senderAmi.id].cli_exec("dialplan set global DTMF_TO_SEND 0")
             df = self.senderAmi.originate("sip/ast1/9000", "sendvoicemail", "9000", 1)
             df.addErrback(self.handleOriginateFailure)

Modified: asterisk/trunk/tests/apps/voicemail/leave_voicemail_contexts/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/apps/voicemail/leave_voicemail_contexts/test-config.yaml?view=diff&rev=3211&r1=3210&r2=3211
==============================================================================
--- asterisk/trunk/tests/apps/voicemail/leave_voicemail_contexts/test-config.yaml (original)
+++ asterisk/trunk/tests/apps/voicemail/leave_voicemail_contexts/test-config.yaml Fri Apr 27 12:49:17 2012
@@ -5,6 +5,8 @@
         other contexts when leaving a voicemail.
 
 properties:
+    # Expected to fail per ASTERISK-18243
+    expectedResult: 'Fail'
     minversion: '1.8'
     testconditions:
         - name: 'threads'




More information about the asterisk-commits mailing list