Skip to content

testsuite: fix executability test skip on FreeBSD (EFTYPE)#1000

Merged
tridge merged 1 commit into
masterfrom
fix-executability-eftype-freebsd
Jun 11, 2026
Merged

testsuite: fix executability test skip on FreeBSD (EFTYPE)#1000
tridge merged 1 commit into
masterfrom
fix-executability-eftype-freebsd

Conversation

@willsarg

Copy link
Copy Markdown
Member

Problem

executability_test.py tries to chmod a file to mode 0o1700 (sticky + rwx). The test expects this to fail on platforms where non-root can't set the sticky bit, and skips if it does. The handler only caught PermissionError (EPERM/EACCES).

FreeBSD and OpenBSD return EFTYPE (errno 79, "Inappropriate file type or format") instead — they treat the sticky bit on a regular file as an invalid mode for the file type, not a permission issue. The test therefore errored out on FreeBSD 14, FreeBSD 15, and OpenBSD rather than skipping.

Fix

Catch OSError and check e.errno against the expected skip set: EPERM, EACCES, and EFTYPE (via getattr(errno, 'EFTYPE', None) so it's a no-op on Linux). Re-raise on any other errno so unexpected failures still surface.

Verification

  • FreeBSD 14.4: executability now SKIP (Can't chmod), 100 passed / 26 skipped / 0 failed
  • FreeBSD 15.0: executability now SKIP (Can't chmod), 100 passed / 26 skipped / 0 failed
  • OpenBSD 7.9: executability now SKIP (Can't chmod), 89 passed / 1 xfailed / 36 skipped / 0 failed
  • Ubuntu 20.04 (kernel 5.4): unaffected, 92 passed / 8 skipped / 0 failed (Linux never raises on this chmod)

Ported from rsync-private#25.

🤖 Generated with Claude Code

FreeBSD and OpenBSD return EFTYPE (errno 79) when chmod-ing a sticky bit
onto a regular file as non-root, rather than EPERM/EACCES. Catch OSError
and check errno against the expected skip set so the test skips correctly
on those platforms instead of erroring out.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@tridge tridge merged commit d0c0ca2 into master Jun 11, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants