mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
[3.12] gh-126909: Fix running xattr tests on systems with lower limits (GH-126930) (#126964)
gh-126909: Fix running xattr tests on systems with lower limits (GH-126930)
Modify the extended attribute tests to write fewer and smaller extended
attributes, in order to fit within filesystems with total xattr limit
of 1 KiB (e.g. ext4 with 1 KiB blocks). Previously, the test would
write over 2 KiB, making it fail with ENOSPC on such systems.
(cherry picked from commit 2c0a21c1aa)
Co-authored-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
parent
06dc4bd073
commit
fd241d64c1
2 changed files with 5 additions and 3 deletions
|
|
@ -3887,10 +3887,10 @@ def _check_xattrs_str(self, s, getxattr, setxattr, removexattr, listxattr, **kwa
|
|||
xattr.remove("user.test")
|
||||
self.assertEqual(set(listxattr(fn)), xattr)
|
||||
self.assertEqual(getxattr(fn, s("user.test2"), **kwargs), b"foo")
|
||||
setxattr(fn, s("user.test"), b"a"*1024, **kwargs)
|
||||
self.assertEqual(getxattr(fn, s("user.test"), **kwargs), b"a"*1024)
|
||||
setxattr(fn, s("user.test"), b"a"*256, **kwargs)
|
||||
self.assertEqual(getxattr(fn, s("user.test"), **kwargs), b"a"*256)
|
||||
removexattr(fn, s("user.test"), **kwargs)
|
||||
many = sorted("user.test{}".format(i) for i in range(100))
|
||||
many = sorted("user.test{}".format(i) for i in range(32))
|
||||
for thing in many:
|
||||
setxattr(fn, thing, b"x", **kwargs)
|
||||
self.assertEqual(set(listxattr(fn)), set(init_xattr) | set(many))
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
Fix test_os extended attribute tests to work on filesystems with 1 KiB xattr size
|
||||
limit.
|
||||
Loading…
Add table
Add a link
Reference in a new issue