gh-148853: Catch PermissionError in test in_systemd_nspawn_sync_suppressed() (GH-148854)
/run/ on my FreeBSD install is not readable causing failing test.
(cherry picked from commit
35ce2e5f98c04cb8d1e442de5439d3151362e21b)
Co-authored-by: Nick Begg <nick@stunttruck.net>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
with open("/run/systemd/container", "rb") as fp:
if fp.read().rstrip() != b"systemd-nspawn":
return False
- except FileNotFoundError:
+ except (FileNotFoundError, PermissionError):
return False
# If systemd-nspawn is used, O_SYNC flag will immediately
--- /dev/null
+Fix tests failing on FreeBSD in test.support's
+in_systemd_nspawn_sync_suppressed() due to unreadable /run directory.