[svn-commits] pabelanger: testsuite/asterisk/trunk r957 - in /asterisk/trunk: ./ lib/python...
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Thu Nov 25 17:00:05 CST 2010
Author: pabelanger
Date: Thu Nov 25 17:00:01 2010
New Revision: 957
URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=957
Log:
'core show locks' if we cannot stop Asterisk gracefully.
Additionally, close test-output.txt when finished with it.
Modified:
asterisk/trunk/lib/python/asterisk/asterisk.py
asterisk/trunk/runtests.py
Modified: asterisk/trunk/lib/python/asterisk/asterisk.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/lib/python/asterisk/asterisk.py?view=diff&rev=957&r1=956&r2=957
==============================================================================
--- asterisk/trunk/lib/python/asterisk/asterisk.py (original)
+++ asterisk/trunk/lib/python/asterisk/asterisk.py Thu Nov 25 17:00:01 2010
@@ -133,9 +133,7 @@
Example Usage:
asterisk.stop()
"""
- #
# Start by asking to stop gracefully.
- #
if self.ast_version < AsteriskVersion("1.6.0"):
self.cli_exec("stop gracefully")
else:
@@ -145,10 +143,11 @@
if self.process.poll() is not None:
return self.process.returncode
- #
+ # Check for locks
+ self.cli_exec("core show locks")
+
# If the graceful shutdown did not complete within 5 seconds, ask
# Asterisk to stop right now.
- #
if self.ast_version < AsteriskVersion("1.6.0"):
self.cli_exec("stop now")
else:
@@ -158,11 +157,9 @@
if self.process.poll() is not None:
return self.process.returncode
- #
# If even a "stop now" didn't do the trick, fall back to sending
# signals to the process. First, send a SIGTERM. If it _STILL_ hasn't
# gone away after another 5 seconds, send SIGKILL.
- #
try:
os.kill(self.process.pid, signal.SIGTERM)
for i in xrange(5):
@@ -175,10 +172,8 @@
# dead. Just ignore it.
pass
- #
# We have done everything we can do at this point. Wait for the
# process to exit.
- #
self.process.wait()
return self.process.returncode
Modified: asterisk/trunk/runtests.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/runtests.py?view=diff&rev=957&r1=956&r2=957
==============================================================================
--- asterisk/trunk/runtests.py (original)
+++ asterisk/trunk/runtests.py Thu Nov 25 17:00:01 2010
@@ -144,6 +144,7 @@
except IOError:
pass
p.wait()
+ f.close()
self.passed = p.returncode == 0
else:
print "FAILED TO EXECUTE %s, it must exist and be executable" % cmd
More information about the svn-commits
mailing list