]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/cephfs: use 4KB aligned quota bytes 46905/head
authorXiubo Li <xiubli@redhat.com>
Mon, 19 Sep 2022 02:40:50 +0000 (10:40 +0800)
committerXiubo Li <xiubli@redhat.com>
Wed, 8 Mar 2023 10:57:05 +0000 (18:57 +0800)
Fixes: https://tracker.ceph.com/issues/56397
Signed-off-by: Xiubo Li <xiubli@redhat.com>
src/test/pybind/test_cephfs.py

index 83c98ad0b27fa5f2a8b1b4a628ba717abf67566d..64821dda2dc4ce6c114bee18810fd321cc5363f2 100644 (file)
@@ -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")