Commit 642f146d authored by Julien Muchembled's avatar Julien Muchembled

runUnitTest: add tests/Z2.log access log

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@41758 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 88abfb38
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import base64, errno, select, socket, sys, time import base64, errno, os, select, socket, sys, time
from threading import Thread from threading import Thread
import Lifetime import Lifetime
import transaction import transaction
...@@ -8,6 +8,7 @@ from Testing import ZopeTestCase ...@@ -8,6 +8,7 @@ from Testing import ZopeTestCase
from zLOG import LOG, ERROR from zLOG import LOG, ERROR
from Products.CMFActivity.Activity.Queue import VALIDATION_ERROR_DELAY from Products.CMFActivity.Activity.Queue import VALIDATION_ERROR_DELAY
from Products.ERP5Type.tests import backportUnittest from Products.ERP5Type.tests import backportUnittest
from Products.ERP5Type.tests.runUnitTest import tests_home
from Products.ERP5Type.tests.utils import createZServer from Products.ERP5Type.tests.utils import createZServer
...@@ -90,18 +91,19 @@ class ProcessingNodeTestCase(backportUnittest.TestCase, ZopeTestCase.TestCase): ...@@ -90,18 +91,19 @@ class ProcessingNodeTestCase(backportUnittest.TestCase, ZopeTestCase.TestCase):
"""Start HTTP ZServer in background""" """Start HTTP ZServer in background"""
utils = ZopeTestCase.utils utils = ZopeTestCase.utils
if utils._Z2HOST is None: if utils._Z2HOST is None:
log = os.path.join(tests_home, "Z2.log")
_print = lambda hs: verbose and ZopeTestCase._print( _print = lambda hs: verbose and ZopeTestCase._print(
"Running %s server at %s:%s\n" % ( "Running %s server at %s:%s\n" % (
hs.server_protocol, hs.server_name, hs.server_port)) hs.server_protocol, hs.server_name, hs.server_port))
try: try:
hs = createZServer() hs = createZServer(log)
except RuntimeError, e: except RuntimeError, e:
ZopeTestCase._print(str(e)) ZopeTestCase._print(str(e))
else: else:
utils._Z2HOST, utils._Z2PORT = hs.server_name, hs.server_port utils._Z2HOST, utils._Z2PORT = hs.server_name, hs.server_port
_print(hs) _print(hs)
try: try:
_print(createZServer(zserver_type='webdav')) _print(createZServer(log, zserver_type='webdav'))
except RuntimeError, e: except RuntimeError, e:
ZopeTestCase._print(str(e)) ZopeTestCase._print(str(e))
t = Thread(target=Lifetime.loop) t = Thread(target=Lifetime.loop)
......
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