diff options
author | Andrew Bartlett <abartlet@samba.org> | 2009-08-14 10:21:04 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2009-08-17 09:51:00 +1000 |
commit | 5255ba3c4f50cf9560b15ecf026ac1e54fe21d8e (patch) | |
tree | 78165304ce0b0d342b57972ccdac649281ab8c36 /selftest | |
parent | e7bae2eb0a103f9b8a26013017f510b7c6f8e4fc (diff) | |
download | samba-5255ba3c4f50cf9560b15ecf026ac1e54fe21d8e.tar.gz |
s4:selftest Confirm that there isn't a listener on the ldapi:// socket
This should help debug problems with 'make test' of the LDAP backend,
if a stray listener is still around.
Andrew Bartlett
Diffstat (limited to 'selftest')
-rw-r--r-- | selftest/target/Samba4.pm | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm index ab421d586cc..3c0c4f5152d 100644 --- a/selftest/target/Samba4.pm +++ b/selftest/target/Samba4.pm @@ -37,9 +37,14 @@ sub slapd_start($$) { my $count = 0; my ($self, $env_vars) = @_; + my $ldbsearch = $self->bindir_path("ldbsearch"); my $uri = $env_vars->{LDAP_URI}; + if (system("$ldbsearch -H $uri -s base -b \"\" supportedLDAPVersion > /dev/null") == 0) { + print "A SLAPD is still listening to $uri before we started the LDAP backend. Aborting!"; + return 1; + } # running slapd in the background means it stays in the same process group, so it can be # killed by timelimit if ($self->{ldap} eq "fedora-ds") { @@ -47,7 +52,6 @@ sub slapd_start($$) } elsif ($self->{ldap} eq "openldap") { system("$ENV{OPENLDAP_SLAPD} -d0 -F $env_vars->{SLAPD_CONF_D} -h $uri > $env_vars->{LDAPDIR}/logs 2>&1 &"); } - my $ldbsearch = $self->bindir_path("ldbsearch"); while (system("$ldbsearch -H $uri -s base -b \"\" supportedLDAPVersion > /dev/null") != 0) { $count++; if ($count > 40) { |