[asterisk-commits] mjordan: branch mjordan/voicemail_tests_082811 r2090 - in /asterisk/team/mjor...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Sep 7 13:28:25 CDT 2011


Author: mjordan
Date: Wed Sep  7 13:28:20 2011
New Revision: 2090

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=2090
Log:
First round of changes to address reviews and merge of manager changes

Removed:
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/authenticate_extensions/configs/ast1/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/authenticate_extensions/configs/ast2/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/authenticate_invalid_mailbox/configs/ast1/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/authenticate_invalid_mailbox/configs/ast2/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/authenticate_invalid_password/configs/ast1/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/authenticate_invalid_password/configs/ast2/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/authenticate_nominal/configs/ast1/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/authenticate_nominal/configs/ast2/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_callback/configs/ast1/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_callback/configs/ast1/manager.users.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_callback/configs/ast2/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_callback/configs/ast2/manager.users.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_delete/configs/ast1/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_delete/configs/ast1/manager.users.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_delete/configs/ast2/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_delete/configs/ast2/manager.users.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_dialout/configs/ast1/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_dialout/configs/ast1/manager.users.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_dialout/configs/ast2/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_dialout/configs/ast2/manager.users.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_envelope/configs/ast1/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_envelope/configs/ast1/manager.users.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_envelope/configs/ast2/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_envelope/configs/ast2/manager.users.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_forward/configs/ast1/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_forward/configs/ast1/manager.users.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_forward/configs/ast2/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_forward/configs/ast2/manager.users.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_forward_hangup/configs/ast1/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_forward_hangup/configs/ast1/manager.users.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_forward_hangup/configs/ast2/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_forward_hangup/configs/ast2/manager.users.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_forward_with_prepend/configs/ast1/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_forward_with_prepend/configs/ast1/manager.users.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_forward_with_prepend/configs/ast2/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_forward_with_prepend/configs/ast2/manager.users.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_new_user/configs/ast1/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_new_user/configs/ast1/manager.users.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_new_user/configs/ast2/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_new_user/configs/ast2/manager.users.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_new_user_hangup/configs/ast1/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_new_user_hangup/configs/ast1/manager.users.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_new_user_hangup/configs/ast2/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_new_user_hangup/configs/ast2/manager.users.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_nominal/configs/ast1/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_nominal/configs/ast1/manager.users.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_nominal/configs/ast2/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_nominal/configs/ast2/manager.users.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_options_change_password/configs/ast1/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_options_change_password/configs/ast1/manager.users.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_options_change_password/configs/ast2/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_options_change_password/configs/ast2/manager.users.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_options_record_busy/configs/ast1/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_options_record_busy/configs/ast1/manager.users.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_options_record_busy/configs/ast2/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_options_record_busy/configs/ast2/manager.users.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_options_record_name/configs/ast1/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_options_record_name/configs/ast1/manager.users.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_options_record_name/configs/ast2/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_options_record_name/configs/ast2/manager.users.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_options_record_temp/configs/ast1/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_options_record_temp/configs/ast1/manager.users.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_options_record_temp/configs/ast2/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_options_record_temp/configs/ast2/manager.users.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_options_record_unavail/configs/ast1/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_options_record_unavail/configs/ast1/manager.users.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_options_record_unavail/configs/ast2/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_options_record_unavail/configs/ast2/manager.users.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_reply/configs/ast1/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_reply/configs/ast1/manager.users.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_reply/configs/ast2/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_reply/configs/ast2/manager.users.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_while_leaving_msg/configs/ast1/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_while_leaving_msg/configs/ast1/manager.users.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_while_leaving_msg/configs/ast2/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_while_leaving_msg/configs/ast2/manager.users.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/func_vmcount/configs/ast1/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/leave_voicemail_contexts/configs/ast1/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/leave_voicemail_contexts/configs/ast2/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/leave_voicemail_external_notification/configs/ast1/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/leave_voicemail_external_notification/configs/ast2/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/leave_voicemail_forwarding/configs/ast1/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/leave_voicemail_forwarding/configs/ast2/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/leave_voicemail_forwarding_auto_urgent/configs/ast1/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/leave_voicemail_forwarding_auto_urgent/configs/ast2/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/leave_voicemail_nominal/configs/ast1/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/leave_voicemail_nominal/configs/ast2/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/leave_voicemail_priority/configs/ast1/manager.general.conf.inc
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/leave_voicemail_priority/configs/ast2/manager.general.conf.inc
Modified:
    asterisk/team/mjordan/voicemail_tests_082811/configs/manager.conf
    asterisk/team/mjordan/voicemail_tests_082811/lib/python/asterisk/TestCase.py
    asterisk/team/mjordan/voicemail_tests_082811/lib/python/asterisk/asterisk.py
    asterisk/team/mjordan/voicemail_tests_082811/logger.conf
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/authenticate_extensions/run-test
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/authenticate_invalid_mailbox/run-test
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/authenticate_invalid_password/run-test
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/authenticate_nominal/run-test
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_callback/run-test
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_delete/run-test
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_dialout/run-test
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_envelope/run-test
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_forward/run-test
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_forward_hangup/run-test
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_forward_with_prepend/run-test
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_new_user/run-test
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_new_user_hangup/run-test
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_nominal/run-test
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_options_change_password/run-test
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_options_record_busy/run-test
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_options_record_name/run-test
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_options_record_temp/run-test
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_options_record_unavail/run-test
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_reply/run-test
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_while_leaving_msg/run-test
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/func_vmcount/run-test
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/leave_voicemail_contexts/run-test
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/leave_voicemail_external_notification/run-test
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/leave_voicemail_forwarding/run-test
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/leave_voicemail_forwarding_auto_urgent/run-test
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/leave_voicemail_nominal/configs/ast1/extensions.conf
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/leave_voicemail_nominal/configs/ast2/extensions.conf
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/leave_voicemail_nominal/run-test
    asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/leave_voicemail_priority/run-test

