From 32c5107fabc2f87670d63dacb236b324a4a9b259 Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Tue, 25 Oct 2016 23:48:23 +0100 Subject: Testsuite: for $parm_hostname use method more similar to readconf() $primary_hostname coding --- test/runtest | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'test/runtest') diff --git a/test/runtest b/test/runtest index 5360b3303..b601e01cb 100755 --- a/test/runtest +++ b/test/runtest @@ -3145,8 +3145,15 @@ if ($parm_ipv6 =~ /^[\da-f]/) chomp($temp = `hostname`); die "'hostname' didn't return anything\n" unless defined $temp and length $temp; -$parm_hostname = (gethostbyname($temp))[0]; -$parm_hostname = "no.host.name.found" unless defined $parm_hostname and length $parm_hostname; +if ($temp =~ /\./) + { + $parm_hostname = $temp; + } +else + { + $parm_hostname = (gethostbyname($temp))[0]; + $parm_hostname = "no.host.name.found" unless defined $parm_hostname and length $parm_hostname; + } print "Hostname is $parm_hostname\n"; if ($parm_hostname !~ /\./) -- cgit v1.2.3