[svn-commits] mjordan: testsuite/asterisk/trunk r5274 - /asterisk/trunk/lib/python/asterisk/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sat Jul 19 10:23:56 CDT 2014


Author: mjordan
Date: Sat Jul 19 10:23:46 2014
New Revision: 5274

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=5274
Log:
test_case: Revert AMI shutdown patch

Unfortunately, there are a lot of tests that do not have a good, clean shutdown
sequence. These tests are typically still looking for an AMI event during the
shutdown sequence; closing the AMI connection prior to issuing the shutdown
causes them to fail.

While this patch is the right solution long term, the tests should be cleaned
up prior to this being applied. As it is, the large number of test failures
resulting from this patch make it more difficult to run the build agents. Given
the other integration efforts currently ongoing, we'll have to revisit this
patch at a latter date.

Modified:
    asterisk/trunk/lib/python/asterisk/test_case.py

Modified: asterisk/trunk/lib/python/asterisk/test_case.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/lib/python/asterisk/test_case.py?view=diff&rev=5274&r1=5273&r2=5274
==============================================================================
--- asterisk/trunk/lib/python/asterisk/test_case.py (original)
+++ asterisk/trunk/lib/python/asterisk/test_case.py Sat Jul 19 10:23:46 2014
@@ -388,41 +388,18 @@
             self._stop_deferred.callback(self)
             return result
 
-        def __stop_ami(result):
-            """Tear down AMI connections"""
+        def __stop_instances(result):
+            """Stop the instances"""
 
             # Call the overridable method now
             self.stop_asterisk()
-
-            if not isinstance(self.ami, list):
-                LOGGER.error("self.ami not iterable for teardown: %s"
-                    % str(self.ami))
-                __stop_instances(None)
-                return
-
-            # tear down AMI instances
-            ami_defers = []
-            for ami in self.ami:
-                if ami:
-                    ami_defers.append(ami.logoff())
-
-            defer.DeferredList(ami_defers).addCallback(
-                __stop_instances).addErrback(__ami_stop_fail)
-
-        def __ami_stop_fail(result):
-            """Handle AMI stop failure"""
-            LOGGER.error("Failed to tear down AMI connection(s)")
-            __stop_instances(result)
-
-        def __stop_instances(result):
-            """Stop the instances"""
-
             # Gather up the stopped defers; check success failure of stopping
             # when all instances of Asterisk have stopped
             stop_defers = []
             for index, item in enumerate(self.ast):
                 LOGGER.info("Stopping Asterisk instance %d" % (index + 1))
-                stop_defers.append(item.stop())
+                temp_defer = self.ast[index].stop()
+                stop_defers.append(temp_defer)
 
             defer.DeferredList(stop_defers).addCallback(
                 __check_success_failure)
@@ -431,9 +408,9 @@
         self._stop_deferred = defer.Deferred()
         deferred = self.condition_controller.evaluate_post_checks()
         if deferred:
-            deferred.addCallback(__stop_ami)
+            deferred.addCallback(__stop_instances)
         else:
-            __stop_ami(None)
+            __stop_instances(None)
         return self._stop_deferred
 
     def stop_reactor(self):




More information about the svn-commits mailing list