Commit Graph

6 Commits

Author SHA1 Message Date
Andrew Deason
c3df91f303 tests: Introduce afstest_MyHostAddr
Several places resolve the local hostname into an IP address.
Consolidate these into a single function (gethostaddr), and add the
function afstest_MyHostAddr, which caches the IP and bails if we can't
resolve our hostname.

Change-Id: I7f71cd136796e4395c639eed8dd8eb19a7b9beec
Reviewed-on: https://gerrit.openafs.org/14802
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2021-10-27 01:06:33 -04:00
Michael Meffie
bf1b3e2fc1 tests: skip vos tests when a vlserver is already running
The vos tests start a temporary vlserver process, which is problematic
when the local system already has an installed vlserver. Attempt to
temporarily bind a socket to the vlserver port, and if unable to bind
with an EADDRINUSE error, assume the vlserver is already running and
skip these tests.

Change-Id: I1dd3bc4c7ebcd2c7bffc8aca422222a50058090e
Reviewed-on: https://gerrit.openafs.org/14021
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2020-01-20 15:16:14 -05:00
Marc Dionne
0a528a52f5 tests: Improve failure mode for unresolvable hostname
In the case of a host where gethostbyname is unable to resolve
the hostname, afstest_BuildTestConfig() may return NULL which
can cause several tests to crash.

Add a common function to look out for this condition and use it where
appropriate.  When it occurs, the current module is skipped and
the user gets an error message that indicates the configuration
problem.

Change-Id: I7216876eb2424368f415e5759e2b95009ad055b2
Reviewed-on: http://gerrit.openafs.org/9120
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-02-17 20:51:15 -08:00
Simon Wilkinson
f0a57e9de6 tests: Reformat loopback tests
Reformat the loopback tests to match our house style - 4 spaces for
first indent, a tab for the second, and so on, opening brace of a
function on a newline, spaces around assignments, and so on.

Change-Id: I54f168ca143e7ff46c9d82289331b8314849f848
Reviewed-on: http://gerrit.openafs.org/8229
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2012-10-12 18:32:25 -07:00
Simon Wilkinson
072828a1f5 tests: Tidy up loopback adapter tests
Remove the unused h_errno extern, which in turn removes the need
for disabling strict prototype warnings in the Makefile

Use roken.h, instead of hardcoding system libraries

Change-Id: Ie654c77ff60ed14fc3b659fa3eb527535be71164
Reviewed-on: http://gerrit.openafs.org/8228
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2012-10-12 18:32:17 -07:00
Jason Edgecombe
70c4369e89 TESTS: Add a library to check for the default loopback network
Change-Id: Id7bb92345e97309363fa5ddbff9147edf30ccd96
Reviewed-on: http://gerrit.openafs.org/8145
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-09-26 04:47:01 -07:00