Commit d2cd2fd1 authored by Jeremy Hylton's avatar Jeremy Hylton

Add test of -W option

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