]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix two failing tests after ATF update
authorAlex Richardson <arichardson@FreeBSD.org>
Mon, 15 Feb 2021 22:11:30 +0000 (22:11 +0000)
committerAlex Richardson <arichardson@FreeBSD.org>
Mon, 15 Feb 2021 22:55:12 +0000 (22:55 +0000)
commit10fc4c3218381fef7189a5b8d46a757cd1989dff
tree82f5a9140298cf24327b0123c0f438edfa7001f4
parent0482d7c9e944433abc98fc27a265ae762abce9a0
Fix two failing tests after ATF update

Since https://github.com/freebsd/atf/commit/4581cefc1e3811dd3c926b5dd4b15fd63d2e19da
ATF opens the results file on startup. This fixes problems like
capsicumized tests not being able to open the file on exit.

However, this test closes all file descriptors just to check that
socketpair returns fd 3+4 and thereby also closes the ATF results file.
This then results in an EBADF when writing the result so the test is
reported as broken.

While system calls that create new file descriptors (must?) use the lowest
available file descriptor number, it does not seem useful to test this
property here. Drop the check for FD==3/4 to unbreak the testsuite.

We could also try to re-open the results file in ATF if we get a EBADF
error, but that will fail when running under Capsicum.

Reviewed By: cem
Differential Revision: https://reviews.freebsd.org/D28683
contrib/netbsd-tests/lib/libc/sys/t_pipe2.c
contrib/netbsd-tests/lib/libc/sys/t_socketpair.c