From: huanwen ren Date: Tue, 10 May 2016 11:51:23 +0000 (+0800) Subject: test/pybind: add link test usecase X-Git-Tag: v11.0.0~421^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e741c146cd5d6483e3885d26db1c890d1bdfd71a;p=ceph.git test/pybind: add link test usecase add link test usecase Signed-off-by: huanwen ren --- diff --git a/src/test/pybind/test_cephfs.py b/src/test/pybind/test_cephfs.py index baea91420840..e1b33e178ec9 100644 --- a/src/test/pybind/test_cephfs.py +++ b/src/test/pybind/test_cephfs.py @@ -124,6 +124,23 @@ def test_open(): assert_raises(libcephfs.OperationNotSupported, cephfs.open, 'file-1', 'a') cephfs.unlink('file-1') +@with_setup(setup_test) +def test_link(): + fd = cephfs.open('file-1', 'w', 0755) + cephfs.write(fd, "1111", 0) + cephfs.close(fd) + cephfs.link('file-1', 'file-2') + fd = cephfs.open('file-2', 'r', 0755) + assert_equal(cephfs.read(fd, 0, 4), "1111") + cephfs.close(fd) + fd = cephfs.open('file-2', 'r+', 0755) + cephfs.write(fd, "2222", 4) + cephfs.close(fd) + fd = cephfs.open('file-1', 'r', 0755) + assert_equal(cephfs.read(fd, 0, 8), "11112222") + cephfs.close(fd) + cephfs.unlink('file-2') + @with_setup(setup_test) def test_symlink(): fd = cephfs.open('file-1', 'w', 0755)