8000 [3.13] gh-126909: Fix running xattr tests on systems with lower limits (GH-126930) by miss-islington · Pull Request #126965 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[3.13] gh-126909: Fix running xattr tests on systems with lower limits (GH-126930) #126965

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
10000 Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gh-126909: Fix running xattr tests on systems with lower limits (GH-1…
…26930)

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 <mgorny@gentoo.org>
  • Loading branch information
mgorny authored and miss-islington committed Nov 18, 2024
commit 814b6a17804763a70be2058364f831deb7d09c44
6 changes: 3 additions & 3 deletions Lib/test/test_os.py
Original file line number Diff line number Diff line change
Expand Up @@ -3917,10 +3917,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))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix test_os extended attribute tests to work on filesystems with 1 KiB xattr size
limit.
Loading
0