Commit f8704273 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 57fd0b75
......@@ -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 ----
......
......@@ -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.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment