Testsuite: for $parm_hostname use method more similar to readconf() $primary_hostname...
authorJeremy Harris <jgh146exb@wizmail.org>
Tue, 25 Oct 2016 22:48:23 +0000 (23:48 +0100)
committerJeremy Harris <jgh146exb@wizmail.org>
Tue, 25 Oct 2016 22:48:23 +0000 (23:48 +0100)
test/runtest

index 5360b3303c36d21941459b58a5e66c4ef7fc998c..b601e01cbb29ce9cf9d55499a516a3a7fa9a99ba 100755 (executable)
@@ -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 !~ /\./)