@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")