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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Joshua
wendelin.core
Commits
326c880b
Commit
326c880b
authored
Mar 04, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
6b345422
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
8 deletions
+30
-8
wcfs/client/client_test.py
wcfs/client/client_test.py
+23
-6
wcfs/internal/wcfs_test.pyx
wcfs/internal/wcfs_test.pyx
+7
-2
No files found.
wcfs/client/client_test.py
View file @
326c880b
...
...
@@ -86,6 +86,18 @@ class tMapping(object):
# XXX assertData
# assertBlkFaults asserts that mmap[·] with · corresponding to blk raises
# SIGSEGV on read access.
def
assertBlkFaults
(
t
,
blk
):
assert
t
.
mmap
.
blk_start
<=
blk
<
t
.
mmap
.
blk_stop
blk_inmmap
=
blk
-
t
.
mmap
.
blk_start
fh
=
t
.
mmap
.
fileh
blkview
=
t
.
mmap
.
mem
[
blk_inmmap
*
fh
.
blksize
:][:
fh
.
blksize
]
for
i
in
range
(
0
,
len
(
blkview
),
8
):
# XXX 8 too frequent?
read_mustfault
(
blkview
[
i
:][:
1
])
# fhpinned(fh) returns fh.pinned with rev wrapped into tAt.
# XXX better wrap FileH into tFileH and do this automatically in .pinned ?
def
fhpinned
(
t
,
fh
):
...
...
@@ -186,15 +198,20 @@ def test_wcfs_client_down_efault():
tm1
.
assertBlk
(
2
,
'c1'
,
{})
tm1
.
assertBlk
(
3
,
'd1'
,
{})
with
panics
(
"not faulted"
):
read_mustfault
(
m1
.
mem
[
0
*
zf
.
blksize
:][:
1
])
with
panics
(
"not faulted"
):
read_mustfault
(
m1
.
mem
[
1
*
zf
.
blksize
:][:
1
])
with
panics
(
"not faulted"
):
tm1
.
assertBlkFaults
(
2
)
with
panics
(
"not faulted"
):
tm1
.
assertBlkFaults
(
3
)
#with panics("not faulted"): read_mustfault(m1.mem[0*zf.blksize:][:1])
#with panics("not faulted"): read_mustfault(m1.mem[1*zf.blksize:][:1])
assert
m1
.
mem
[
0
*
zf
.
blksize
]
==
b'c'
assert
m1
.
mem
[
1
*
zf
.
blksize
]
==
b'd'
return
#assert m1.mem[0*zf.blksize] == b'c'
#assert m1.mem[1*zf.blksize] == b'd'
# close fileh -> m1 must turn into efaulting memory
# XXX verify whole block?
fh
.
close
()
read_mustfault
(
m1
.
mem
[
0
*
zf
.
blksize
:][:
1
])
read_mustfault
(
m1
.
mem
[
1
*
zf
.
blksize
:][:
1
])
tm1
.
assertBlkFaults
(
1
)
# XXX
tm1
.
assertBlkFaults
(
2
)
tm1
.
assertBlkFaults
(
3
)
wcfs/internal/wcfs_test.pyx
View file @
326c880b
...
...
@@ -138,8 +138,13 @@ def read_mustfault(const unsigned char[::1] mem not None):
with
nogil
:
mustfaultMu
.
lock
()
try
:
with
nogil
:
_read_mustfault
(
&
mem
[
0
])
mustfaultMu
.
unlock
()
# XXX not released on panic
finally
:
with
nogil
:
mustfaultMu
.
unlock
()
# --------
...
...
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