Modified: asterisk/team/mjordan/voicemail_tests_082811/configs/manager.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mjordan/voicemail_tests_082811/configs/manager.conf?view=diff&rev=2090&r1=2089&r2=2090
==============================================================================
--- asterisk/team/mjordan/voicemail_tests_082811/configs/manager.conf (original)
+++ asterisk/team/mjordan/voicemail_tests_082811/configs/manager.conf Wed Sep  7 13:28:20 2011
@@ -1,5 +1,5 @@
 [general]
-enabled = no
+enabled = yes
 port = 5038
 bindaddr = 127.0.0.1
 
@@ -7,7 +7,7 @@
 
 [user]
 secret = mysecret
-read = system,call,log,verbose,agent,user,config,dtmf,reporting,cdr,dialplan
+read = system,call,log,verbose,agent,user,config,dtmf,reporting,cdr,dialplan,test
 write = system,call,agent,user,config,command,reporting,originate
 
 #include "manager.users.conf.inc"

Modified: asterisk/team/mjordan/voicemail_tests_082811/lib/python/asterisk/TestCase.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mjordan/voicemail_tests_082811/lib/python/asterisk/TestCase.py?view=diff&rev=2090&r1=2089&r2=2090
==============================================================================
--- asterisk/team/mjordan/voicemail_tests_082811/lib/python/asterisk/TestCase.py (original)
+++ asterisk/team/mjordan/voicemail_tests_082811/lib/python/asterisk/TestCase.py Wed Sep  7 13:28:20 2011
@@ -53,7 +53,8 @@
         """
         for c in range(count):
             logger.info("Creating Asterisk instance %d" % (c + 1))
-            self.ast.append(Asterisk(base=self.base))
+            host = "127.0.0.%d" % (c + 1)
+            self.ast.append(Asterisk(base=self.base, host=host))
             # Copy shared config files
             self.ast[c].install_configs("%s/configs" %
                     (self.test_name))
@@ -127,3 +128,9 @@
         logger.info("AMI Connect instance %s" % (ami.id + 1))
         self.ami[ami.id] = ami
 
+    def handleOriginateFailure(self, reason):
+        """ Convenience callback handler for twisted deferred errors for an AMI originate call """
+        logger.error("Error sending originate:")
+        logger.error(reason.getTraceback())
+        self.stop_reactor()
+        return reason

Modified: asterisk/team/mjordan/voicemail_tests_082811/lib/python/asterisk/asterisk.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mjordan/voicemail_tests_082811/lib/python/asterisk/asterisk.py?view=diff&rev=2090&r1=2089&r2=2090
==============================================================================
--- asterisk/team/mjordan/voicemail_tests_082811/lib/python/asterisk/asterisk.py (original)
+++ asterisk/team/mjordan/voicemail_tests_082811/lib/python/asterisk/asterisk.py Wed Sep  7 13:28:20 2011
@@ -107,6 +107,8 @@
 
         self.install_configs(os.getcwd() + "/configs")
 
+        self.__setup_configs()
+
     def start(self):
         """Start this instance of Asterisk.
 
