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
d1fc5e8c
Commit
d1fc5e8c
authored
Jun 06, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
bfad5de1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+7
-5
No files found.
wcfs/wcfs_test.py
View file @
d1fc5e8c
...
@@ -436,8 +436,10 @@ class tFile:
...
@@ -436,8 +436,10 @@ class tFile:
# assertBlk asserts that file block #blk has data as expected.
# assertBlk asserts that file block #blk has data as expected.
#
#
# Expected data may be given with size < t.blksize. In such case the data
# Expected data may be given with size < t.blksize. In such case the data
# is implicitly appended with trailing zeros.
# is implicitly appended with trailing zeros.
Data can be both bytes and unicode.
def
assertBlk
(
t
,
blk
,
data
):
def
assertBlk
(
t
,
blk
,
data
):
if
not
isinstance
(
data
,
bytes
):
data
=
data
.
encode
(
'utf-8'
)
assert
len
(
data
)
<=
t
.
blksize
assert
len
(
data
)
<=
t
.
blksize
data
+=
b'
\
0
'
*
(
t
.
blksize
-
len
(
data
))
# tailing zeros
data
+=
b'
\
0
'
*
(
t
.
blksize
-
len
(
data
))
# tailing zeros
assert
blk
<
t
.
_sizeinblk
()
assert
blk
<
t
.
_sizeinblk
()
...
@@ -767,7 +769,6 @@ def watch(twlink, zf, at): # XXX -> ?
...
@@ -767,7 +769,6 @@ def watch(twlink, zf, at): # XXX -> ?
# if replyok ends with '…' only reply prefix until the dots is checked.
# if replyok ends with '…' only reply prefix until the dots is checked.
@
func
(
tWatchLink
)
@
func
(
tWatchLink
)
def
_watch
(
twlink
,
zf
,
at
,
pinok
,
replyok
):
def
_watch
(
twlink
,
zf
,
at
,
pinok
,
replyok
):
# send watch request and check that we receive pins for in-cache blocks
# send watch request and check that we receive pins for in-cache blocks
# changed > at. Use timeout to detect wcfs replying less pins than expected.
# changed > at. Use timeout to detect wcfs replying less pins than expected.
#
#
...
@@ -956,10 +957,11 @@ def test_wcfs():
...
@@ -956,10 +957,11 @@ def test_wcfs():
wl
=
t
.
openwatch
()
wl
=
t
.
openwatch
()
wl
.
watch
(
zf
,
t
.
head
)
wl
.
watch
(
zf
,
t
.
head
)
f
.
assertCache
([
1
,
1
,
1
,
1
])
f
.
assertCache
([
1
,
1
,
1
,
1
])
# t.change(zf, {0: '4a', 2: '4c', 5: '4f'}) FIXME enable 4a after δbtree works
t
.
change
(
zf
,
{
2
:
'4c'
,
5
:
'4f'
})
# FIXME + 4a after δbtree works
t
.
change
(
zf
,
{
2
:
'4c'
,
5
:
'4f'
})
at4
=
t
.
commit
()
at4
=
t
.
commit
()
f
.
assertCache
([
1
,
1
,
0
,
1
,
0
,
0
])
# FIXME a must be invalidated - see ^^^
f
.
assertCache
([
1
,
1
,
0
,
1
,
0
,
0
])
# FIXME a must be invalidated - see ^^^
f
.
assertBlk
(
2
,
'4c'
)
->
pin
2
# XXX commit after current file size -> watch
# XXX commit after current file size -> watch
...
...
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