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
a974edc9
Commit
a974edc9
authored
Dec 25, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
5d775923
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
9 deletions
+17
-9
wcfs/wcfs.go
wcfs/wcfs.go
+8
-1
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+9
-8
No files found.
wcfs/wcfs.go
View file @
a974edc9
...
...
@@ -789,12 +789,14 @@ func bigopen(ctx context.Context, zconn *ZConn, oid zodb.Oid) (_ *BigFile, err e
zconn
.
Incref
()
return
&
BigFile
{
Node
:
nodefs
.
NewDefaultNode
(),
zconn
:
zconn
,
zbf
:
zbf
,
zbfSize
:
zbfSize
,
// XXX this is needed only for head/
δFtail
:
NewΔTailI64
(),
// XXX indicate we have coverage starting from zconn.at?
loading
:
make
(
map
[
int64
]
*
blkLoadState
),
},
nil
}
...
...
@@ -1089,8 +1091,13 @@ func main() {
// add entries to /
mkfile
(
root
,
".wcfs"
,
NewStaticFile
([]
byte
(
zurl
)))
mkdir
(
root
,
"head"
,
&
Head
{
head
:=
&
Head
{
Node
:
nodefs
.
NewDefaultNode
(),
}
mkdir
(
root
,
"head"
,
head
)
mkdir
(
head
,
"bigfile"
,
&
BigFileDir
{
Node
:
nodefs
.
NewDefaultNode
(),
tab
:
make
(
map
[
zodb
.
Oid
]
*
BigFile
),
})
// TODO handle autoexit
...
...
wcfs/wcfs_test.py
View file @
a974edc9
...
...
@@ -99,7 +99,8 @@ def test_join():
defer
(
wc
.
close
)
assert
wc
.
mountpoint
==
testmntpt
assert
readfile
(
wc
.
mountpoint
+
"/.wcfs"
)
==
zurl
assert
os
.
path
.
isdir
(
wc
.
mountpoint
+
"/bigfile"
)
assert
os
.
path
.
isdir
(
wc
.
mountpoint
+
"/head"
)
assert
os
.
path
.
isdir
(
wc
.
mountpoint
+
"/head/bigfile"
)
wc2
=
wcfs
.
join
(
zurl
,
autostart
=
False
)
defer
(
wc2
.
close
)
...
...
@@ -115,7 +116,8 @@ def test_join_autostart():
defer
(
wc
.
close
)
assert
wc
.
mountpoint
==
testmntpt
assert
readfile
(
wc
.
mountpoint
+
"/.wcfs"
)
==
zurl
assert
os
.
path
.
isdir
(
wc
.
mountpoint
+
"/bigfile"
)
assert
os
.
path
.
isdir
(
wc
.
mountpoint
+
"/head"
)
assert
os
.
path
.
isdir
(
wc
.
mountpoint
+
"/head/bigfile"
)
# XXX hack (tmp ?)
...
...
@@ -163,20 +165,19 @@ def test_bigfile_empty():
wc
=
wcfs
.
join
(
testzurl
,
autostart
=
True
)
defer
(
wc
.
close
)
# path to bigfile/ under wcfs
bigpath
=
wc
.
mountpoint
+
"/bigfile"
# path to
head/
bigfile/ under wcfs
bigpath
=
wc
.
mountpoint
+
"/
head/
bigfile"
#
mkdir
to non-BigFile - must be rejected
#
lookup
to non-BigFile - must be rejected
with
raises
(
OSError
)
as
exc
:
os
.
mkdir
(
"%s/%s"
%
(
bigpath
,
last
.
_p_oid
.
encode
(
'hex'
)))
os
.
stat
(
"%s/%s"
%
(
bigpath
,
last
.
_p_oid
.
encode
(
'hex'
)))
assert
exc
.
value
.
errno
==
EINVAL
# path to f under wcfs
fpath
=
"%s/%s"
%
(
bigpath
,
f
.
_p_oid
.
encode
(
'hex'
))
os
.
mkdir
(
fpath
)
st
=
os
.
stat
(
fpath
+
"/head/data"
)
st
=
os
.
stat
(
fpath
)
assert
st
.
st_size
==
0
assert
st
.
st_mtime
==
tidtime
(
tid1
)
...
...
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