Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZODB
Commits
da2341b4
Commit
da2341b4
authored
Nov 19, 2009
by
Chris Withers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make it possible to run this test from a buildout environment.
parent
104d6dc4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
5 deletions
+18
-5
src/ZODB/scripts/manual_tests/testrepozo.py
src/ZODB/scripts/manual_tests/testrepozo.py
+18
-5
No files found.
src/ZODB/scripts/manual_tests/testrepozo.py
View file @
da2341b4
...
...
@@ -19,6 +19,16 @@ This is a by-hand test. It succeeds iff it doesn't blow up. Run it with
its home directory as the current directory. It will destroy all files
matching Data.* and Copy.* in this directory, and anything in a
subdirectory of name 'backup'.
Usage:
python testrepozo.py [repozo_script]
repozo_script, if provided, is a path to a script that runs repozo,
such as that generated by buildout.
eg:
$ ../../../../bin/py testrepozo.py ../../../../bin/repozo
"""
import
os
...
...
@@ -32,8 +42,6 @@ import ZODB
from
ZODB
import
FileStorage
import
transaction
PYTHON
=
sys
.
executable
+
' '
def
cleanup
():
for
fname
in
glob
.
glob
(
'Data.*'
)
+
glob
.
glob
(
'Copy.*'
):
os
.
remove
(
fname
)
...
...
@@ -76,7 +84,7 @@ def check(correctpath='Data.fs', when=None):
extra
=
''
else
:
extra
=
' -D '
+
when
cmd
=
PYTHON
+
'../repozo.py
-vRr backup -o Copy.fs'
+
extra
cmd
=
PYTHON
+
REPOZO
+
'
-vRr backup -o Copy.fs'
+
extra
os
.
system
(
cmd
)
f
=
file
(
correctpath
,
'rb'
)
g
=
file
(
'Copy.fs'
,
'rb'
)
...
...
@@ -122,9 +130,9 @@ def main():
# Make an incremental backup, half the time with gzip (-z).
if
random
.
random
()
<
0.5
:
os
.
system
(
PYTHON
+
'../repozo.py
-vBQr backup -f Data.fs'
)
os
.
system
(
PYTHON
+
REPOZO
+
'
-vBQr backup -f Data.fs'
)
else
:
os
.
system
(
PYTHON
+
'../repozo.py
-zvBQr backup -f Data.fs'
)
os
.
system
(
PYTHON
+
REPOZO
+
'
-zvBQr backup -f Data.fs'
)
if
i
%
9
==
0
:
copytime
=
'%04d-%02d-%02d-%02d-%02d-%02d'
%
(
time
.
gmtime
()[:
6
])
...
...
@@ -148,4 +156,9 @@ def main():
print
'Test passed!'
if
__name__
==
'__main__'
:
PYTHON
=
sys
.
executable
+
' '
if
len
(
sys
.
argv
)
>
1
:
REPOZO
=
sys
.
argv
[
1
]
else
:
REPOZO
=
'../repozo.py'
main
()
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