Skip to content

Commit 1fbd84b

Browse files
[3.13] gh-126909: Fix running xattr tests on systems with lower limits (GH-126930) (#126965)
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 2c0a21c) Co-authored-by: Michał Górny <[email protected]>
1 parent c2c18ac commit 1fbd84b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Lib/test/test_os.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3917,10 +3917,10 @@ def _check_xattrs_str(self, s, getxattr, setxattr, removexattr, listxattr, **kwa
39173917
xattr.remove("user.test")
39183918
self.assertEqual(set(listxattr(fn)), xattr)
39193919
self.assertEqual(getxattr(fn, s("user.test2"), **kwargs), b"foo")
3920-
setxattr(fn, s("user.test"), b"a"*1024, **kwargs)
3921-
self.assertEqual(getxattr(fn, s("user.test"), **kwargs), b"a"*1024)
3920+
setxattr(fn, s("user.test"), b"a"*256, **kwargs)
3921+
self.assertEqual(getxattr(fn, s("user.test"), **kwargs), b"a"*256)
39223922
removexattr(fn, s("user.test"), **kwargs)
3923-
many = sorted("user.test{}".format(i) for i in range(100))
3923+
many = sorted("user.test{}".format(i) for i in range(32))
39243924
for thing in many:
39253925
setxattr(fn, thing, b"x", **kwargs)
39263926
self.assertEqual(set(listxattr(fn)), set(init_xattr) | set(many))
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix test_os extended attribute tests to work on filesystems with 1 KiB xattr size
2+
limit.

0 commit comments

Comments
 (0)