From ec1993489e05571f8ae73732ac90b7b1f6ae1419 Mon Sep 17 00:00:00 2001 From: Kirill Smelkov <kirr@nexedi.com> Date: Sun, 17 Mar 2019 13:49:42 +0300 Subject: [PATCH] . --- wcfs/wcfs_test.py | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/wcfs/wcfs_test.py b/wcfs/wcfs_test.py index d8c558d5..1a305c51 100644 --- a/wcfs/wcfs_test.py +++ b/wcfs/wcfs_test.py @@ -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'alpha'], mtime=t.head) + f.assertData ([b'',b'',b'kitty',b'gamma'], mtime=t.head) # f @at2 f2.assertCache([0,0,1,0]) - f2.assertData ([b'',b'',b'hello 123ld',b'alpha']) # XXX mtime=at2 + f2.assertData ([b'',b'',b'betaa',b'gamma']) # 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? -- 2.30.9