-
Notifications
You must be signed in to change notification settings - Fork 366
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix test suite issues affecting Travis images
In the utilities used by the dejagnu test suites, use getaddrinfo()/getnameinfo() instead of gethostbyname()/gethostbyaddr(), as the results can vary when the local hostname appears in multiple lines in /etc/hosts. In t_ccselect.py, don't cause an error if the canonicalized local hostname is "localhost". The tests will continue to run in this case, as long as we don't try to create duplicate principals. In sim_server.c, bind to the wildcard address instead of the resolved local hostname, to resolve a mysterious problem observed in Travis where the second of three sim_client send() operations fails with ECONNREFUSED. (cherry picked from commit c2497d4)
- Loading branch information
1 parent
6c672cf
commit f8c72bc
Showing
5 changed files
with
41 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
#!/afs/athena/contrib/perl/p | ||
#!/usr/bin/perl | ||
use Socket qw(:addrinfo); | ||
use strict; | ||
|
||
my $hostname; | ||
if ($#ARGV == -1) { | ||
chop($hostname = `hostname`); | ||
} else { | ||
$hostname = $ARGV[0]; | ||
} | ||
|
||
if (! (($name,$type,$addr) = (gethostbyname($hostname))[0,2,4])) { | ||
print STDERR "No such host: $hostname\n"; | ||
exit(1); | ||
} | ||
if (! ($qualname = (gethostbyaddr($addr,$type))[0])) { | ||
$qualname = $name; | ||
} | ||
my ($gaerr, @addrs) = getaddrinfo($hostname, "", {flags => AI_CANONNAME}); | ||
die "No such host: $hostname ($gaerr)" if $gaerr; | ||
my ($canonname, $addr) = ($addrs[0]->{canonname}, $addrs[0]->{addr}); | ||
|
||
my ($gnerr, $name, $servicename) = getnameinfo($addr, NI_NAMEREQD); | ||
my $qualname = $gnerr ? $name : $name; | ||
|
||
$qualname =~ tr/A-Z/a-z/; # lowercase our name for keytab use. | ||
print "$qualname\n"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters