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
31eb89c3
Commit
31eb89c3
authored
May 21, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
2bd7052a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
11 deletions
+14
-11
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+14
-11
No files found.
wcfs/wcfs_test.py
View file @
31eb89c3
...
...
@@ -425,7 +425,7 @@ class tFile:
t
.
assertCache
([
1
]
*
len
(
datav
))
# tWatch provides testing environment for /head/watch opened on wcfs.
# tWatch provides testing environment for /head/watch
link
opened on wcfs.
#
# .sendReq()/.recvReq() provides raw IO in terms of wcfs invalidation protocol messages.
# .watch() setups a watch for a file and verifies ... XXX
...
...
@@ -486,24 +486,26 @@ class tWatch:
t
.
wtx
.
close
()
t
.
wrx
.
close
()
# wakeup everyone waiting for rx
t
.
_acceptq
.
close
()
with
t
.
_rxmu
:
rxtab
=
t
.
_rxtab
t
.
_rxtab
=
None
# don't allow new rxtab registers
for
rxq
in
rxtab
.
values
():
rxq
.
close
()
# ---- message IO ----
# _serveRecv receives messages from .w and dispatches them according to streamID.
@
func
def
_serveRecv
(
t
,
ctx
):
# when finishing - wakeup everyone waiting for rx
def
_
():
t
.
_acceptq
.
close
()
with
t
.
_rxmu
:
rxtab
=
t
.
_rxtab
t
.
_rxtab
=
None
# don't allow new rxtab registers
for
rxq
in
rxtab
.
values
():
rxq
.
close
()
defer
(
_
)
while
1
:
# NOTE: .close() makes sure .wrx.read*() will wake up
l
=
t
.
wrx
.
readline
()
#
print('C: watch : rx: %r' % l)
print
(
'C: watch : rx: %r'
%
l
)
if
len
(
l
)
==
0
:
break
# closed
...
...
@@ -550,7 +552,7 @@ class tWatch:
# sendReq sends client -> server request and returns server reply.
#
# only 1 sendReq must be used at a time. # XXX relax?
def
sendReq
(
t
,
ctx
,
req
):
def
sendReq
(
t
,
ctx
,
req
):
# reply | None when EOF
stream
=
1
rxq
=
chan
()
...
...
@@ -843,6 +845,7 @@ def test_wcfs():
print
(
'
\
n
\
n
inv. protocol
\
n
\
n
'
)
# XXX invalid requests -> wcfs replies error
# XXX -> separate test?
w
=
t
.
openwatch
()
assert
w
.
sendReq
(
context
.
background
(),
b'bla bla'
)
==
""
# assert w closed
...
...
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