]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
Osstest/Debian.pm: Use Fqdn hostprop when collecting host keys
authorIan Campbell <ian.campbell@citrix.com>
Fri, 1 May 2015 10:20:45 +0000 (11:20 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 1 May 2015 14:11:06 +0000 (15:11 +0100)
Otherwise hosts which are not in the same DnsDomain are not processed,
resulting in log messages such as:

2015-05-01 10:06:19 Z skipping host key for nonexistent host marilith-n4.xs.citrite.net
2015-05-01 10:06:20 Z skipping host key for nonexistent host lace-bug.xs.citrite.net

The practical impact of this appears to be that the pair migration
tests can fail with:

2015-05-01 13:18:03 Z executing ssh ... root@10.80.250.26 xl migrate debian.guest.osstest moss-bug
Host key verification failed.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Osstest/Debian.pm

index 69530fb506c265e09897eae9ba20fe4e12d1ccd2..a577d1db3f2db395d84c8f999d7fc1bff64ad889 100644 (file)
@@ -659,7 +659,13 @@ sub preseed_create ($$;@) {
 END
     $hostsq->execute($flight);
     while (my ($node) = $hostsq->fetchrow_array()) {
-        my $longname= "$node.$c{TestHostDomain}";
+        my $defaultfqdn = $node;
+        $defaultfqdn .= ".$c{TestHostDomain}" unless $defaultfqdn =~ m/\./;
+
+        my %props;
+        $mhostdb->get_properties($node, \%props);
+
+        my $longname= $props{Fqdn} // $defaultfqdn;
         my (@hostent)= gethostbyname($longname);
         if (!@hostent) {
             logm("skipping host key for nonexistent host $longname");