Commit bb418b15 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 745d8cd2
...@@ -27,14 +27,16 @@ wcfs.py/wcfs.go while running tox tests in wcfs mode. ...@@ -27,14 +27,16 @@ wcfs.py/wcfs.go while running tox tests in wcfs mode.
from __future__ import print_function, absolute_import from __future__ import print_function, absolute_import
from golang import func, defer, b from golang import func, defer, error, b
from golang.golang_test import panics
from wendelin.bigfile.file_zodb import ZBigFile from wendelin.bigfile.file_zodb import ZBigFile
from wendelin.wcfs.wcfs_test import tDB, tAt from wendelin.wcfs.wcfs_test import tDB, tAt
from wendelin.wcfs import wcfs_test from wendelin.wcfs import wcfs_test
from wendelin.wcfs.internal.wcfs_test import read_mustfault from wendelin.wcfs.internal.wcfs_test import read_mustfault
from wendelin.wcfs.internal import mm from wendelin.wcfs.internal import mm
from pytest import raises
from golang.golang_test import panics
# XXX so that e.g. testdb is set up + ... # XXX so that e.g. testdb is set up + ...
def setup_module(): wcfs_test.setup_module() def setup_module(): wcfs_test.setup_module()
def teardown_module(): wcfs_test.teardown_module() def teardown_module(): wcfs_test.teardown_module()
...@@ -173,14 +175,10 @@ def test_wcfs_client(): ...@@ -173,14 +175,10 @@ def test_wcfs_client():
# XXX fh close then open again and use # XXX fh close then open again and use
# XXX open same fh twice, close once - fh2 continue to work ok # XXX open same fh twice, close once - fh2 continue to work ok
# XXX wconn.open() after wconn.close() -> error
# XXX wconn.resync() after wconn.close() -> error
# verify that on Conn/FileH down/closed -> Mappings switch to EFAULT on access. # verify that on Conn/FileH down/closed -> Mappings switch to EFAULT on access.
@func @func
def test_wcfs_client_down_efault(): def test_wcfs_client_down_efault():
# XXX all fileh / mappings become invalid after wconn.close
t = tDB(); zf1 = t.zfile; at0=t.at0 t = tDB(); zf1 = t.zfile; at0=t.at0
defer(t.close) defer(t.close)
...@@ -241,6 +239,15 @@ def test_wcfs_client_down_efault(): ...@@ -241,6 +239,15 @@ def test_wcfs_client_down_efault():
tm21.assertBlkFaults(3); tm22.assertBlkFaults(3) tm21.assertBlkFaults(3); tm22.assertBlkFaults(3)
pass; tm22.assertBlkFaults(4) pass; tm22.assertBlkFaults(4)
# XXX vvv -> separate test?
# verify that after wconn.close()
# wconn.open(), wconn.resync(), fh.mmap() -> error
with raises(error, match=".*: connection closed"): wconn.open(zf1._p_oid)
with raises(error, match=".*: connection closed"): wconn.resync(at3)
with raises(error, match=".*: file already closed"): fh2.mmap(2, 3) # NOTE we did not close fh2 yet
# ----//---- after fileh.close
with raises(error, match=".*: file already closed"): fh1.mmap(2, 3) # fh1 was explicitly closed ^^^
# verify that read_mustfault works as expected. # verify that read_mustfault works as expected.
def test_read_mustfault(): def test_read_mustfault():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment