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
ec199348
Commit
ec199348
authored
Mar 17, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
f18ca4c6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
13 deletions
+11
-13
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+11
-13
No files found.
wcfs/wcfs_test.py
View file @
ec199348
...
...
@@ -303,6 +303,7 @@ class tFile:
assert
blk
<
(
st
.
st_size
//
t
.
blksize
)
assert
st
.
st_size
//
t
.
blksize
<=
t
.
_max_tracked
# XXX assert individually for every block page? (easier debugging?)
assert
t
.
blk
(
blk
)
==
data
,
(
"#blk: %d"
%
blk
)
# we just accessed the block - it has to be in OS cache
...
...
@@ -360,13 +361,12 @@ def test_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"
memcpy
(
vma
,
s
)
memcpy
(
vma
,
b'alpha'
)
t
.
commit
()
t
.
wcsync
()
f
.
assertCache
([
0
,
0
,
0
])
# initially not cached
f
.
assertData
([
b''
,
b''
,
s
],
mtime
=
t
.
head
)
f
.
assertData
([
b''
,
b''
,
b'alpha'
],
mtime
=
t
.
head
)
# >>> commit data again -> verify we can see both latest and snapshotted states.
...
...
@@ -375,22 +375,20 @@ def test_wcfs():
zfh
=
zf
.
fileh_open
(
_use_wcfs
=
False
)
vma1
=
zfh
.
mmap
(
2
,
1
)
vma2
=
zfh
.
mmap
(
2
+
1
,
1
)
s1
=
b"hello 123"
s2
=
b"alpha"
memcpy
(
vma1
,
s1
)
memcpy
(
vma2
,
s2
)
memcpy
(
vma1
,
b'beta'
)
memcpy
(
vma2
,
b'gamma'
)
t
.
commit
()
t
.
wcsync
()
# f @head
f
.
assertCache
([
1
,
1
,
0
,
0
])
f
.
assertData
([
b''
,
b''
,
s1
+
b'ld'
,
s2
],
mtime
=
t
.
head
)
f
.
assertData
([
b''
,
b''
,
b'betaa'
,
b'gamma'
],
mtime
=
t
.
head
)
# f @at1
f1
=
t
.
open
(
zf
,
at
=
at1
)
f1
.
assertCache
([
0
,
0
,
1
])
f1
.
assertData
([
b''
,
b''
,
s
])
# XXX + mtime=at1?
f1
.
assertData
([
b''
,
b''
,
b'alpha'
])
# XXX + mtime=at1?
# >>> commit again without changing zf size
...
...
@@ -399,7 +397,7 @@ def test_wcfs():
zfh
=
zf
.
fileh_open
(
_use_wcfs
=
False
)
vma
=
zfh
.
mmap
(
2
,
1
)
memcpy
(
vma
,
b'
hello
kitty'
)
memcpy
(
vma
,
b'kitty'
)
t
.
commit
()
t
.
wcsync
()
...
...
@@ -413,15 +411,15 @@ def test_wcfs():
f
.
assertCache
([
1
,
1
,
0
,
1
])
# f @head
f
.
assertData
([
b''
,
b''
,
b'
hello kitty'
,
b'alph
a'
],
mtime
=
t
.
head
)
f
.
assertData
([
b''
,
b''
,
b'
kitty'
,
b'gamm
a'
],
mtime
=
t
.
head
)
# f @at2
f2
.
assertCache
([
0
,
0
,
1
,
0
])
f2
.
assertData
([
b''
,
b''
,
b'
hello 123ld'
,
b'alph
a'
])
# XXX mtime=at2
f2
.
assertData
([
b''
,
b''
,
b'
betaa'
,
b'gamm
a'
])
# XXX mtime=at2
# f @at1
f1
.
assertCache
([
1
,
1
,
1
])
f1
.
assertData
([
b''
,
b''
,
b'
hello world
'
])
# XXX + mtime=at1?
f1
.
assertData
([
b''
,
b''
,
b'
alpha
'
])
# XXX + mtime=at1?
...
...
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