@@ -249,6 +251,26 @@
             logger.warn("'%s' and '%s' are the same file" % (cfg_path, target_path))
         except IOError:
             logger.warn("The destination is not writable '%s'" % target_path)
+
+    def overwrite_file(self, path, filename, values):
+        target_filename = os.path.join(self.astetcdir, filename)
+
+        if not os.path.exists(target_filename):
+            logger.error("File '%s' does not exists" % filename)
+            return
+        try:
+            f = open(target_filename, "w")
+        except IOError:
+            logger.error("Failed to open %s" % target_filename)
+            return
+        except:
+            logger.error("Unexpected error: %s" % sys.exc_info()[0])
+            return
+
+        for (var, val) in values:
+            f.write('%s = %s\n' % (var, val))
+
+        f.close()
 
     def cli_originate(self, argstr, blocking=True):
         """Starts a call from the CLI and links it to an application or
@@ -333,6 +355,20 @@
         except OSError:
             pass
         return output
+
+    def __setup_configs(self):
+        self.__setup_manager_conf()
+
+    def __setup_manager_conf(self):
+        values = []
+
+        if self.host == '127.0.0.1':
+            return
+
+        values.append(['bindaddr', self.host])
+
+        self.overwrite_file(self.directories['astetcdir'],
+            "manager.general.conf.inc", values)
 
     def __gen_ast_conf(self, ast_conf, dir_cat, ast_conf_options):
         for (var, val) in dir_cat.options:

Modified: asterisk/team/mjordan/voicemail_tests_082811/logger.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mjordan/voicemail_tests_082811/logger.conf?view=diff&rev=2090&r1=2089&r2=2090
==============================================================================
--- asterisk/team/mjordan/voicemail_tests_082811/logger.conf (original)
+++ asterisk/team/mjordan/voicemail_tests_082811/logger.conf Wed Sep  7 13:28:20 2011
@@ -45,12 +45,12 @@
 class=handlers.RotatingFileHandler
 level=INFO
 formatter=default
-args=('./logs/messages', 'a', 67108864, 5)
+args=('./logs/messages.txt', 'a', 67108864, 5)
 [handler_verboseFile]
 class=handlers.RotatingFileHandler
 level=DEBUG
 formatter=default
-args=('./logs/full', 'a', 67108864, 10)
+args=('./logs/full.txt', 'a', 67108864, 10)
 
 # Formatter definitions for handlers defined in this configuration file
 [formatter_default]

Modified: asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/authenticate_extensions/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/authenticate_extensions/run-test?view=diff&rev=2090&r1=2089&r2=2090
==============================================================================
--- asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/authenticate_extensions/run-test (original)
+++ asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/authenticate_extensions/run-test Wed Sep  7 13:28:20 2011
@@ -24,13 +24,12 @@
 class AuthenticateExtensions(TestCase):
 
     def __init__(self):
-        TestCase.__init__(self)
+        super(AuthenticateExtensions, self).__init__()
 
         self.create_asterisk(2)
 
     def ami_connect(self, ami):
-        logger.debug("Got AMI Connect for instance " + str(ami.id))
-        TestCase.ami_connect(self, ami)
+        super(AuthenticateExtensions, self).ami_connect(ami)
 
         ami.registerEvent('UserEvent', self.user_event)
 
@@ -50,13 +49,6 @@
         df = ami.originate("sip/ast1/9000", "sendvoicemail", "transfer", 1)
         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
@@ -73,7 +65,7 @@
         self.stop_reactor()
 
     def run(self):
-        TestCase.run(self)
+        super(AuthenticateExtensions, self).run()
         self.passed = True
         self.create_ami_factory(2)
 

Modified: asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/authenticate_invalid_mailbox/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/authenticate_invalid_mailbox/run-test?view=diff&rev=2090&r1=2089&r2=2090
==============================================================================
--- asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/authenticate_invalid_mailbox/run-test (original)
+++ asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/authenticate_invalid_mailbox/run-test Wed Sep  7 13:28:20 2011
@@ -24,13 +24,12 @@
 class AuthenticateInvalidMailbox(TestCase):
 
     def __init__(self):
-        TestCase.__init__(self)
+        super(AuthenticateInvalidMailbox, self).__init__()
 
         self.create_asterisk(2)
 
     def ami_connect(self, ami):
-        logger.debug("Got AMI Connect for instance " + str(ami.id))
-        TestCase.ami_connect(self, ami)
+        super(AuthenticateInvalidMailbox, self).ami_connect(ami)
 
         ami.registerEvent('UserEvent', self.user_event)
 
@@ -45,13 +44,6 @@
         logger.debug("Originating call to sip/ast1/9000 from invalidMailbox at sendvoicemail")
         df = ami.originate("sip/ast1/9000", "sendvoicemail", "invalidMailbox", 1)
         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':
@@ -72,7 +64,7 @@
         self.stop_reactor()
 
     def run(self):
-        TestCase.run(self)
+        super(AuthenticateInvalidMailbox, self).run()
         self.passed = True
         self.create_ami_factory(2)
 

Modified: asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/authenticate_invalid_password/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/authenticate_invalid_password/run-test?view=diff&rev=2090&r1=2089&r2=2090
==============================================================================
--- asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/authenticate_invalid_password/run-test (original)
+++ asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/authenticate_invalid_password/run-test Wed Sep  7 13:28:20 2011
@@ -24,13 +24,12 @@
 class AuthenticateInvalidPassword(TestCase):
 
     def __init__(self):
-        TestCase.__init__(self)
+        super(AuthenticateInvalidPassword, self).__init__()
 
         self.create_asterisk(2)
 
     def ami_connect(self, ami):
-        logger.debug("Got AMI Connect for instance " + str(ami.id))
-        TestCase.ami_connect(self, ami)
+        super(AuthenticateInvalidPassword, self).ami_connect(ami)
 
         ami.registerEvent('UserEvent', self.user_event)
 
@@ -49,13 +48,6 @@
         logger.debug("Originating call to sip/ast1/9001 from invalidPassword at sendvoicemail")
         df = ami.originate("sip/ast1/9001", "sendvoicemail", "invalidPassword", 1)
         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':
@@ -76,7 +68,7 @@
         self.stop_reactor()
 
     def run(self):
-        TestCase.run(self)
+        super(AuthenticateInvalidPassword, self).run()
         self.passed = True
         self.create_ami_factory(2)
 

Modified: asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/authenticate_nominal/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/authenticate_nominal/run-test?view=diff&rev=2090&r1=2089&r2=2090
==============================================================================
--- asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/authenticate_nominal/run-test (original)
+++ asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/authenticate_nominal/run-test Wed Sep  7 13:28:20 2011
@@ -30,15 +30,14 @@
     results = [False, False, False]
 
     def __init__(self):
-        TestCase.__init__(self)
+        super(AuthenticateNominal, self).__init__()
 
-        TestCase.reactor_timeout = 60
+        super(AuthenticateNominal, self).reactor_timeout = 60
 
         self.create_asterisk(2)
 
     def ami_connect(self, ami):
-        logger.debug("Got AMI Connect for instance " + str(ami.id))
-        TestCase.ami_connect(self, ami)
+        super(AuthenticateNominal, self).ami_connect(ami)
 
         ami.registerEvent('UserEvent', self.user_event)
 
@@ -67,13 +66,6 @@
 
         self.testCounter += 1
 
-    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
@@ -101,7 +93,7 @@
                 self.executeTest(ami)
 
     def run(self):
-        TestCase.run(self)
+        super(AuthenticateNominal, self).run()
         self.create_ami_factory(2)
 
 

Modified: asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_callback/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_callback/run-test?view=diff&rev=2090&r1=2089&r2=2090
==============================================================================
--- asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_callback/run-test (original)
+++ asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_callback/run-test Wed Sep  7 13:28:20 2011
@@ -211,7 +211,7 @@
     voicemailManager = None
 
     def __init__(self):
-        VoiceMailTest.__init__(self)
+        super(CheckVoicemailCallback, self).__init__()
 
         """
         Add our test conditions to the test - these will help us verify through the
