Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZODB
Commits
ef6b70fd
Commit
ef6b70fd
authored
Apr 29, 2010
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Provided more control over the way test servers are run to make
debugging easier.
parent
ba8ee57f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
6 deletions
+13
-6
src/ZEO/tests/forker.py
src/ZEO/tests/forker.py
+10
-5
src/ZEO/tests/zeoserver.py
src/ZEO/tests/zeoserver.py
+3
-1
No files found.
src/ZEO/tests/forker.py
View file @
ef6b70fd
...
@@ -42,6 +42,7 @@ class ZEOConfig:
...
@@ -42,6 +42,7 @@ class ZEOConfig:
self
.
authentication_protocol
=
None
self
.
authentication_protocol
=
None
self
.
authentication_database
=
None
self
.
authentication_database
=
None
self
.
authentication_realm
=
None
self
.
authentication_realm
=
None
self
.
loglevel
=
'INFO'
def
dump
(
self
,
f
):
def
dump
(
self
,
f
):
print
>>
f
,
"<zeo>"
print
>>
f
,
"<zeo>"
...
@@ -66,12 +67,12 @@ class ZEOConfig:
...
@@ -66,12 +67,12 @@ class ZEOConfig:
print
>>
f
,
"""
print
>>
f
,
"""
<eventlog>
<eventlog>
level
INFO
level
%s
<logfile>
<logfile>
path server-%s.log
path server-%s.log
</logfile>
</logfile>
</eventlog>
</eventlog>
"""
%
self
.
address
[
1
]
"""
%
(
self
.
loglevel
,
self
.
address
[
1
])
def
__str__
(
self
):
def
__str__
(
self
):
f
=
StringIO
.
StringIO
()
f
=
StringIO
.
StringIO
()
...
@@ -90,7 +91,7 @@ def encode_format(fmt):
...
@@ -90,7 +91,7 @@ def encode_format(fmt):
def
start_zeo_server
(
storage_conf
=
None
,
zeo_conf
=
None
,
port
=
None
,
keep
=
False
,
def
start_zeo_server
(
storage_conf
=
None
,
zeo_conf
=
None
,
port
=
None
,
keep
=
False
,
path
=
'Data.fs'
,
protocol
=
None
,
blob_dir
=
None
,
path
=
'Data.fs'
,
protocol
=
None
,
blob_dir
=
None
,
suicide
=
True
):
suicide
=
True
,
debug
=
False
):
"""Start a ZEO server in a separate process.
"""Start a ZEO server in a separate process.
Takes two positional arguments a string containing the storage conf
Takes two positional arguments a string containing the storage conf
...
@@ -133,6 +134,8 @@ def start_zeo_server(storage_conf=None, zeo_conf=None, port=None, keep=False,
...
@@ -133,6 +134,8 @@ def start_zeo_server(storage_conf=None, zeo_conf=None, port=None, keep=False,
args
=
[
qa
(
sys
.
executable
),
qa
(
script
),
'-C'
,
qa
(
tmpfile
)]
args
=
[
qa
(
sys
.
executable
),
qa
(
script
),
'-C'
,
qa
(
tmpfile
)]
if
keep
:
if
keep
:
args
.
append
(
"-k"
)
args
.
append
(
"-k"
)
if
debug
:
args
.
append
(
"-d"
)
if
not
suicide
:
if
not
suicide
:
args
.
append
(
"-S"
)
args
.
append
(
"-S"
)
if
protocol
:
if
protocol
:
...
@@ -288,7 +291,8 @@ def setUp(test):
...
@@ -288,7 +291,8 @@ def setUp(test):
servers
=
{}
servers
=
{}
def
start_server
(
storage_conf
=
None
,
zeo_conf
=
None
,
port
=
None
,
keep
=
False
,
def
start_server
(
storage_conf
=
None
,
zeo_conf
=
None
,
port
=
None
,
keep
=
False
,
addr
=
None
,
path
=
'Data.fs'
,
protocol
=
None
,
blob_dir
=
None
):
addr
=
None
,
path
=
'Data.fs'
,
protocol
=
None
,
blob_dir
=
None
,
suicide
=
True
,
debug
=
False
):
"""Start a ZEO server.
"""Start a ZEO server.
Return the server and admin addresses.
Return the server and admin addresses.
...
@@ -301,7 +305,8 @@ def setUp(test):
...
@@ -301,7 +305,8 @@ def setUp(test):
elif
addr
is
not
None
:
elif
addr
is
not
None
:
raise
TypeError
(
"Can't specify port and addr"
)
raise
TypeError
(
"Can't specify port and addr"
)
addr
,
adminaddr
,
pid
,
config_path
=
start_zeo_server
(
addr
,
adminaddr
,
pid
,
config_path
=
start_zeo_server
(
storage_conf
,
zeo_conf
,
port
,
keep
,
path
,
protocol
,
blob_dir
)
storage_conf
,
zeo_conf
,
port
,
keep
,
path
,
protocol
,
blob_dir
,
suicide
,
debug
)
os
.
remove
(
config_path
)
os
.
remove
(
config_path
)
servers
[
adminaddr
]
=
pid
servers
[
adminaddr
]
=
pid
return
addr
,
adminaddr
return
addr
,
adminaddr
...
...
src/ZEO/tests/zeoserver.py
View file @
ef6b70fd
...
@@ -153,10 +153,12 @@ def main():
...
@@ -153,10 +153,12 @@ def main():
configfile
=
None
configfile
=
None
suicide
=
True
suicide
=
True
# Parse the arguments and let getopt.error percolate
# Parse the arguments and let getopt.error percolate
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
'kSC:v:'
)
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
'
d
kSC:v:'
)
for
opt
,
arg
in
opts
:
for
opt
,
arg
in
opts
:
if
opt
==
'-k'
:
if
opt
==
'-k'
:
keep
=
1
keep
=
1
if
opt
==
'-d'
:
ZEO
.
zrpc
.
connection
.
debug_zrpc
=
True
elif
opt
==
'-C'
:
elif
opt
==
'-C'
:
configfile
=
arg
configfile
=
arg
elif
opt
==
'-S'
:
elif
opt
==
'-S'
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment