This allows running the tests on FreeBSD without mounting fdescfs.
Previously you had to run `mount -t fdescfs -o linrdlnk null /dev/fd` to
get file descriptors >=3 listed in /dev/fd.
Signed-off-by: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
/dev/fd exists on all operating systems I can test (Linux, FreeBSD, macOS),
whereas /proc/self/fd only appears to exist on Linux.
Signed-off-by: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
The tests that run exec-fd-leak-checker expect the binary to be located
in the current directory. This is not always the case; for instance, the
binaries could be built under `tests`, but be invoked under the
top-level build directory.
We can use an environment variable to control what's the location of the
test binaries, and fall back to the current directory if the variable is
unset.
Reviewed-by: Daniel Stone <daniels@collabora.com>
SEGV and ABRT by default cause a core dump, which may create a file,
launch crash handlers, and so on. sanity-test has 21 processes that
are expected to crash like this. Disable core dumps on them all.
I counted 21 entries in coredumpctl list, while only 16 functions needed
patching. After this patch no entries appear in coredumpctl list.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
The former one was already used in tests, but was private.
These functions can be shared across the tests, so make them
public.
Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Add facility for testing how (many) file descriptors survive an exec.
This allows implementing O_CLOEXEC tests.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>