[asterisk-scf-commits] asterisk-scf/integration/testsuite.git branch "review" updated.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Fri Jul 8 12:14:16 CDT 2011
branch "review" has been updated
via 3ea1af01ed251514ea80f65f3429cc1a4552a677 (commit)
from aefafc0c754c1de62690490694651183a93de219 (commit)
Summary of changes:
contrib/ubuntu/init.d/testsuite-remote | 3 +++
remote.py | 17 ++++++++++++-----
2 files changed, 15 insertions(+), 5 deletions(-)
- Log -----------------------------------------------------------------
commit 3ea1af01ed251514ea80f65f3429cc1a4552a677
Author: Darren Sessions <dsessions at digium.com>
Date: Fri Jul 8 12:14:11 2011 -0500
Refactored the restart functionality after discovering that this function was not running effectively 100% of the time on all the remotes.
diff --git a/contrib/ubuntu/init.d/testsuite-remote b/contrib/ubuntu/init.d/testsuite-remote
index 9d8948e..0be097d 100755
--- a/contrib/ubuntu/init.d/testsuite-remote
+++ b/contrib/ubuntu/init.d/testsuite-remote
@@ -32,8 +32,11 @@ DAEMON_ARGS=$TESTSUITE_INSTALL_PATH/remote.py
set -e
+sysctl -w net.ipv4.ip_nonlocal_bind=1 > /dev/null
+
do_start()
{
+ sleep 2
sudo start-stop-daemon --start --quiet --user root --background --pidfile /var/run/$NAME.pid \
--make-pidfile --chdir $TESTSUITE_INSTALL_PATH --exec $DAEMON --test > /dev/null \
|| return 1
diff --git a/remote.py b/remote.py
index 1106079..48157f7 100755
--- a/remote.py
+++ b/remote.py
@@ -33,7 +33,15 @@ ipv6addr = None
macaddr = None
processList = {}
-class RemoteManagement(object):
+class RemoteAgent(object):
+ exit = False
+
+ def __init__(self):
+ self.server = SimpleXMLRPCServer.SimpleXMLRPCServer(('', 8000))
+ self.server.register_instance(self)
+ while not self.exit:
+ self.server.handle_request()
+
def listProcesses(self):
list = {}
for plugin in processList:
@@ -312,10 +320,11 @@ class RemoteManagement(object):
return {'success':True}
def restart(self):
+ self.exit = True
initScript = '/etc/init.d/testsuite-remote'
if not os.path.exists(initScript) or not os.access(initScript, os.X_OK):
return {'success':False, 'msg':'Unable to locate the testsuite-remote init script required to restart. (%s)' % initScript}
- subprocess.Popen([initScript, 'restart'])
+ subprocess.Popen([initScript, 'start'])
return {'success':True}
def _argReplace(self, execCmd):
@@ -399,6 +408,4 @@ def discoverNetworkData():
if __name__=='__main__':
ipv4addr, ipv6addr, macaddr = discoverNetworkData()
- server = SimpleXMLRPCServer.SimpleXMLRPCServer(('', 8000))
- server.register_instance(RemoteManagement())
- server.serve_forever()
+ remoteAgent()
-----------------------------------------------------------------------
--
asterisk-scf/integration/testsuite.git
More information about the asterisk-scf-commits
mailing list