merged with trunk
This commit is contained in:
commit
014d8e0d8d
@ -61,7 +61,7 @@ Instructions for Building Debian Packages for Swift
|
|||||||
apt-get install curl gcc bzr python-configobj python-coverage python-dev
|
apt-get install curl gcc bzr python-configobj python-coverage python-dev
|
||||||
python-nose python-setuptools python-simplejson python-xattr
|
python-nose python-setuptools python-simplejson python-xattr
|
||||||
python-webob python-eventlet python-greenlet debhelper python-sphinx
|
python-webob python-eventlet python-greenlet debhelper python-sphinx
|
||||||
python-all python-openssl
|
python-all python-openssl python-pastedeploy
|
||||||
|
|
||||||
* As you
|
* As you
|
||||||
|
|
||||||
|
@ -102,10 +102,9 @@ class TestObjectUpdater(unittest.TestCase):
|
|||||||
self.assert_(os.path.exists(op_path))
|
self.assert_(os.path.exists(op_path))
|
||||||
|
|
||||||
bindsock = listen(('127.0.0.1', 0))
|
bindsock = listen(('127.0.0.1', 0))
|
||||||
def accept(return_code):
|
def accepter(sock, return_code):
|
||||||
try:
|
try:
|
||||||
with Timeout(3):
|
with Timeout(3):
|
||||||
sock, addr = bindsock.accept()
|
|
||||||
inc = sock.makefile('rb')
|
inc = sock.makefile('rb')
|
||||||
out = sock.makefile('wb')
|
out = sock.makefile('wb')
|
||||||
out.write('HTTP/1.1 %d OK\r\nContent-Length: 0\r\n\r\n' %
|
out.write('HTTP/1.1 %d OK\r\nContent-Length: 0\r\n\r\n' %
|
||||||
@ -123,15 +122,28 @@ class TestObjectUpdater(unittest.TestCase):
|
|||||||
except BaseException, err:
|
except BaseException, err:
|
||||||
return err
|
return err
|
||||||
return None
|
return None
|
||||||
events = [spawn(accept, 201), spawn(accept, 201)]
|
def accept(return_code):
|
||||||
|
try:
|
||||||
|
events = []
|
||||||
|
for x in xrange(2):
|
||||||
|
with Timeout(3):
|
||||||
|
sock, addr = bindsock.accept()
|
||||||
|
events.append(spawn(accepter, sock, return_code))
|
||||||
|
for event in events:
|
||||||
|
err = event.wait()
|
||||||
|
if err:
|
||||||
|
raise err
|
||||||
|
except BaseException, err:
|
||||||
|
return err
|
||||||
|
return None
|
||||||
|
event = spawn(accept, 201)
|
||||||
for dev in cu.get_container_ring().devs:
|
for dev in cu.get_container_ring().devs:
|
||||||
if dev is not None:
|
if dev is not None:
|
||||||
dev['port'] = bindsock.getsockname()[1]
|
dev['port'] = bindsock.getsockname()[1]
|
||||||
cu.update_once_single_threaded()
|
cu.update_once_single_threaded()
|
||||||
for event in events:
|
err = event.wait()
|
||||||
err = event.wait()
|
if err:
|
||||||
if err:
|
raise err
|
||||||
raise err
|
|
||||||
self.assert_(not os.path.exists(op_path))
|
self.assert_(not os.path.exists(op_path))
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user