diff options
author | Andrew Bartlett <abartlet@samba.org> | 2007-03-07 11:05:59 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:49:22 -0500 |
commit | 45be80844e9a3ce888bd6a67b224e14517c4d93d (patch) | |
tree | 9774201b6a990448aaebbf40ceee643c0d273e19 /source4 | |
parent | 0012f7509a968e0a7a81c7504b5be27e467faa0d (diff) | |
download | samba-45be80844e9a3ce888bd6a67b224e14517c4d93d.tar.gz samba-45be80844e9a3ce888bd6a67b224e14517c4d93d.tar.bz2 samba-45be80844e9a3ce888bd6a67b224e14517c4d93d.zip |
r21743: Always use the 'escaped' LDAPI path.
Wait around for the server to start, so we don't try to contact it
during it's starup phase.
Andrew Bartlett
(This used to be commit f484b0a924809dd8c9861ade8d184fb44b3b5e1f)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/script/tests/Samba4.pm | 16 | ||||
-rwxr-xr-x | source4/script/tests/mk-fedora-ds.sh | 2 |
2 files changed, 13 insertions, 5 deletions
diff --git a/source4/script/tests/Samba4.pm b/source4/script/tests/Samba4.pm index 99e329e7b9..65b55fcee0 100644 --- a/source4/script/tests/Samba4.pm +++ b/source4/script/tests/Samba4.pm @@ -13,9 +13,10 @@ use strict; use FindBin qw($RealBin); use POSIX; -sub slapd_start($$) +sub slapd_start($$$) { - my ($conf, $uri, $loglevel) = @_; + my $count = 0; + my ($bindir, $conf, $uri) = @_; # running slapd in the background means it stays in the same process group, so it can be # killed by timelimit if (defined($ENV{FEDORA_DS_PREFIX})) { @@ -26,6 +27,14 @@ sub slapd_start($$) system("slapd -d$ENV{OPENLDAP_LOGLEVEL} -f $conf -h $uri > $ENV{LDAPDIR}/logs 2>&1 &"); $ENV{PATH} = $oldpath; } + while (system("$bindir/ldbsearch -H $uri -s base -b \"\" supportedLDAPVersion > /dev/null") != 0) { + $count++; + if ($count > 10) { + slapd_stop(); + return 0; + } + sleep(1); + } return 1; } @@ -103,7 +112,6 @@ sub wait_for_start() { # give time for nbt server to register its names print "delaying for nbt name registration\n"; - sleep(4); # This will return quickly when things are up, but be slow if we # need to wait for (eg) SSL init @@ -113,6 +121,8 @@ sub wait_for_start() system("bin/nmblookup $ENV{CONFIGURATION} -U $ENV{SERVER} $ENV{NETBIOSNAME}"); system("bin/nmblookup $ENV{CONFIGURATION} $ENV{NETBIOSNAME}"); system("bin/nmblookup $ENV{CONFIGURATION} -U $ENV{SERVER} $ENV{NETBIOSNAME}"); + system("bin/nmblookup $ENV{CONFIGURATION} $ENV{NETBIOSNAME}"); + system("bin/nmblookup $ENV{CONFIGURATION} -U $ENV{SERVER} $ENV{NETBIOSNAME}"); } sub provision($) diff --git a/source4/script/tests/mk-fedora-ds.sh b/source4/script/tests/mk-fedora-ds.sh index a36e7defee..7ea012d0cb 100755 --- a/source4/script/tests/mk-fedora-ds.sh +++ b/source4/script/tests/mk-fedora-ds.sh @@ -65,8 +65,6 @@ perl $FEDORA_DS_PREFIX/bin/ds_newinst.pl $FEDORA_DS_INF >&2 || exit 1; $srcdir/bin/ad2oLschema $CONFIGURATION -H $PRIVATEDIR/sam.ldb --option=convert:target=fedora-ds -I $srcdir/setup/schema-map-fedora-ds-1.0 -O $FEDORA_DS_DIR/schema/99_ad.ldif >&2 -LDAP_URI_ESCAPE="ldapi://"`echo $LDAPDIR/ldapi | sed 's|/|%2F|g'` - PROVISION_OPTIONS="$PROVISION_OPTIONS --ldap-module=nsuniqueid" #it is easier to base64 encode this than correctly escape it: # (targetattr = "*") (version 3.0;acl "full access to all by all";allow (all)(userdn = "ldap:///anyone");) |