From: Xiubo Li Date: Mon, 19 Sep 2022 02:40:50 +0000 (+0800) Subject: pybind/cephfs: use 4KB aligned quota bytes X-Git-Tag: v19.0.0~1459^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0d2d61f4e53e35a0309792f4db7d4b76d38e3488;p=ceph.git pybind/cephfs: use 4KB aligned quota bytes Fixes: https://tracker.ceph.com/issues/56397 Signed-off-by: Xiubo Li --- diff --git a/src/test/pybind/test_cephfs.py b/src/test/pybind/test_cephfs.py index 83c98ad0b27..64821dda2dc 100644 --- a/src/test/pybind/test_cephfs.py +++ b/src/test/pybind/test_cephfs.py @@ -852,9 +852,11 @@ def test_get_pool(): @with_setup(setup_test) def test_disk_quota_exceeeded_error(): cephfs.mkdir("/dir-1", 0o755) - cephfs.setxattr("/dir-1", "ceph.quota.max_bytes", b"5", 0) + cephfs.setxattr("/dir-1", "ceph.quota.max_bytes", b"4096", 0) fd = cephfs.open(b'/dir-1/file-1', 'w', 0o755) - assert_raises(libcephfs.DiskQuotaExceeded, cephfs.write, fd, b"abcdeghiklmnopqrstuvwxyz", 0) + cephfs.ftruncate(fd, 4092) + cephfs.lseek(fd, 4090, os.SEEK_SET) + assert_raises(libcephfs.DiskQuotaExceeded, cephfs.write, fd, b"abcdeghiklmnopqrstuvwxyz1234567890qwertyuioddd", -1) cephfs.close(fd) cephfs.unlink(b"/dir-1/file-1")