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
f8704273
Commit
f8704273
authored
Jul 16, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
57fd0b75
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
4 deletions
+29
-4
wcfs/__init__.py
wcfs/__init__.py
+24
-1
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+5
-3
No files found.
wcfs/__init__.py
View file @
f8704273
...
...
@@ -80,7 +80,30 @@ class Conn(object):
# XXX Watch
# XXX WatchLink
# WatchLink represents /head/watch link opened on wcfs.
#
# .sendReq()/.recvReq() provides raw IO in terms of wcfs invalidation protocol messages.
class
WatchLink
:
def
__init__
(
wlink
,
wc
):
wlink
.
_wc
=
wc
# head/watch handle.
#
# python/stdio lock file object on read/write, however we need both
# read and write to be working simultaneously.
# -> use 2 separate file objects for rx and tx.
#
# fdopen takes ownership of file descriptor and closes it when file
# object is closed -> dup fd so that each file object has its own fd.
wh
=
os
.
open
(
tdb
.
_path
(
"head/watch"
),
os
.
O_RDWR
)
wh2
=
os
.
dup
(
wh
)
t
.
_wrx
=
os
.
fdopen
(
wh
,
'rb'
)
t
.
_wtx
=
os
.
fdopen
(
wh2
,
'wb'
)
# XXX ...
# ---- WatchLink message IO ----
...
...
wcfs/wcfs_test.py
View file @
f8704273
...
...
@@ -319,7 +319,7 @@ class tDB:
fail
(
"wcfs.go does not exit even after SIGKILL"
)
defer
(
_
)
def
_
():
#if not ready(t._wcfuseaborted):
#if not ready(t._wcfuseaborted):
XXX kill _wcfuseaborted ?
# assert 0 == subprocess.call(["mountpoint", "-q", testmntpt])
assert
is_mountpoint
(
testmntpt
)
subprocess
.
check_call
([
"fusermount"
,
"-u"
,
testmntpt
])
...
...
@@ -748,11 +748,13 @@ class tWatch:
# tWatchLink provides testing environment for /head/watch link opened on wcfs.
#
# .sendReq()/.recvReq() provides raw IO in terms of wcfs invalidation protocol messages.
# .sendReq()/.recvReq() provides raw IO in terms of wcfs invalidation protocol messages.
XXX kill here?
# .watch() setups/adjusts a watch for a file and verifies that wcfs correctly sends initial pins.
class
tWatchLink
:
class
tWatchLink
(
wcfs
.
WatchLink
)
:
def
__init__
(
t
,
tdb
):
super
(
tWatchLink
,
t
).
__init__
(
t
,
tdb
.
wc
)
t
.
tdb
=
tdb
# head/watch handle.
...
...
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