Author: abartlet Date: 2007-12-21 02:33:43 +0000 (Fri, 21 Dec 2007) New Revision: 26556
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=26556 Log: Make Fedora DS consistant use FEDORA_DS_ROOT, now we use OPENLDAP_ROOT. Add in another varient to test with in the OpenLDAP module-guessing game, from Howard Chu. Andrew Bartlett Modified: branches/SAMBA_4_0/source/selftest/env/Samba4.pm branches/SAMBA_4_0/source/selftest/selftest.pl Changeset: Modified: branches/SAMBA_4_0/source/selftest/env/Samba4.pm =================================================================== --- branches/SAMBA_4_0/source/selftest/env/Samba4.pm 2007-12-21 00:36:17 UTC (rev 26555) +++ branches/SAMBA_4_0/source/selftest/env/Samba4.pm 2007-12-21 02:33:43 UTC (rev 26556) @@ -46,7 +46,7 @@ # 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") { - system("$ENV{FEDORA_DS_PREFIX}/sbin/ns-slapd -D $env_vars->{FEDORA_DS_DIR} -d0 -i $env_vars->{FEDORA_DS_PIDFILE}> $env_vars->{LDAPDIR}/logs 2>&1 &"); + system("$ENV{FEDORA_DS_ROOT}/sbin/ns-slapd -D $env_vars->{FEDORA_DS_DIR} -d0 -i $env_vars->{FEDORA_DS_PIDFILE}> $env_vars->{LDAPDIR}/logs 2>&1 &"); } elsif ($self->{ldap} eq "openldap") { openldap_start($env_vars->{SLAPD_CONF}, $uri, "$env_vars->{LDAPDIR}/logs"); } @@ -204,10 +204,10 @@ system("$self->{bindir}/ad2oLschema $configuration -H $ldapdir/schema-tmp.ldb --option=convert:target=fedora-ds -I $self->{setupdir}/schema-map-fedora-ds-1.0 -O $ldapdir/99_ad.ldif >&2") == 0 or die("schema conversion for Fedora DS failed"); my $dir = getcwd(); -chdir "$ENV{FEDORA_DS_PREFIX}/bin" || die; - if (system("perl $ENV{FEDORA_DS_PREFIX}/sbin/setup-ds.pl --silent --file=$fedora_ds_inf >&2") != 0) { +chdir "$ENV{FEDORA_DS_ROOT}/bin" || die; + if (system("perl $ENV{FEDORA_DS_ROOT}/sbin/setup-ds.pl --silent --file=$fedora_ds_inf >&2") != 0) { chdir $dir; - die("perl $ENV{FEDORA_DS_PREFIX}/sbin/setup-ds.pl --silent --file=$fedora_ds_inf FAILED: $?"); + die("perl $ENV{FEDORA_DS_ROOT}/sbin/setup-ds.pl --silent --file=$fedora_ds_inf FAILED: $?"); } chdir $dir || die; @@ -227,10 +227,10 @@ my $oldpath = $ENV{PATH}; my $olpath = ""; - my $olroot = ""; - if (defined $ENV{OPENLDAP_ROOT}) { + my $olroot = ""; + if (defined $ENV{OPENLDAP_ROOT}) { $olroot = "$ENV{OPENLDAP_ROOT}"; - $olpath = "$olroot/libexec:$olroot/sbin:"; + $olpath = "$olroot/libexec:$olroot/sbin:"; } $ENV{PATH} = "$olpath/usr/local/sbin:/usr/sbin:/sbin:$ENV{PATH}"; @@ -241,6 +241,7 @@ open(CONF, ">$modconf"); # enable slapd modules print CONF " +modulepath $olpath/libexec/openldap moduleload back_hdb moduleload syncprov "; @@ -251,6 +252,16 @@ open(CONF, ">$modconf"); # enable slapd modules print CONF " +moduleload back_hdb +moduleload syncprov +"; + close(CONF); + } + + if (system("slaptest -u -f $slapd_conf >&2") != 0) { + open(CONF, ">$modconf"); + # enable slapd modules + print CONF " modulepath /usr/lib/ldap moduleload back_hdb moduleload syncprov Modified: branches/SAMBA_4_0/source/selftest/selftest.pl =================================================================== --- branches/SAMBA_4_0/source/selftest/selftest.pl 2007-12-21 00:36:17 UTC (rev 26555) +++ branches/SAMBA_4_0/source/selftest/selftest.pl 2007-12-21 02:33:43 UTC (rev 26556) @@ -356,7 +356,7 @@ # Backwards compatibility: if (defined($ENV{TEST_LDAP}) and $ENV{TEST_LDAP} eq "yes") { - if (defined($ENV{FEDORA_DS_PREFIX})) { + if (defined($ENV{FEDORA_DS_ROOT})) { $ldap = "fedora-ds"; } else { $ldap = "openldap";
