selftest: Wait for the logon server to register to join the member.
authorAndreas Schneider <asn@samba.org>
Tue, 9 Sep 2014 07:47:05 +0000 (09:47 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 18 Dec 2014 05:47:40 +0000 (06:47 +0100)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
selftest/target/Samba3.pm

index 50c26429d5f9a4a32a39ff46bb01f920e5c729c4..4c9124df25786fb7996e85dcac096f45fe486936 100755 (executable)
@@ -242,6 +242,8 @@ sub setup_s3dc($$)
 sub setup_member($$$)
 {
        my ($self, $prefix, $s3dcvars) = @_;
+       my $count = 0;
+       my $rc;
 
        print "PROVISIONING MEMBER...";
 
@@ -257,6 +259,21 @@ sub setup_member($$$)
 
        $ret or return undef;
 
+       my $nmblookup = Samba::bindir_path($self, "nmblookup");
+       do {
+               print "Waiting for the LOGON SERVER registration ...\n";
+               $rc = system("$nmblookup $ret->{CONFIGURATION} $ret->{DOMAIN}\#1c");
+               if ($rc != 0) {
+                       sleep(1);
+               }
+               $count++;
+       } while ($rc != 0 && $count < 10);
+       if ($count == 10) {
+               print "NMBD not reachable after 10 retries\n";
+               teardown_env($self, $ret);
+               return 0;
+       }
+
        my $net = Samba::bindir_path($self, "net");
        my $cmd = "";
        $cmd .= "SOCKET_WRAPPER_DEFAULT_IFACE=\"$ret->{SOCKET_WRAPPER_DEFAULT_IFACE}\" ";