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
9c7241dc
Commit
9c7241dc
authored
Oct 10, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
8e958049
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
7 deletions
+25
-7
wcfs/wcfs.go
wcfs/wcfs.go
+1
-1
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+24
-6
No files found.
wcfs/wcfs.go
View file @
9c7241dc
...
...
@@ -467,7 +467,7 @@ func (bfroot *BigFileRoot) Mkdir(name string, mode uint32, fctx *fuse.Context) (
mkdir
(
bfroot
,
name
,
bfdir
)
mkdir
(
bfdir
,
"head"
,
bfhead
)
mkfile
(
bfhead
,
"data"
,
bfdata
)
mkfile
(
bfhead
,
"at"
,
NewSmallFile
(
bf
.
readAt
))
mkfile
(
bfhead
,
"at"
,
NewSmallFile
(
bf
.
readAt
))
// TODO mtime(at) = tidtime(at)
// XXX mkfile(bh, "invalidations", bh.inv)
return
bfdir
.
Inode
(),
fuse
.
OK
...
...
wcfs/wcfs_test.py
View file @
9c7241dc
...
...
@@ -32,13 +32,12 @@ from persistent.timestamp import TimeStamp
import
os
,
os
.
path
,
subprocess
from
errno
import
EINVAL
from
time
import
sleep
from
golang
import
func
,
defer
from
golang
import
func
,
method
,
defer
from
pytest
import
raises
testdb
=
None
testzurl
=
None
testmntpt
=
None
testzurl
=
None
# URL of testdb
testmntpt
=
None
# wcfs is mounted here
def
setup_module
():
global
testdb
,
testzurl
,
testmntpt
testdb
=
getTestDB
()
...
...
@@ -78,7 +77,7 @@ def tidtime(tid):
# ZODB/py vs ZODB/go time resolution is not better than 1µs
# see e.g. https://lab.nexedi.com/kirr/neo/commit/9112f21e
#
# NOTE pytest.approx supports only ==, not e.g. <
# NOTE pytest.approx supports only ==, not e.g. <
, so we use plain round.
return
round
(
t
,
6
)
...
...
@@ -119,6 +118,24 @@ def test_join_autostart():
assert
os
.
path
.
isdir
(
wc
.
mountpoint
+
"/bigfile"
)
# XXX hack (tmp ?)
# Conn._sync makes sure that underlying wcfs is synced to last ZODB data
@
method
(
wcfs
.
Conn
)
def
_sync
(
self
):
zurl
=
readfile
(
self
.
mountpoint
+
"/.wcfs"
)
bigfilev
=
os
.
listdir
(
self
.
mountpoint
+
"/bigfile"
)
self
.
close
()
subprocess
.
check_call
([
"fusermount"
,
"-u"
,
self
.
mountpoint
])
c2
=
wcfs
.
join
(
zurl
,
autostart
=
True
)
assert
c2
.
mountpoint
==
self
.
mountpoint
self
.
_fwcfs
=
c2
.
_fwcfs
# recreate bigfile entries
for
bf
in
bigfilev
:
os
.
mkdir
(
"%s/bigfile/%s"
%
(
self
.
mountpoint
,
bf
))
# XXX parametrize zblk0, zblk1
# XXX select !wcfs mode so that we prepare data through !wcfs path.
@
func
...
...
@@ -162,6 +179,7 @@ def test_bigfile_empty():
# head/at = last txn of whole db
assert
readfile
(
fpath
+
"/head/at"
)
==
tid2
.
encode
(
'hex'
)
# TODO check head/at syncs to later non-bigfile commits
...
...
@@ -176,7 +194,7 @@ def test_bigfile_empty():
tidlast
=
last
.
_p_serial
# XXX force sync of wcfs - how?
wc
sync
(
wc
)
wc
.
_sync
(
)
fsize
=
10
*
blksize
+
len
(
s
)
# trailing \0 not counted XXX ok? -> XXX not ok
...
...
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