From: Andrew Bartlett Date: Thu, 15 Jun 2017 04:20:11 +0000 (+1200) Subject: selftest: Also wait for winbindd to start X-Git-Tag: tevent-0.9.32~92 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1b88c5d4c0e5da2e4092a06f6cd6bf3c8b767883;p=thirdparty%2Fsamba.git selftest: Also wait for winbindd to start 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 Reviewed-by: Jeremy Allison Reviewed-by: Stefan Metzmacher --- diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm index c52c99b1759..ea81d7dd9da 100755 --- a/selftest/target/Samba4.pm +++ b/selftest/target/Samba4.pm @@ -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