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):
def setUp(self):
"""Creates a environment to run the tests. Is called always before the
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.cloudooo_port = config.get("server:main", "port")
self.openoffice_port = config.get("app:main", "openoffice_port")
......
......@@ -6,7 +6,7 @@ from getopt import getopt, GetoptError
from time import sleep
from cloudooo.utils import socketStatus
from ConfigParser import ConfigParser
from os import chdir, path
from os import chdir, path, environ
from subprocess import Popen
ENVIRONMENT_PATH = path.abspath(path.dirname(__file__))
......@@ -71,6 +71,7 @@ def run():
cloudooo_runner = arg
elif opt == "--server_cloudooo_conf":
server_cloudooo_conf = arg
environ["server_cloudooo_conf"] = arg
elif opt == "--timeout_limit":
timeout_limit = arg
......@@ -88,10 +89,6 @@ def run():
server_port = int(config.get("server:main", "port"))
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:
loadConfig(server_cloudooo_conf)
Popen([cloudooo_runner, 'start']).communicate()
......
......@@ -40,5 +40,6 @@ setup(name='cloudooo',
[console_scripts]
cloudooo_tester = cloudooo.bin.cloudooo_tester: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