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
f18ca4c6
Commit
f18ca4c6
authored
Mar 17, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
8d046f41
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
7 deletions
+43
-7
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+43
-7
No files found.
wcfs/wcfs_test.py
View file @
f18ca4c6
...
...
@@ -345,19 +345,19 @@ def test_wcfs():
assert
tidtime
(
tid2
)
>
tidtime
(
tid1
)
t
.
wcsync
()
#
lookup to non-BigFile -
must be rejected
#
>>> lookup non-BigFile ->
must be rejected
with
raises
(
OSError
)
as
exc
:
t
.
stat
(
nonfile
)
assert
exc
.
value
.
errno
==
EINVAL
f
=
t
.
open
(
zf
)
# file initially empty
#
*
file initially empty
f
.
assertCache
([])
f
.
assertData
([],
mtime
=
tid1
)
# commit data to zf -> verify we can see it on wcfs
# (use !wcfs mode so that we prepare data independently of wcfs code paths)
#
>>>
commit data to zf -> verify we can see it on wcfs
#
(use !wcfs mode so that we prepare data independently of wcfs code paths)
zfh
=
zf
.
fileh_open
(
_use_wcfs
=
False
)
vma
=
zfh
.
mmap
(
2
,
1
)
# 1 page at offset=2
s
=
b"hello world"
...
...
@@ -369,7 +369,7 @@ def test_wcfs():
f
.
assertData
([
b''
,
b''
,
s
],
mtime
=
t
.
head
)
# commit data again -> verify we can see both latest and snapshotted states.
#
>>>
commit data again -> verify we can see both latest and snapshotted states.
at1
=
t
.
head
zfh
=
zf
.
fileh_open
(
_use_wcfs
=
False
)
...
...
@@ -393,12 +393,48 @@ def test_wcfs():
f1
.
assertData
([
b''
,
b''
,
s
])
# XXX + mtime=at1?
# >>> commit again without changing zf size
at2
=
t
.
head
f2
=
t
.
open
(
zf
,
at
=
at2
)
zfh
=
zf
.
fileh_open
(
_use_wcfs
=
False
)
vma
=
zfh
.
mmap
(
2
,
1
)
memcpy
(
vma
,
b'hello kitty'
)
t
.
commit
()
t
.
wcsync
()
f
.
assertCache
([
1
,
1
,
0
,
1
])
# f @head is opened again -> cache must not be lost
f
.
assertCache
([
1
,
1
,
1
,
1
])
f_
=
t
.
open
(
zf
)
f_
.
assertCache
([
1
,
1
,
1
,
1
])
f_
.
assertCache
([
1
,
1
,
0
,
1
])
f_
.
close
()
f
.
assertCache
([
1
,
1
,
0
,
1
])
# f @head
f
.
assertData
([
b''
,
b''
,
b'hello kitty'
,
b'alpha'
],
mtime
=
t
.
head
)
# f @at2
f2
.
assertCache
([
0
,
0
,
1
,
0
])
f2
.
assertData
([
b''
,
b''
,
b'hello 123ld'
,
b'alpha'
])
# XXX mtime=at2
# f @at1
f1
.
assertCache
([
1
,
1
,
1
])
f1
.
assertData
([
b''
,
b''
,
b'hello world'
])
# XXX + mtime=at1?
# >>> f close / open again -> cache must not be lost
# XXX bit flaky since OS can evict whole f cache under pressure
f
.
assertCache
([
1
,
1
,
1
,
1
])
f
.
close
()
# XXX os.sync?
f
=
t
.
open
(
zf
)
assert
f
.
cached
()
!=
[
0
,
0
,
0
,
0
]
def
test_wcfs_invproto
():
...
...
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