[svn-commits] mnicholson: testsuite/asterisk/trunk r2802 - /asterisk/trunk/lib/python/aster...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Nov 16 12:30:54 CST 2011


Author: mnicholson
Date: Wed Nov 16 12:30:52 2011
New Revision: 2802

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=2802
Log:
check the exit status of asterisk and make the test fail if asterisk did not
exit successfully

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

Modified: asterisk/trunk/lib/python/asterisk/TestCase.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/lib/python/asterisk/TestCase.py?view=diff&rev=2802&r1=2801&r2=2802
==============================================================================
--- asterisk/trunk/lib/python/asterisk/TestCase.py (original)
+++ asterisk/trunk/lib/python/asterisk/TestCase.py Wed Nov 16 12:30:52 2011
@@ -178,11 +178,28 @@
         Stop the instances of Asterisk that were previously started.  See
         start_asterisk.  Note that this should be called after the reactor has
         returned from its run.
-        """
+
+        If there were errors exiting asterisk, this function will return False.
+        """
+        res = True
         self.testConditionController.evaluate_post_checks()
         for index, item in enumerate(self.ast):
             logger.info("Stopping Asterisk instance %d" % (index + 1))
-            self.ast[index].stop()
+            returncode = self.ast[index].stop()
+            if returncode < 0:
+                # XXX setting passed here might be overridden later in a
+                # derived class. This is bad.
+                self.passed = False
+                logger.error("Asterisk instance %d exited with signal %d" % (index + 1, abs(returncode)))
+                res = False
+            elif returncode > 0:
+                # XXX same here
+                self.passed = False
+                logger.error("Asterisk instance %d exited with non-zero return code %d" % (index + 1, returncode))
+                res = False
+
+        return res
+
 
     def stop_reactor(self):
         """




More information about the svn-commits mailing list