summaryrefslogtreecommitdiff
path: root/source4/script
diff options
context:
space:
mode:
Diffstat (limited to 'source4/script')
-rw-r--r--source4/script/tests/Samba4.pm16
-rwxr-xr-xsource4/script/tests/mk-fedora-ds.sh2
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");)