openafs/tests/auth
Andrew Deason 66d0f91791 tests: Wait for server start in auth/superuser-t
The auth/superuser-t test runs an Rx server and client in two child
processes. If the client process tries to contact the server before
the server has started listening on its port, some tests involving
RPCs can fail (notably test 39, "Can run a simple RPC").

Normally if we try to contact a server that's not there, Rx will try
resending its packets a few times, but on Linux with AFS_RXERRQ_ENV,
if the port isn't open at all, we can get an ICMP_PORT_UNREACH error,
which causes the relevant Rx call to die immediately with
RX_CALL_DEAD.

This means that if the auth/superuser-t client is only just a bit
faster than the server starting up, tests can fail, since the server's
port is not open yet.

To avoid this, we can wait until the server's port is open before
starting the client process. To do this, have the server process send
a SIGUSR1 to the parent after rx_Init() is called, and have the parent
process wait for the SIGUSR1 (waiting for a max of 5 seconds before
failing). This should guarantee that the server's port will be open by
the time the client starts running.

Note that before commit 086d1858 (LINUX: Include linux/time.h for
linux/errqueue.h), AFS_RXERRQ_ENV was mistakenly disabled on Linux
3.17+, so this issue was probably not possible on recent Linux before
that commit.

Change-Id: I0032a640b83c24f72c03e7bea100df5bc3d9ed4c
Reviewed-on: https://gerrit.openafs.org/14109
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
2020-03-31 17:34:51 -04:00
..
.gitignore auth: local realms configuration 2012-04-16 10:31:04 -07:00
authcon-t.c Use rxgk in afsconf_BuildServerSecurityObjects 2019-03-24 05:50:03 -04:00
KeyFile tests: Add tests for afsconf_'s key functions 2010-12-27 14:39:37 -08:00
keys-t.c tests/auth/keys-t.c: Don’t ignore return value of write 2015-08-25 23:53:51 -04:00
Makefile.in tests: Introduce afstest_GetProgname 2020-01-09 23:56:27 -05:00
realms-t.c tests: Improve failure mode for unresolvable hostname 2013-02-17 20:51:15 -08:00
superuser-t.c tests: Wait for server start in auth/superuser-t 2020-03-31 17:34:51 -04:00
test.xg auth: Add more tests and resulting fixes to userok 2010-12-26 10:58:49 -08:00
writekeyfile.c tests: Add tests for afsconf_'s key functions 2010-12-27 14:39:37 -08:00