From 6376a474c7c873bfb0f9747d13056567c902635a Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 6 Mar 2007 06:30:36 +0000 Subject: r21720: Try to make 'TEST_LDAP=yes make test' work again. These recent changes seem to have been lost in the merge, and some variables were not yet exported. Andrew Bartlett (This used to be commit ee9d9fb6c0bd3d4d01dea771025536ff83057072) --- source4/script/tests/Samba4.pm | 12 ++++++------ source4/script/tests/mk-fedora-ds.sh | 5 +++-- source4/script/tests/mk-openldap.sh | 5 ----- source4/script/tests/mktestsetup.sh | 6 +++++- source4/script/tests/selftest.pl | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/source4/script/tests/Samba4.pm b/source4/script/tests/Samba4.pm index defca23d9f..f81d75ffd3 100644 --- a/source4/script/tests/Samba4.pm +++ b/source4/script/tests/Samba4.pm @@ -16,17 +16,17 @@ use POSIX; sub slapd_start($$) { my ($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})) { - system("$ENV{FEDORA_DS_PREFIX}/lib/fedora-ds/ds_newinst.pl $ENV{FEDORA_DS_INF}") or die("Unable to provision fedora ds ldapd"); + system("$ENV{FEDORA_DS_PREFIX}/sbin/ns-slapd -D $ENV{FEDORA_DS_DIR} -d0 &"); } else { my $oldpath = $ENV{PATH}; $ENV{PATH} = "/usr/local/sbin:/usr/sbin:/sbin:$ENV{PATH}"; - # running slapd in the background means it stays in the same process group, so it can be - # killed by timelimit system("slapd -d0 -f $conf -h $uri &"); $ENV{PATH} = $oldpath; } - return $? >> 8; + return 1; } sub slapd_stop() @@ -132,8 +132,8 @@ sub provision($) sub provision_ldap($$) { my ($bindir, $setupdir) = @_; - system("$bindir/smbscript $setupdir/provision $ENV{PROVISION_OPTIONS} \"$ENV{PROVISION_ACI}\" --ldap-backend=$ENV{LDAPI}") or - die("LDAP PROVISIONING failed: $bindir/smbscript $setupdir/provision $ENV{PROVISION_OPTIONS} \"$ENV{PROVISION_ACI}\" --ldap-backend=$ENV{LDAPI}"); + system("$bindir/smbscript $setupdir/provision $ENV{PROVISION_OPTIONS} \"$ENV{PROVISION_ACI}\" --ldap-backend=$ENV{LDAP_URI}") and + die("LDAP PROVISIONING failed: $bindir/smbscript $setupdir/provision $ENV{PROVISION_OPTIONS} \"$ENV{PROVISION_ACI}\" --ldap-backend=$ENV{LDAP_URI}"); } 1; diff --git a/source4/script/tests/mk-fedora-ds.sh b/source4/script/tests/mk-fedora-ds.sh index 28b9fe29ab..b198a768db 100755 --- a/source4/script/tests/mk-fedora-ds.sh +++ b/source4/script/tests/mk-fedora-ds.sh @@ -1,9 +1,9 @@ FEDORA_DS_INF=$LDAPDIR/fedorads.inf -export FEDORA_DS_INF FEDORA_DS_INITIAL_LDIF=$LDAPDIR/fedorads-initial.ldif #Make the subdirectory be as fedora DS would expect FEDORA_DS_DIR=$LDAPDIR/slapd-samba4 +echo FEDORA_DS_DIR=$FEDORA_DS_DIR cat >$FEDORA_DS_INF <&2 -LDAP_URI_ESCAPE=$LDAP_URI; +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");) diff --git a/source4/script/tests/mk-openldap.sh b/source4/script/tests/mk-openldap.sh index 0759532d3f..312c51a833 100755 --- a/source4/script/tests/mk-openldap.sh +++ b/source4/script/tests/mk-openldap.sh @@ -80,11 +80,6 @@ cat > $LDAPDIR/db/DB_CONFIG <&2 diff --git a/source4/script/tests/mktestsetup.sh b/source4/script/tests/mktestsetup.sh index a92def64fd..573af70150 100755 --- a/source4/script/tests/mktestsetup.sh +++ b/source4/script/tests/mktestsetup.sh @@ -255,6 +255,9 @@ PROVISION_OPTIONS="$PROVISION_OPTIONS --adminpass $PASSWORD --root=$ROOT" PROVISION_OPTIONS="$PROVISION_OPTIONS --simple-bind-dn=cn=Manager,$BASEDN --password=$PASSWORD --root=$ROOT" $srcdir/bin/smbscript $srcdir/setup/provision $PROVISION_OPTIONS >&2 +LDAP_URI="ldapi://$LDAPDIR/ldapi" +LDAP_URI_ESCAPE="ldapi://"`echo $LDAPDIR/ldapi | sed 's|/|%2F|g'` + . `dirname $0`/mk-openldap.sh test -z "$FEDORA_DS_PREFIX" || { @@ -285,7 +288,6 @@ echo "SERVER=$SERVER" echo "NETBIOSNAME=$NETBIOSNAME" echo "LDAP_URI=$LDAP_URI" echo "LDAP_URI_ESCAPE=$LDAP_URI_ESCAPE" -echo "FEDORA_DS_INF=$FEDORA_DS_INF" echo "DOMAIN=$DOMAIN" echo "USERNAME=$USERNAME" echo "REALM=$REALM" @@ -296,3 +298,5 @@ echo "SRCDIR=$SRCDIR" echo "PREFIX=$PREFIX" echo "SMBD_LOGLEVEL=$SMBD_LOGLEVEL" echo "LDAPDIR=$LDAPDIR" +echo "PROVISION_OPTIONS=$PROVISION_OPTIONS" +echo "PROVISION_ACI=$PROVISION_ACI" \ No newline at end of file diff --git a/source4/script/tests/selftest.pl b/source4/script/tests/selftest.pl index 88bf723bdb..c62b073afc 100755 --- a/source4/script/tests/selftest.pl +++ b/source4/script/tests/selftest.pl @@ -416,7 +416,7 @@ if ($opt_socket_wrapper) # Start slapd before smbd if ($ldap) { - Samba4::slapd_start($ENV{SLAPD_CONF}, $ENV{LDAPI_ESCAPE}) or die("couldn't start slapd"); + Samba4::slapd_start($ENV{SLAPD_CONF}, $ENV{LDAP_URI_ESCAPE}) or die("couldn't start slapd"); print "LDAP PROVISIONING..."; Samba4::provision_ldap($bindir, $setupdir); -- cgit