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
8e1d0ce4
Commit
8e1d0ce4
authored
May 27, 2016
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated for new underware and new higher minimum protocol
parent
eda1bb08
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
30 deletions
+9
-30
src/ZEO/tests/protocols.test
src/ZEO/tests/protocols.test
+9
-30
No files found.
src/ZEO/tests/protocols.test
View file @
8e1d0ce4
...
...
@@ -17,15 +17,15 @@ Let's start a Z308 server
...
'''
>>> addr, admin = start_server(
... storage_conf, dict(invalidation_queue_size=5), protocol=b'
Z30
8
')
... storage_conf, dict(invalidation_queue_size=5), protocol=b'
Z30
9
')
A current client should be able to connect to a old server:
>>> import ZEO, ZODB.blob, transaction
>>> db = ZEO.DB(addr, client='
client
', blob_dir='
blobs
')
>>> wait_connected(db.storage)
>>> db.storage.
_connection.peer_
protocol_version
b'
Z30
8
'
>>> db.storage.protocol_version
b'
Z30
9
'
>>> conn = db.open()
>>> conn.root().x = 0
...
...
@@ -85,13 +85,6 @@ A current client should be able to connect to a old server:
... f.read()
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()
>>> db.close()
>>> stop_server(admin)
...
...
@@ -107,13 +100,13 @@ And the other way around:
Note that we'
ll
have
to
pull
some
hijinks
:
>>> import ZEO.
zrpc.connection
>>> old_
current_protocol = ZEO.zrpc.connection.Connection.current_protocol
>>> ZEO.
zrpc.connection.Connection.current_protocol = b'
Z308
'
>>>
import
ZEO
.
asyncio
.
client
>>>
old_
protocols
=
ZEO
.
asyncio
.
client
.
Protocol
.
protocols
>>>
ZEO
.
asyncio
.
client
.
Protocol
.
protocols
=
[
b
'Z309'
]
>>>
db
=
ZEO
.
DB
(
addr
,
client
=
'client'
,
blob_dir
=
'blobs'
)
>>> db.storage.
_connection.peer_
protocol_version
b'
Z30
8
'
>>>
db
.
storage
.
protocol_version
b
'Z30
9
'
>>>
wait_connected
(
db
.
storage
)
>>>
conn
=
db
.
open
()
>>>
conn
.
root
()
.
x
=
0
...
...
@@ -174,23 +167,9 @@ Note that we'll have to pull some hijinks:
...
f
.
read
()
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
()
>>>
db
.
close
()
Undo
the
hijinks
:
>>>
ZEO
.
zrpc
.
connection
.
Connection
.
current_protocol
=
old_current_protocol
>>>
ZEO
.
asyncio
.
client
.
Protocol
.
protocols
=
old_protocols
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