[Erp5-report] r41774 gabriel - /erp5/trunk/utils/cloudooo/cloudooo/tests/

nobody at svn.erp5.org nobody at svn.erp5.org
Sun Dec 26 23:26:03 CET 2010


Author: gabriel
Date: Sun Dec 26 23:26:03 2010
New Revision: 41774

URL: http://svn.erp5.org?rev=41774&view=rev
Log:
refactor code and run server without shell argument

Modified:
    erp5/trunk/utils/cloudooo/cloudooo/tests/runCloudOOoUnitTest.py

Modified: erp5/trunk/utils/cloudooo/cloudooo/tests/runCloudOOoUnitTest.py
URL: http://svn.erp5.org/erp5/trunk/utils/cloudooo/cloudooo/tests/runCloudOOoUnitTest.py?rev=41774&r1=41773&r2=41774&view=diff
==============================================================================
--- erp5/trunk/utils/cloudooo/cloudooo/tests/runCloudOOoUnitTest.py [utf8] (original)
+++ erp5/trunk/utils/cloudooo/cloudooo/tests/runCloudOOoUnitTest.py [utf8] Sun Dec 26 23:26:03 2010
@@ -12,17 +12,17 @@ from subprocess import Popen
 ENVIRONMENT_PATH = path.abspath(path.dirname(__file__))
 
 
-def wait_liberate_port(hostname, port, timeout_limit=10):
+def wait_liberate_port(hostname, port, timeout_limit=30):
   for n in range(timeout_limit):
     if not socketStatus(hostname, port):
       break
     sleep(1)
 
 
-def wait_use_port(hostname, port, timeout_limit=10):
+def wait_use_port(hostname, port, timeout_limit=30):
   for n in range(timeout_limit):
     if socketStatus(hostname, port):
-      return
+      break
     sleep(1)
 
 
@@ -94,18 +94,18 @@ def run():
   hostname = config.get("app:main", "application_hostname")
   server_port = int(config.get("server:main", "port"))
   run_dir = config.get('app:main', 'working_path')
-
   if DAEMON:
     loadConfig(server_cloudooo_conf)
     command = [paster_path, "serve", server_cloudooo_conf]
-    process = Popen(" ".join(command), shell=True)
+    process = Popen(command)
+    wait_use_port(hostname, openoffice_port)
     wait_use_port(hostname, server_port)
     chdir(ENVIRONMENT_PATH)
     try:
       run_test(test_name)
     finally:
       process.send_signal(1)
-      sleep(3)
+      wait_liberate_port(hostname, server_port)
       process.terminate()
     wait_liberate_port(hostname, server_port)
   elif OPENOFFICE:



More information about the Erp5-report mailing list