Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
Commits
b55ebf89
Commit
b55ebf89
authored
Aug 05, 2002
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a primitive test of zLOG re-initialization.
XXX This will probably hang for Guido.
parent
fb4db937
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
3 deletions
+35
-3
src/ZEO/tests/testStart.py
src/ZEO/tests/testStart.py
+35
-3
No files found.
src/ZEO/tests/testStart.py
View file @
b55ebf89
...
@@ -49,11 +49,14 @@ class StartTests(unittest.TestCase):
...
@@ -49,11 +49,14 @@ class StartTests(unittest.TestCase):
except
os
.
error
:
except
os
.
error
:
pass
pass
def
stop_server
(
self
):
def
getpids
(
self
):
if
not
os
.
path
.
exists
(
self
.
env
.
zeo_pid
):
if
not
os
.
path
.
exists
(
self
.
env
.
zeo_pid
):
# If there's no pid file, assume the server isn't running
# If there's no pid file, assume the server isn't running
return
return
None
,
None
ppid
,
pid
=
map
(
int
,
open
(
self
.
env
.
zeo_pid
).
read
().
split
())
return
map
(
int
,
open
(
self
.
env
.
zeo_pid
).
read
().
split
())
def
stop_server
(
self
):
ppid
,
pid
=
self
.
getpids
()
self
.
kill
(
pids
=
[
pid
])
self
.
kill
(
pids
=
[
pid
])
def
kill
(
self
,
sig
=
signal
.
SIGTERM
,
pids
=
None
):
def
kill
(
self
,
sig
=
signal
.
SIGTERM
,
pids
=
None
):
...
@@ -131,6 +134,35 @@ class StartTests(unittest.TestCase):
...
@@ -131,6 +134,35 @@ class StartTests(unittest.TestCase):
port
=
9090
port
=
9090
outp
=
self
.
fork
(
"-s"
,
"-p"
,
str
(
port
))
outp
=
self
.
fork
(
"-s"
,
"-p"
,
str
(
port
))
self
.
connect
(
port
=
port
)
self
.
connect
(
port
=
port
)
def
testLogRestart
(
self
):
port
=
9090
logfile1
=
tempfile
.
mktemp
(
suffix
=
"log"
)
logfile2
=
tempfile
.
mktemp
(
suffix
=
"log"
)
os
.
environ
[
"EVENT_LOG_FILE"
]
=
logfile1
try
:
outp
=
self
.
fork
(
"-s"
,
"-p"
,
str
(
port
))
self
.
connect
(
port
=
port
)
buf1
=
open
(
logfile1
).
read
()
self
.
assert_
(
buf1
)
os
.
rename
(
logfile1
,
logfile2
)
ppid
,
pid
=
self
.
getpids
()
## os.kill(ppid, signal.SIGHUP)
os
.
kill
(
pid
,
signal
.
SIGHUP
)
self
.
connect
(
port
=
port
)
buf2
=
open
(
logfile1
).
read
()
self
.
assert_
(
buf2
)
finally
:
self
.
shutdown
()
try
:
os
.
unlink
(
logfile1
)
except
os
.
error
:
pass
try
:
os
.
unlink
(
logfile2
)
except
os
.
error
:
pass
def
test_suite
():
def
test_suite
():
if
os
.
name
==
"posix"
:
if
os
.
name
==
"posix"
:
...
...
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