]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
selftest: Also wait for winbindd to start
authorAndrew Bartlett <abartlet@samba.org>
Thu, 15 Jun 2017 04:20:11 +0000 (16:20 +1200)
committerStefan Metzmacher <metze@samba.org>
Fri, 16 Jun 2017 17:34:17 +0000 (19:34 +0200)
This ensures that the posixacl.py test does not race against winbindd starting up and so
give wrong mappings

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12843

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
selftest/target/Samba4.pm

index c52c99b1759ab57485a4761a7b7370cdafae7c72..ea81d7dd9da4c7277253f7d7a49dcb48bd7fd6f4 100755 (executable)
@@ -245,6 +245,28 @@ sub wait_for_start($$)
                        sleep(1);
                }
        }
+
+       my $wbinfo =  Samba::bindir_path($self, "wbinfo");
+
+       $count = 0;
+       do {
+               my $cmd = "NSS_WRAPPER_PASSWD=$testenv_vars->{NSS_WRAPPER_PASSWD} ";
+               $cmd .= "NSS_WRAPPER_GROUP=$testenv_vars->{NSS_WRAPPER_GROUP} ";
+               $cmd .= "SELFTEST_WINBINDD_SOCKET_DIR=$testenv_vars->{SELFTEST_WINBINDD_SOCKET_DIR} ";
+               $cmd .= "$wbinfo -p";
+               $ret = system($cmd);
+
+               if ($ret != 0) {
+                       sleep(1);
+               }
+               $count++;
+       } while ($ret != 0 && $count < 20);
+       if ($count == 20) {
+               warn("winbind not reachable after 20 retries\n");
+               teardown_env($self, $testenv_vars);
+               return 0;
+       }
+
        print $self->getlog_env($testenv_vars);
 
        return $ret