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
ff4d2f6b
Commit
ff4d2f6b
authored
5 years ago
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
d14b21f9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
5 deletions
+12
-5
wcfs/test.sh
wcfs/test.sh
+1
-1
wcfs/wcfs.go
wcfs/wcfs.go
+1
-0
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+10
-4
No files found.
wcfs/test.sh
View file @
ff4d2f6b
...
...
@@ -8,5 +8,5 @@ if test -z "$qrun_loglevel"; then
fi
# executed under qemu-runlinux
#
export WENDELIN_CORE_WCFS_OPTIONS="-d -alsologtostderr -v=1"
export
WENDELIN_CORE_WCFS_OPTIONS
=
"-d -alsologtostderr -v=1"
py.test
-vsx
-k
test_wcfs
This diff is collapsed.
Click to expand it.
wcfs/wcfs.go
View file @
ff4d2f6b
...
...
@@ -1552,6 +1552,7 @@ func (wlink *WatchLink) send(ctx context.Context, stream uint64, msg string) err
// XXX timeout write on ctx cancel
pkt
:=
[]
byte
(
fmt
.
Sprintf
(
"%d %s
\n
"
,
stream
,
msg
))
fmt
.
Printf
(
"S: watch: tx: %q
\n
"
,
pkt
)
_
,
err
:=
wlink
.
sk
.
Write
(
pkt
)
if
err
!=
nil
{
return
err
...
...
This diff is collapsed.
Click to expand it.
wcfs/wcfs_test.py
View file @
ff4d2f6b
...
...
@@ -441,8 +441,9 @@ class tWatch:
def
_send
(
t
,
stream
,
msg
):
assert
'
\
n
'
not
in
msg
with
t
.
_txmu
:
a
=
b"%d %s
\
n
"
%
(
stream
,
msg
)
t
.
wtx
.
write
(
b"%d %s
\
n
"
%
(
stream
,
msg
))
# XXX read/write don't work in parallel?
pkt
=
b"%d %s
\
n
"
%
(
stream
,
msg
)
print
(
'C: watch: tx: %r'
%
pkt
)
t
.
wtx
.
write
(
pkt
)
# XXX read/write don't work in parallel?
t
.
wtx
.
flush
()
# sendReq sends client -> server request and returns server reply.
...
...
@@ -505,13 +506,14 @@ class tSrvReq:
req
.
msg
=
msg
def
reply
(
req
,
answer
):
#print('C: reply %s <- %r ...' % (req, answer))
t
=
req
.
twatch
with
t
.
_mu
:
with
t
.
_
rx
mu
:
assert
req
.
stream
in
t
.
_accepted
t
.
_send
(
req
.
stream
,
answer
)
with
t
.
_mu
:
with
t
.
_
rx
mu
:
assert
req
.
stream
in
t
.
_accepted
t
.
_accepted
.
remove
(
req
.
stream
)
...
...
@@ -618,10 +620,14 @@ def test_wcfs():
@
func
def
_
():
defer
(
done
.
close
)
print
(
'C: aaa'
)
pinv
=
w
.
expectPin
([(
zf
,
2
,
at1
),
(
zf
,
3
,
at0
)])
#pinv = w.expectPin({zf: [(2, at1), (3, at0)]}) XXX <- this way better? (sugar)
#print('C: bbb')
#print('C: ccc', pinv)
for
p
in
pinv
:
p
.
reply
(
b"ack"
)
print
(
'C: eee'
)
go
(
_
)
assert
w
.
sendReq
(
b"watch %s @%s"
%
(
h
(
zf
.
_p_oid
),
h
(
at1
)))
==
"ok"
print
(
'
\
n
BBB
\
n
'
)
...
...
This diff is collapsed.
Click to expand it.
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