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
bb418b15
Commit
bb418b15
authored
Mar 04, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
745d8cd2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
wcfs/client/client_test.py
wcfs/client/client_test.py
+13
-6
No files found.
wcfs/client/client_test.py
View file @
bb418b15
...
...
@@ -27,14 +27,16 @@ wcfs.py/wcfs.go while running tox tests in wcfs mode.
from
__future__
import
print_function
,
absolute_import
from
golang
import
func
,
defer
,
b
from
golang.golang_test
import
panics
from
golang
import
func
,
defer
,
error
,
b
from
wendelin.bigfile.file_zodb
import
ZBigFile
from
wendelin.wcfs.wcfs_test
import
tDB
,
tAt
from
wendelin.wcfs
import
wcfs_test
from
wendelin.wcfs.internal.wcfs_test
import
read_mustfault
from
wendelin.wcfs.internal
import
mm
from
pytest
import
raises
from
golang.golang_test
import
panics
# XXX so that e.g. testdb is set up + ...
def
setup_module
():
wcfs_test
.
setup_module
()
def
teardown_module
():
wcfs_test
.
teardown_module
()
...
...
@@ -173,14 +175,10 @@ def test_wcfs_client():
# XXX fh close then open again and use
# XXX open same fh twice, close once - fh2 continue to work ok
# XXX wconn.open() after wconn.close() -> error
# XXX wconn.resync() after wconn.close() -> error
# verify that on Conn/FileH down/closed -> Mappings switch to EFAULT on access.
@
func
def
test_wcfs_client_down_efault
():
# XXX all fileh / mappings become invalid after wconn.close
t
=
tDB
();
zf1
=
t
.
zfile
;
at0
=
t
.
at0
defer
(
t
.
close
)
...
...
@@ -241,6 +239,15 @@ def test_wcfs_client_down_efault():
tm21
.
assertBlkFaults
(
3
);
tm22
.
assertBlkFaults
(
3
)
pass
;
tm22
.
assertBlkFaults
(
4
)
# XXX vvv -> separate test?
# verify that after wconn.close()
# wconn.open(), wconn.resync(), fh.mmap() -> error
with
raises
(
error
,
match
=
".*: connection closed"
):
wconn
.
open
(
zf1
.
_p_oid
)
with
raises
(
error
,
match
=
".*: connection closed"
):
wconn
.
resync
(
at3
)
with
raises
(
error
,
match
=
".*: file already closed"
):
fh2
.
mmap
(
2
,
3
)
# NOTE we did not close fh2 yet
# ----//---- after fileh.close
with
raises
(
error
,
match
=
".*: file already closed"
):
fh1
.
mmap
(
2
,
3
)
# fh1 was explicitly closed ^^^
# verify that read_mustfault works as expected.
def
test_read_mustfault
():
...
...
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