Testsuite: for $parm_hostname use method more similar to readconf() $primary_hostname...
[users/heiko/exim.git] / 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 !~ /\./)