SIGN IN SIGN UP

gh-124213: Skip tests failing inside systemd-nspawn --suppress-sync=true (#124215)

Add a helper function that checks whether the test suite is running
inside a systemd-nspawn container, and skip the few tests failing
with `--suppress-sync=true` in that case.  The tests are failing because
`--suppress-sync=true` stubs out `fsync()`, `fdatasync()` and `msync()`
calls, and therefore they always return success without checking for
invalid arguments.

Call `os.open(__file__, os.O_RDONLY | os.O_SYNC)` and check the errno to
detect whether `--suppress-sync=true` is actually used, and skip
the tests only in that scenario.
M
Michał Górny committed
342e654b8eda24c68da64cc21bc9583e480d9e8e
Parent: 1a57772
Committed by GitHub <noreply@github.com> on 9/20/2024, 1:37:49 PM