Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
28cf516f
Commit
28cf516f
authored
Oct 02, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
54192026
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+32
-0
No files found.
wcfs/wcfs_test.py
View file @
28cf516f
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
"""test wcfs filesystem from outside as python client process"""
"""test wcfs filesystem from outside as python client process"""
from
wendelin.lib.testing
import
getTestDB
from
wendelin.lib.testing
import
getTestDB
from
wendelin.lib.mem
import
memcpy
from
wendelin.bigfile.file_zodb
import
ZBigFile
from
wendelin.bigfile.file_zodb
import
ZBigFile
from
wendelin.bigfile.tests.test_filezodb
import
blksize
from
wendelin.bigfile.tests.test_filezodb
import
blksize
from
wendelin
import
wcfs
from
wendelin
import
wcfs
...
@@ -158,6 +159,37 @@ def test_bigfile_empty():
...
@@ -158,6 +159,37 @@ def test_bigfile_empty():
assert
readfile
(
fpath
+
"/head/at"
)
==
tid2
.
encode
(
'hex'
)
assert
readfile
(
fpath
+
"/head/at"
)
==
tid2
.
encode
(
'hex'
)
# TODO check head/at syncs to later non-bigfile commits
# TODO check head/at syncs to later non-bigfile commits
# commit data to f and make sure we can see it on wcfs
fh
=
f
.
fileh_open
()
vma
=
fh
.
mmap
(
10
,
1
)
# 1 page at offset=10
s
=
b"hello world"
memcpy
(
vma
,
s
)
last
.
_p_changed
=
1
transaction
.
commit
()
tidlast
=
last
.
_p_serial
# XXX force sync of wcfs - how?
fsize
=
10
*
blksize
+
len
(
s
)
# trailing \0 not counted XXX ok?
"""
st = os.stat(fpath + "/head/data")
assert st.st_size == fsize
assert st.st_mtime == tidtime(tidlast)
assert readfile(fpath + "/head/at") == tidlast.encode("hex")
"""
data
=
readfile
(
fpath
+
"/head/data"
)
assert
len
(
data
)
==
fsize
for
i
in
range
(
10
):
assert
data
[
i
*
blksize
:(
i
+
1
)
*
blksize
]
==
b'
\
0
'
*
blksize
assert
data
[
10
*
blksize
:]
==
s
wc
.
close
()
wc
.
close
()
...
...
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