@@ -228,8 +228,7 @@
         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(CheckVoicemailCallback, self).ami_connect(ami)
 
         """ Record which AMI instance we've received and attempt to set up the test controller """
         if (ami.id == 0):
@@ -263,13 +262,6 @@
             logger.debug("Originating call to " + self.channel)
             df = ami.originate(self.channel, "voicemailCaller", "wait", 1)
             df.addErrback(self.handleOriginateFailure)
-
-    def handleOriginateFailure(self, reason):
-        logger.error("Error sending originate:")
-        logger.error(reason.getTraceback())
-        self.stop_reactor()
-
-        return reason
 
     def handleAssert(self, event):
         self.passed = False
@@ -300,7 +292,7 @@
         self.stop_reactor()
 
     def run(self):
-        TestCase.run(self)
+        super(CheckVoicemailCallback, self).run()
         self.create_ami_factory(2)
 
 

Modified: asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_delete/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_delete/run-test?view=diff&rev=2090&r1=2089&r2=2090
==============================================================================
--- asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_delete/run-test (original)
+++ asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_delete/run-test Wed Sep  7 13:28:20 2011
@@ -192,7 +192,7 @@
     voicemailManager = None
 
     def __init__(self):
-        VoiceMailTest.__init__(self)
+        super(CheckVoicemailDelete, self).__init__()
 
         """
         Add our test conditions to the test - these will help us verify through the
@@ -210,8 +210,7 @@
         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(CheckVoicemailDelete, self).ami_connect(ami)
 
         """ Record which AMI instance we've received and attempt to set up the test controller """
         if (ami.id == 0):
