Commit 73d51d12 authored by Gabriel Monnerat's avatar Gabriel Monnerat

add configuration to create script that run runCloudOOoUnitTest.py

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk/utils@40340 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ca7ec501
...@@ -124,6 +124,9 @@ class cloudoooTestCase(unittest.TestCase): ...@@ -124,6 +124,9 @@ class cloudoooTestCase(unittest.TestCase):
def setUp(self): def setUp(self):
"""Creates a environment to run the tests. Is called always before the """Creates a environment to run the tests. Is called always before the
tests.""" tests."""
server_cloudooo_conf = environ.get("server_cloudooo_conf", None)
if server_cloudooo_conf is not None:
config.read(server_cloudooo_conf)
self.hostname = config.get("server:main", "host") self.hostname = config.get("server:main", "host")
self.cloudooo_port = config.get("server:main", "port") self.cloudooo_port = config.get("server:main", "port")
self.openoffice_port = config.get("app:main", "openoffice_port") self.openoffice_port = config.get("app:main", "openoffice_port")
......
...@@ -6,7 +6,7 @@ from getopt import getopt, GetoptError ...@@ -6,7 +6,7 @@ from getopt import getopt, GetoptError
from time import sleep from time import sleep
from cloudooo.utils import socketStatus from cloudooo.utils import socketStatus
from ConfigParser import ConfigParser from ConfigParser import ConfigParser
from os import chdir, path from os import chdir, path, environ
from subprocess import Popen from subprocess import Popen
ENVIRONMENT_PATH = path.abspath(path.dirname(__file__)) ENVIRONMENT_PATH = path.abspath(path.dirname(__file__))
...@@ -71,6 +71,7 @@ def run(): ...@@ -71,6 +71,7 @@ def run():
cloudooo_runner = arg cloudooo_runner = arg
elif opt == "--server_cloudooo_conf": elif opt == "--server_cloudooo_conf":
server_cloudooo_conf = arg server_cloudooo_conf = arg
environ["server_cloudooo_conf"] = arg
elif opt == "--timeout_limit": elif opt == "--timeout_limit":
timeout_limit = arg timeout_limit = arg
...@@ -88,10 +89,6 @@ def run(): ...@@ -88,10 +89,6 @@ def run():
server_port = int(config.get("server:main", "port")) server_port = int(config.get("server:main", "port"))
run_dir = config.get('app:main', 'working_path') run_dir = config.get('app:main', 'working_path')
test_name = sys.argv[-1]
if not path.exists(path.join(ENVIRONMENT_PATH, '%s.py' % test_name)):
exit("%s not exists\n" % test_name)
if DAEMON: if DAEMON:
loadConfig(server_cloudooo_conf) loadConfig(server_cloudooo_conf)
Popen([cloudooo_runner, 'start']).communicate() Popen([cloudooo_runner, 'start']).communicate()
......
...@@ -40,5 +40,6 @@ setup(name='cloudooo', ...@@ -40,5 +40,6 @@ setup(name='cloudooo',
[console_scripts] [console_scripts]
cloudooo_tester = cloudooo.bin.cloudooo_tester:main cloudooo_tester = cloudooo.bin.cloudooo_tester:main
echo_cloudooo_conf = cloudooo.bin.echo_cloudooo_conf:main echo_cloudooo_conf = cloudooo.bin.echo_cloudooo_conf:main
runCloudOOoUnitTest = cloudooo.tests.runCloudOOoUnitTest:run
""", """,
) )
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment