| |
@@ -62,6 +62,17 @@
|
| |
# FIXME this is gonna break when we have IPv6 DNS servers on the
|
| |
# worker hosts
|
| |
my @forwards = split(' ', $result);
|
| |
+
|
| |
+ # Alternatively, for hosts that aren't running systemd, read /etc/resolv.conf
|
| |
+ if (!@forwards && open(my $fh, '<', "/etc/resolv.conf")) {
|
| |
+ while (<$fh>) {
|
| |
+ next if /:/; # ignore ipv6 addresses
|
| |
+ if ($_ =~ m/^nameserver +(.+)/) {
|
| |
+ push @forwards, $1;
|
| |
+ }
|
| |
+ }
|
| |
+ close($fh);
|
| |
+ }
|
| |
return @forwards;
|
| |
}
|
| |
|
| |
The worker containers aren’t using systemd-resolved so
get_host_dns() can’t find the dns server causing tests that need
it to fail. Add an alternative place to look for the dns server address
that doesn’t rely on systemd-resolved.
Signed-off-by: Deborah Brouwer deborah.brouwer@collabora.com