@@ -246,13 +245,6 @@
             df = ami.originate(self.channel, "voicemailCaller", "wait", 1)
             df.addErrback(self.handleOriginateFailure)
 
-    def handleOriginateFailure(self, reason):
-        logger.error("Error sending originate:")
-        logger.error(reason.getTraceback())
-        self.stop_reactor()
-
-        return reason
-
     def handleAssert(self, event):
         self.passed = False
         logger.error("Test Failed - Assert received")
@@ -277,7 +269,7 @@
         self.stop_reactor()
 
     def run(self):
-        TestCase.run(self)
+        super(CheckVoicemailDelete, self).run()
         self.create_ami_factory(2)
 
 def main():

Modified: asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_dialout/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_dialout/run-test?view=diff&rev=2090&r1=2089&r2=2090
==============================================================================
--- asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_dialout/run-test (original)
+++ asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_dialout/run-test Wed Sep  7 13:28:20 2011
@@ -203,7 +203,7 @@
     voicemailManager = None
 
     def __init__(self):
-        VoiceMailTest.__init__(self)
+        super(CheckVoicemailDialout, self).__init__()
 
         """
         Add our test conditions to the test - these will help us verify through the
@@ -220,8 +220,7 @@
         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(CheckVoicemailDialout, self).ami_connect(ami)
 
         """ Record which AMI instance we've received and attempt to set up the test controller """
         if (ami.id == 0):
@@ -255,13 +254,6 @@
             logger.debug("Originating call to " + self.channel)
             df = ami.originate(self.channel, "voicemailCaller", "wait", 1)
             df.addErrback(self.handleOriginateFailure)
-
-    def handleOriginateFailure(self, reason):
-        logger.error("Error sending originate:")
-        logger.error(reason.getTraceback())
-        self.stop_reactor()
-
-        return reason
 
     def handleAssert(self, event):
         self.passed = False
@@ -293,7 +285,7 @@
         self.stop_reactor()
 
     def run(self):
-        TestCase.run(self)
+        super(CheckVoicemailDialout, self).run()
         self.create_ami_factory(2)
 
 

