From 0d2d61f4e53e35a0309792f4db7d4b76d38e3488 Mon Sep 17 00:00:00 2001 From: Xiubo Li Date: Mon, 19 Sep 2022 10:40:50 +0800 Subject: [PATCH] pybind/cephfs: use 4KB aligned quota bytes Fixes: https://tracker.ceph.com/issues/56397 Signed-off-by: Xiubo Li --- src/test/pybind/test_cephfs.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/test/pybind/test_cephfs.py b/src/test/pybind/test_cephfs.py index 83c98ad0b27f..64821dda2dc4 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") -- 2.47.3