opnsense-src/libexec
Mark Johnston b837ead1d4 tftpd: Address flaky tests
The tftpd tests all follow the same pattern:
1. open a UDP socket,
2. fork a child to exec tftpd, which subsequently handles requests on
   the socket,
3. use a client socket to send some message to the tftpd daemon.

However, tftpd's first action is to mark its socket as non-blocking and
then read a request from it.  If no data is present in the socket, tftpd
exits immediately with an error.  So, there is a race; we often see
tftpd test timeouts when running tests in parallel.  These timeouts also
arise periodically in CI runs.

One solution is to restructure each test to create the server socket,
then write the request to the client socket, then fork tftpd.  This
closes the race.  However, this involves a lot of churn.

This patch fixes the problem a different way, by adding a new -b flag to
tftpd which makes it block to read the initial request.  Each test is
modified to use -b, closing the race.

Reviewed by:	imp, asomers
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D47404

(cherry picked from commit 79c342aaf86feb4efbd15383f54e4fe7bdc9da7b)
2024-11-19 14:15:06 +00:00
..
atf Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
atrun Purge more stray embedded $FreeBSD$ strings 2023-10-24 10:10:12 -07:00
blacklistd-helper Track upstream project rename in contrib/blocklistd 2024-01-07 14:31:11 -05:00
bootpd bootpd(8): Fix a typo in a source code comment 2024-01-25 07:45:24 +01:00
comsat Purge more stray embedded $FreeBSD$ strings 2023-10-24 10:10:12 -07:00
dma dma.conf: Fix typo 2024-04-07 12:34:04 -04:00
fingerd Track upstream project rename in contrib/blocklistd 2024-01-07 14:31:11 -05:00
flua flua: Add wrappers for sys/utsname.h 2024-10-10 20:28:20 +00:00
ftpd Remove "All Rights Reserved" from FreeBSD Foundation copyrights 2024-08-06 15:39:53 -04:00
getty Purge more stray embedded $FreeBSD$ strings 2023-10-24 10:10:12 -07:00
hyperv Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
kgdb crashinfo: Print stack traces for all on-CPU threads 2024-02-09 09:55:45 -05:00
mail.local Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
makewhatis.local Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
mknetid Purge more stray embedded $FreeBSD$ strings 2023-10-24 10:10:12 -07:00
nuageinit nuageinit: tests: Cleanup 2024-10-08 09:04:02 +02:00
phttpget Remove remnants of portsnap(8) 2024-05-09 15:52:53 +09:00
pppoed Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
rbootd Purge more stray embedded $FreeBSD$ strings 2023-10-24 10:10:12 -07:00
rc ipfilter: Set ipf -T optionlist at boot 2024-11-18 16:26:04 -08:00
revnetgroup Purge more stray embedded $FreeBSD$ strings 2023-10-24 10:10:12 -07:00
rpc.rquotad Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
rpc.rstatd Purge more stray embedded $FreeBSD$ strings 2023-10-24 10:10:12 -07:00
rpc.rusersd Purge more stray embedded $FreeBSD$ strings 2023-10-24 10:10:12 -07:00
rpc.rwalld Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
rpc.sprayd Purge more stray embedded $FreeBSD$ strings 2023-10-24 10:10:12 -07:00
rtld-elf rtld.1: cross-reference rtld_get_var.3 2024-11-14 02:42:17 +02:00
rtld-elf32 Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
save-entropy save-entropy: Add manual page 2024-05-03 17:25:24 -03:00
smrsh Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
talkd Purge more stray embedded $FreeBSD$ strings 2023-10-24 10:10:12 -07:00
tcpd Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
tests Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
tftp-proxy Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
tftpd tftpd: Address flaky tests 2024-11-19 14:15:06 +00:00
ulog-helper Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
ypxfr Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
Makefile nuageinit: add basic support for cloudinit. 2024-04-11 13:52:52 +02:00
Makefile.inc Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00