Commit 6611b45c authored by Jeremy Hylton's avatar Jeremy Hylton

Add test of -W option

parent 472fcada
from __future__ import nested_scopes
# Some simple tests for zeopack.py
# For this to work, zeopack.py must by on your PATH.
......@@ -9,6 +10,8 @@ import ZODB
import os
import socket
import tempfile
import threading
import time
import unittest
# XXX The forker interface isn't clearly defined. It's different on
......@@ -47,7 +50,8 @@ class PackerTests(StorageTestBase):
try:
os.waitpid(self.pid, 0)
except os.error, err:
print err
##print "waitpid failed", err
pass
for ext in '', '.old', '.lock', '.index', '.tmp':
path = self.path + ext
try:
......@@ -87,6 +91,19 @@ class PackerTests(StorageTestBase):
status = os.system("zeopack.py -p 19")
assert status != 0
def testWaitForServer(self):
self.set_inet_addr()
def delayed_start():
time.sleep(11)
self.start()
t = threading.Thread(target=delayed_start)
t.start()
status = os.system("zeopack.py -h %s -p %s -W" % (self.host,
self.port))
t.join()
assert status == 0
assert os.path.exists(self.path + ".old")
class UpTest(unittest.TestCase):
def testUp(self):
......
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