In case of very unexpected timestamps, we pass them on to date.
Unfortunately, only GNU date is able to perform this level of deduction
(guess work).
Rework the code and tests to look for GNU date on non-Linux platforms.
Only fail, and loudly! if GNU date cannot be found.
Sponsored by: The FreeBSD Foundation
Fixes GH-4333
1e1624f...
by
=?utf-8?q?Mina_Gali=C4=87?= <email address hidden>
cc_growpart: fix tests to run on FreeBSD (#4351)
Because /etc/rc.d/growfs exists on FreeBSD, we need to be selective
about when to allow tests access to it, so that they will pass.
Sponsored by: The FreeBSD Foundation
0c17a34...
by
=?utf-8?q?Mina_Gali=C4=87?= <email address hidden>
subp: Fix spurious test failure on FreeBSD (#4355)
Fix a test failure that only seemed to occur when running the full test
suite. Probably due to something not being cleaned up properly.
This adds an env={"LANG": "C"} to simplify the test execution, and
makes the failure go away.
Sponsored by: The FreeBSD Foundation
Fixes GH-4354
10d6f30...
by
=?utf-8?q?Mina_Gali=C4=87?= <email address hidden>
cmd/clean: fix tests on non-Linux platforms (#4352)
change clean_script to use `#!/bin/sh` which is guaranteed to exist on
pretty much any Unix (like) system, unlike `/bin/bash`, which could be
anywhere in the PATH.
Sponsored by: The FreeBSD Foundation
8a70dbc...
by
=?utf-8?q?Mina_Gali=C4=87?= <email address hidden>
util: Fix get_proc_ppid() on non-Linux systems (#4348)
`/proc/$pid/environ` and `/proc/$pid/stat` don't exist on BSD.
procfs on BSDs is highly limited, and its use very discourged.
While FreeBSD has procstat(1), which could reasonably read a process
environment, that use-case in the code is Linux specific and doesn't map
on FreeBSD.
Guard get_proc_env() tests with is_Linux().
The code already mostly uses this as a fallback, when all else fails.
implement get_proc_ppid() with `ps(1)`.
This should work on most platforms that have `ps(1)`.
Sponsored by: The FreeBSD Foundation
Fixes GH-4332
0cfc5c6...
by
=?utf-8?q?Mina_Gali=C4=87?= <email address hidden>
cc_wireguard: make tests pass on FreeBSD (#4346)
These tests relied on the SUT to provide sensible return values for
util.kernel_version(). On FreeBSD, those values are 14.0-CURRENT for my
development machine, which doesn't work well with when split at '.' and
compared against a pair of integers (14, '0-CURRENT') < (5, 4) doesn't
make much sense.
This patch adds `@mock`s for util.kernel_version wherever it is used.
That way, test_cc_wireguard.py tests passes on a FreeBSD system.