From 5255ba3c4f50cf9560b15ecf026ac1e54fe21d8e Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 14 Aug 2009 10:21:04 +1000 Subject: [PATCH] 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 --- selftest/target/Samba4.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm index ab421d586cc5..3c0c4f5152d6 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) { -- 2.34.1