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
1f6813ce
Commit
1f6813ce
authored
Dec 05, 2008
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added instantiations of the generic blob tests for ClientStorage.
parent
e477014a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
0 deletions
+53
-0
src/ZEO/tests/testZEO.py
src/ZEO/tests/testZEO.py
+53
-0
No files found.
src/ZEO/tests/testZEO.py
View file @
1f6813ce
...
...
@@ -27,9 +27,11 @@ import unittest
import
shutil
# ZODB test support
import
ZEO.ServerStub
import
ZODB
import
ZODB.blob
import
ZODB.tests.util
import
ZODB.tests.testblob
from
ZODB.tests.MinPO
import
MinPO
from
ZODB.tests.StorageTestBase
import
zodb_unpickle
import
persistent
...
...
@@ -1156,6 +1158,49 @@ slow_test_classes = [
quick_test_classes
=
[
FileStorageRecoveryTests
,
ConfigurationTests
]
class
ServerManagingClientStorage
(
ClientStorage
):
class
StorageServerStubClass
(
ZEO
.
ServerStub
.
StorageServer
):
# Wait for abort for the benefit of blob_transacton.txt
def
tpc_abort
(
self
,
id
):
self
.
rpc
.
call
(
'tpc_abort'
,
id
)
def
__init__
(
self
,
name
,
blob_dir
,
shared
=
False
):
if
shared
:
server_blob_dir
=
blob_dir
else
:
server_blob_dir
=
'server-'
+
blob_dir
self
.
globs
=
{}
port
=
forker
.
get_port2
(
self
)
addr
,
admin
,
pid
,
config
=
forker
.
start_zeo_server
(
"""
<blobstorage>
blob-dir %s
<filestorage>
path %s
</filestorage>
</blobstorage>
"""
%
(
server_blob_dir
,
name
+
'.fs'
),
port
=
port
,
)
os
.
remove
(
config
)
zope
.
testing
.
setupstack
.
register
(
self
,
os
.
waitpid
,
pid
,
0
)
zope
.
testing
.
setupstack
.
register
(
self
,
forker
.
shutdown_zeo_server
,
admin
)
if
shared
:
ClientStorage
.
__init__
(
self
,
addr
,
blob_dir
=
blob_dir
,
shared_blob_dir
=
True
)
else
:
ClientStorage
.
__init__
(
self
,
addr
,
blob_dir
=
blob_dir
)
def
close
(
self
):
ClientStorage
.
close
(
self
)
zope
.
testing
.
setupstack
.
tearDown
(
self
)
def
create_storage_shared
(
name
,
blob_dir
):
return
ServerManagingClientStorage
(
name
,
blob_dir
,
True
)
def
test_suite
():
suite
=
unittest
.
TestSuite
()
...
...
@@ -1186,6 +1231,14 @@ def test_suite():
sub
=
unittest
.
makeSuite
(
klass
,
"check"
)
sub
.
layer
=
ZODB
.
tests
.
util
.
MininalTestLayer
(
klass
.
__name__
)
suite
.
addTest
(
sub
)
suite
.
addTest
(
ZODB
.
tests
.
testblob
.
storage_reusable_suite
(
'ClientStorageNonSharedBlobs'
,
ServerManagingClientStorage
,
test_blob_storage_recovery
=
False
))
suite
.
addTest
(
ZODB
.
tests
.
testblob
.
storage_reusable_suite
(
'ClientStorageSharedBlobs'
,
create_storage_shared
,
test_blob_storage_recovery
=
False
))
return
suite
...
...
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