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
f99178af
Commit
f99178af
authored
Jul 17, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
39f1bd67
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+7
-4
No files found.
wcfs/wcfs_test.py
View file @
f99178af
...
@@ -462,6 +462,11 @@ class tFile:
...
@@ -462,6 +462,11 @@ class tFile:
t
.
f
=
tdb
.
wc
.
_open
(
zf
,
at
=
at
)
t
.
f
=
tdb
.
wc
.
_open
(
zf
,
at
=
at
)
t
.
blksize
=
zf
.
blksize
t
.
blksize
=
zf
.
blksize
# make sure that wcfs reports zf.blksize as preffered block size for IO.
# wcfs.py also uses .st_blksize in blk -> byte offset computation.
st
=
os
.
fstat
(
t
.
f
.
fileno
())
assert
st
.
st_blksize
==
t
.
blksize
# mmap the file past the end up to _max_tracked_pages and setup
# mmap the file past the end up to _max_tracked_pages and setup
# invariants on which we rely to verify OS cache state:
# invariants on which we rely to verify OS cache state:
#
#
...
@@ -551,6 +556,7 @@ class tFile:
...
@@ -551,6 +556,7 @@ class tFile:
# _sizeinblk returns file size in blocks.
# _sizeinblk returns file size in blocks.
def
_sizeinblk
(
t
):
def
_sizeinblk
(
t
):
st
=
os
.
fstat
(
t
.
f
.
fileno
())
st
=
os
.
fstat
(
t
.
f
.
fileno
())
assert
st
.
st_blksize
==
t
.
blksize
# just in case
assert
st
.
st_size
%
t
.
blksize
==
0
assert
st
.
st_size
%
t
.
blksize
==
0
assert
st
.
st_size
//
t
.
blksize
<=
t
.
_max_tracked_pages
assert
st
.
st_size
//
t
.
blksize
<=
t
.
_max_tracked_pages
return
st
.
st_size
//
t
.
blksize
return
st
.
st_size
//
t
.
blksize
...
@@ -700,6 +706,7 @@ class tFile:
...
@@ -700,6 +706,7 @@ class tFile:
# The file size and optionally mtime are also verified.
# The file size and optionally mtime are also verified.
def
assertData
(
t
,
dataokv
,
mtime
=
None
):
def
assertData
(
t
,
dataokv
,
mtime
=
None
):
st
=
os
.
fstat
(
t
.
f
.
fileno
())
st
=
os
.
fstat
(
t
.
f
.
fileno
())
assert
st
.
st_blksize
==
t
.
blksize
assert
st
.
st_size
==
len
(
dataokv
)
*
t
.
blksize
assert
st
.
st_size
==
len
(
dataokv
)
*
t
.
blksize
if
mtime
is
not
None
:
if
mtime
is
not
None
:
assert
st
.
st_mtime
==
tidtime
(
mtime
)
assert
st
.
st_mtime
==
tidtime
(
mtime
)
...
@@ -1074,10 +1081,6 @@ def test_wcfs_basic():
...
@@ -1074,10 +1081,6 @@ def test_wcfs_basic():
t
.
wc
.
_stat
(
"head/bigfile/%s"
%
h
(
t
.
nonzfile
.
_p_oid
))
t
.
wc
.
_stat
(
"head/bigfile/%s"
%
h
(
t
.
nonzfile
.
_p_oid
))
assert
exc
.
value
.
errno
==
EINVAL
assert
exc
.
value
.
errno
==
EINVAL
# make sure that wcfs reports zf.blksize as preffered block size for IO
_
=
t
.
wc
.
_stat
(
zf
)
assert
_
.
st_blksize
==
zf
.
blksize
# >>> file initially empty
# >>> file initially empty
f
=
t
.
open
(
zf
)
f
=
t
.
open
(
zf
)
f
.
assertCache
([])
f
.
assertCache
([])
...
...
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