Modified: asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_envelope/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_envelope/run-test?view=diff&rev=2090&r1=2089&r2=2090
==============================================================================
--- asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_envelope/run-test (original)
+++ asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_envelope/run-test Wed Sep  7 13:28:20 2011
@@ -245,7 +245,7 @@
     voicemailManager = None
 
     def __init__(self):
-        VoiceMailTest.__init__(self)
+        super(CheckVoicemailEnvelope, self).__init__()
 
         """
         Add our test conditions to the test - these will help us verify through the
@@ -268,8 +268,7 @@
         self.create_asterisk(2)
 
     def ami_connect(self, ami):
-        TestCase.ami_connect(self, ami)
-        logger.info("Got AMI Connect for instance " + str(ami.id))
+        super(CheckVoicemailEnvelope, self).ami_connect(ami)
 
         """ Record which AMI instance we've received and attempt to set up the test controller """
         if (ami.id == 0):
@@ -303,13 +302,6 @@
             df = ami.originate(self.channel, "voicemailCaller", "wait", 1)
             df.addErrback(self.handleOriginateFailure)
 
-    def handleOriginateFailure(self, reason):
-        logger.error("Error sending originate:")
-        logger.error(reason.getTraceback())
-        self.stop_reactor()
-
-        return reason
-
     def handleAssert(self, event):
         self.passed = False
         logger.error("Test Failed - Assert received")
@@ -334,7 +326,7 @@
         self.stop_reactor()
 
     def run(self):
-        TestCase.run(self)
+        super(CheckVoicemailEnvelope, self).run()
         self.create_ami_factory(2)
 
 

Modified: asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_forward/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_forward/run-test?view=diff&rev=2090&r1=2089&r2=2090
==============================================================================
--- asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_forward/run-test (original)
+++ asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_forward/run-test Wed Sep  7 13:28:20 2011
@@ -226,7 +226,7 @@
     voicemailManager = None
 
     def __init__(self):
-        VoiceMailTest.__init__(self)
+        super(CheckVoicemailForward, self).__init__()
 
         """
         Add our test conditions to the test - these will help us verify through the
@@ -247,8 +247,7 @@
         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(CheckVoicemailForward, self).ami_connect(ami)
 
         """ Record which AMI instance we've received and attempt to set up the test controller """
         if (ami.id == 0):
@@ -282,13 +281,6 @@
             df = ami.originate(self.channel, "voicemailCaller", "wait", 1)
             df.addErrback(self.handleOriginateFailure)
 
-    def handleOriginateFailure(self, reason):
-        logger.error("Error sending originate:")
-        logger.error(reason.getTraceback())
-        self.stop_reactor()
-
-        return reason
-
     def handleAssert(self, event):
         self.passed = False
         logger.error(" Test Failed - Assert received")
@@ -313,7 +305,7 @@
         self.stop_reactor()
 
     def run(self):
-        TestCase.run(self)
+        super(CheckVoicemailForward, self).run()
         self.create_ami_factory(2)
 
 

Modified: asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_forward_hangup/run-test
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_forward_hangup/run-test?view=diff&rev=2090&r1=2089&r2=2090
==============================================================================
--- asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_forward_hangup/run-test (original)
+++ asterisk/team/mjordan/voicemail_tests_082811/tests/apps/voicemail/check_voicemail_forward_hangup/run-test Wed Sep  7 13:28:20 2011
@@ -233,7 +233,7 @@
     voicemailManager = None
 
     def __init__(self):
-        VoiceMailTest.__init__(self)
+        super(CheckVoicemailForwardHangup, self).__init__()
 
         """
         Add our test conditions to the test - these will help us verify through the
@@ -250,8 +250,7 @@
         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(CheckVoicemailForwardHangup, self).ami_connect(ami)
 
         """ Record which AMI instance we've received and attempt to set up the test controller """
         if (ami.id == 0):
@@ -282,13 +281,6 @@
             logger.debug("Originating call to " + self.channel)
             df = ami.originate(self.channel, "voicemailCaller", "wait", 1)
             df.addErrback(self.handleOriginateFailure)
-
-    def handleOriginateFailure(self, reason):
-        logger.error("Error sending originate:")
-        logger.error(reason.getTraceback())
-        self.stop_reactor()
-
-        return reason
 

[... 982 lines stripped ...]



More information about the asterisk-commits mailing list