Commit 8e1d0ce4 authored by Jim Fulton's avatar Jim Fulton

Updated for new underware and new higher minimum protocol

parent eda1bb08
...@@ -17,15 +17,15 @@ Let's start a Z308 server ...@@ -17,15 +17,15 @@ Let's start a Z308 server
... ''' ... '''
>>> addr, admin = start_server( >>> addr, admin = start_server(
... storage_conf, dict(invalidation_queue_size=5), protocol=b'Z308') ... storage_conf, dict(invalidation_queue_size=5), protocol=b'Z309')
A current client should be able to connect to a old server: A current client should be able to connect to a old server:
>>> import ZEO, ZODB.blob, transaction >>> import ZEO, ZODB.blob, transaction
>>> db = ZEO.DB(addr, client='client', blob_dir='blobs') >>> db = ZEO.DB(addr, client='client', blob_dir='blobs')
>>> wait_connected(db.storage) >>> wait_connected(db.storage)
>>> db.storage._connection.peer_protocol_version >>> db.storage.protocol_version
b'Z308' b'Z309'
>>> conn = db.open() >>> conn = db.open()
>>> conn.root().x = 0 >>> conn.root().x = 0
...@@ -85,13 +85,6 @@ A current client should be able to connect to a old server: ...@@ -85,13 +85,6 @@ A current client should be able to connect to a old server:
... f.read() ... f.read()
b'blob data 2' b'blob data 2'
Note that when taking to a 3.8 server, iteration won't work:
>>> db.storage.iterator()
Traceback (most recent call last):
...
NotImplementedError
>>> db2.close() >>> db2.close()
>>> db.close() >>> db.close()
>>> stop_server(admin) >>> stop_server(admin)
...@@ -107,13 +100,13 @@ And the other way around: ...@@ -107,13 +100,13 @@ And the other way around:
Note that we'll have to pull some hijinks: Note that we'll have to pull some hijinks:
>>> import ZEO.zrpc.connection >>> import ZEO.asyncio.client
>>> old_current_protocol = ZEO.zrpc.connection.Connection.current_protocol >>> old_protocols = ZEO.asyncio.client.Protocol.protocols
>>> ZEO.zrpc.connection.Connection.current_protocol = b'Z308' >>> ZEO.asyncio.client.Protocol.protocols = [b'Z309']
>>> db = ZEO.DB(addr, client='client', blob_dir='blobs') >>> db = ZEO.DB(addr, client='client', blob_dir='blobs')
>>> db.storage._connection.peer_protocol_version >>> db.storage.protocol_version
b'Z308' b'Z309'
>>> wait_connected(db.storage) >>> wait_connected(db.storage)
>>> conn = db.open() >>> conn = db.open()
>>> conn.root().x = 0 >>> conn.root().x = 0
...@@ -174,23 +167,9 @@ Note that we'll have to pull some hijinks: ...@@ -174,23 +167,9 @@ Note that we'll have to pull some hijinks:
... f.read() ... f.read()
b'blob data 2' b'blob data 2'
Make some old protocol calls:
>>> db.storage._server.rpc.call('getSerial', conn.root()._p_oid
... ) == conn.root()._p_serial
True
>>> p, s, v, x, y = db.storage._server.rpc.call('zeoLoad',
... conn.root()._p_oid)
>>> (v, x, y) == ('', None, None)
True
>>> db.storage.load(conn.root()._p_oid) == (p, s)
True
>>> db2.close() >>> db2.close()
>>> db.close() >>> db.close()
Undo the hijinks: Undo the hijinks:
>>> ZEO.zrpc.connection.Connection.current_protocol = old_current_protocol >>> ZEO.asyncio.client.Protocol.protocols = old_protocols
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