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
d750f5e5
Commit
d750f5e5
authored
Mar 04, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
ac8dfb69
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
10 deletions
+26
-10
wcfs/client/client_test.py
wcfs/client/client_test.py
+26
-10
No files found.
wcfs/client/client_test.py
View file @
d750f5e5
...
...
@@ -29,6 +29,7 @@ from __future__ import print_function, absolute_import
from
golang
import
func
,
defer
,
b
from
golang.golang_test
import
panics
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
...
...
@@ -180,30 +181,39 @@ def test_wcfs_client():
@
func
def
test_wcfs_client_down_efault
():
# XXX all fileh / mappings become invalid after wconn.close
t
=
tDB
();
zf
=
t
.
zfile
;
at0
=
t
.
at0
t
=
tDB
();
zf
1
=
t
.
zfile
;
at0
=
t
.
at0
defer
(
t
.
close
)
at1
=
t
.
commit
(
zf
,
{
2
:
'c1'
,
3
:
'd1'
})
at1
=
t
.
commit
(
zf1
,
{
2
:
'c1'
,
3
:
'd1'
})
zf2
=
t
.
root
[
'zfile2'
]
=
ZBigFile
(
zf1
.
blksize
)
# XXX blksize=zf1.blksize?
at2
=
t
.
commit
()
at3
=
t
.
commit
(
zf2
,
{
1
:
'β3'
,
2
:
'γ3'
})
wconn
=
t
.
wc
.
connect
(
at1
)
defer
(
wconn
.
close
)
fh1
=
wconn
.
open
(
zf
.
_p_oid
)
defer
(
fh1
.
close
)
m11
=
fh1
.
mmap
(
1
,
4
);
defer
(
m11
.
unmap
)
m12
=
fh1
.
mmap
(
3
,
3
);
defer
(
m12
.
unmap
)
fh1
=
wconn
.
open
(
zf1
.
_p_oid
);
defer
(
fh1
.
close
)
fh2
=
wconn
.
open
(
zf2
.
_p_oid
);
defer
(
fh2
.
close
)
tm11
=
tMapping
(
t
,
m11
)
tm12
=
tMapping
(
t
,
m12
)
m11
=
fh1
.
mmap
(
1
,
4
);
defer
(
m11
.
unmap
);
tm11
=
tMapping
(
t
,
m11
)
m12
=
fh1
.
mmap
(
3
,
3
);
defer
(
m12
.
unmap
);
tm12
=
tMapping
(
t
,
m12
)
m21
=
fh2
.
mmap
(
0
,
4
);
defer
(
m21
.
unmap
);
tm21
=
tMapping
(
t
,
m21
)
m22
=
fh2
.
mmap
(
2
,
3
);
defer
(
m22
.
unmap
);
tm22
=
tMapping
(
t
,
m22
)
# initially fh1 and fh2 mmaps read ok.
tm11
.
assertBlk
(
1
,
''
,
{})
tm11
.
assertBlk
(
2
,
'c1'
,
{})
tm11
.
assertBlk
(
3
,
'd1'
,
{});
tm12
.
assertBlk
(
3
,
'd1'
,
{})
tm11
.
assertBlk
(
4
,
''
,
{});
tm12
.
assertBlk
(
4
,
''
,
{})
pass
;
tm12
.
assertBlk
(
5
,
''
,
{})
# close fh1 -> all fh1 mmaps must turn into efaulting memory.
tm21
.
assertBlk
(
0
,
''
,
{})
tm21
.
assertBlk
(
1
,
'β3'
,
{})
tm21
.
assertBlk
(
2
,
'γ3'
,
{});
tm22
.
assertBlk
(
2
,
'γ3'
,
{})
tm21
.
assertBlk
(
3
,
''
,
{});
tm22
.
assertBlk
(
3
,
''
,
{})
pass
;
tm22
.
assertBlk
(
4
,
''
,
{})
# close fh1 -> all fh1 mmaps must turn into efaulting memory; fh2 mmaps continue to work ok.
fh1
.
close
()
tm11
.
assertBlkFaults
(
1
)
tm11
.
assertBlkFaults
(
2
)
...
...
@@ -211,6 +221,12 @@ def test_wcfs_client_down_efault():
tm11
.
assertBlkFaults
(
4
);
tm12
.
assertBlkFaults
(
4
)
pass
;
tm12
.
assertBlkFaults
(
5
)
tm21
.
assertBlk
(
0
,
''
,
{})
tm21
.
assertBlk
(
1
,
'β3'
,
{})
tm21
.
assertBlk
(
2
,
'γ3'
,
{});
tm22
.
assertBlk
(
2
,
'γ3'
,
{})
tm21
.
assertBlk
(
3
,
''
,
{});
tm22
.
assertBlk
(
3
,
''
,
{})
pass
;
tm22
.
assertBlk
(
4
,
''
,
{})
# 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