From: Xiaoxi Chen Date: Wed, 4 May 2016 08:06:43 +0000 (+0800) Subject: test/pybind: exercise cephfs.fsync X-Git-Tag: v11.0.0~565^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0c3711ba00784c82ebee55e73bdbb1014e03aec4;p=ceph.git test/pybind: exercise cephfs.fsync Signed-off-by: Xiaoxi Chen --- diff --git a/src/test/pybind/test_cephfs.py b/src/test/pybind/test_cephfs.py index baea91420840..ed7132ba5749 100644 --- a/src/test/pybind/test_cephfs.py +++ b/src/test/pybind/test_cephfs.py @@ -48,6 +48,17 @@ def test_statfs(): def test_syncfs(): stat = cephfs.sync_fs() +@with_setup(setup_test) +def test_fsync(): + fd = cephfs.open('file-1', 'w', 0755) + cephfs.write(fd, "asdf", 0) + stat = cephfs.fsync(fd, 0) + cephfs.write(fd, "qwer", 0) + stat = cephfs.fsync(fd, 1) + cephfs.close(fd) + #sync on non-existing fd (assume fd 12345 is not exists) + assert_raises(libcephfs.Error, cephfs.fsync, 12345, 0) + @with_setup(setup_test) def test_directory(): cephfs.mkdir("/temp-directory", 0755)