svn commit: samba r21068 - in branches/SAMBA_4_0/source/script/tests: .

abartlet at samba.org abartlet at samba.org
Wed Jan 31 01:28:56 GMT 2007


Author: abartlet
Date: 2007-01-31 01:28:55 +0000 (Wed, 31 Jan 2007)
New Revision: 21068

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=21068

Log:
Code to configure, start and stop Fedora DS.

We can't actually use it, as we are stuck inside our socket_wrapper
network, and can't talk to it.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/script/tests/mktestsetup.sh
   branches/SAMBA_4_0/source/script/tests/selftest.sh


Changeset:
Modified: branches/SAMBA_4_0/source/script/tests/mktestsetup.sh
===================================================================
--- branches/SAMBA_4_0/source/script/tests/mktestsetup.sh	2007-01-31 00:49:49 UTC (rev 21067)
+++ branches/SAMBA_4_0/source/script/tests/mktestsetup.sh	2007-01-31 01:28:55 UTC (rev 21068)
@@ -488,11 +488,11 @@
 EOF
 
 FEDORA_DS_LDAP_URI="ldap://127.0.0.1:$FEDORA_DS_LDAP_PORT"
-export FEDORA_DS_LDAP_URI
 
 cat >$FEDORA_DS_INF <<EOF
 
 [General]
+SuiteSpotUserID = $ROOT
 FullMachineName=   localhost
 ServerRoot=   $LDAPDIR
 ConfigDirectoryLdapURL=   $FEDORA_DS_LDAP_URI/o=NetscapeRoot
@@ -511,6 +511,18 @@
 ServerIdentifier= samba4
 InstallLdifFile=$FEDORA_DS_INITIAL_LDIF
 
+inst_dir= $LDAPDIR/slapd-samba4
+config_dir= $LDAPDIR/slapd-samba4
+schema_dir= $LDAPDIR/slapd-samba4/schema
+lock_dir= $LDAPDIR/slapd-samba4/lock
+log_dir= $LDAPDIR/slapd-samba4/logs
+run_dir= $LDAPDIR/slapd-samba4/logs
+db_dir= $LDAPDIR/slapd-samba4/db
+bak_dir= $LDAPDIR/slapd-samba4/bak
+tmp_dir= $LDAPDIR/slapd-samba4/tmp
+ldif_dir= $LDAPDIR/slapd-samba4/ldif
+cert_dir= $LDAPDIR/slapd-samba4
+
 [base]
 Components= base
 
@@ -541,17 +553,27 @@
 PROVISION_OPTIONS="$PROVISION_OPTIONS --simple-bind-dn=cn=Manager,$BASEDN --password=$PASSWORD --root=$ROOT"
 $srcdir/bin/smbscript $srcdir/setup/provision $PROVISION_OPTIONS >&2
 
-LDAPI="ldapi://$LDAPDIR/ldapi"
-LDAPI_ESCAPE="ldapi://"`echo $LDAPDIR/ldapi | sed 's|/|%2F|g'`
+if test -z "$FEDORA_DS_PREFIX"; then
+    LDAP_URI="ldapi://$LDAPDIR/ldapi"
+    LDAP_URI_ESCAPE="ldapi://"`echo $LDAPDIR/ldapi | sed 's|/|%2F|g'`
 export LDAPI
 export LDAPI_ESCAPE
+else
+    LDAP_URI=$FEDORA_DS_LDAP_URI;
+    LDAP_URI_ESCAPE=$FEDORA_DS_LDAP_URI;
+    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");)
+   PROVISION_ACI="--aci=aci:: KHRhcmdldGF0dHIgPSAiKiIpICh2ZXJzaW9uIDMuMDthY2wgImZ1bGwgYWNjZXNzIHRvIGFsbCBieSBhbGwiO2FsbG93IChhbGwpKHVzZXJkbiA9ICJsZGFwOi8vL2FueW9uZSIpOykK"
+fi
 
+
 #This uses the provision we just did, to read out the schema
 $srcdir/bin/ad2oLschema $CONFIGURATION -H $PRIVATEDIR/sam.ldb -I $srcdir/setup/schema-map-openldap-2.3 -O $LDAPDIR/ad.schema >&2
 $srcdir/bin/ad2oLschema $CONFIGURATION -H $PRIVATEDIR/sam.ldb --option=convert:target=fedora-ds -I $srcdir/setup/schema-map-fedora-ds-1.0 -O $LDAPDIR/99_ad.ldif >&2
 
 #Now create an LDAP baseDN
-$srcdir/bin/smbscript $srcdir/setup/provision $PROVISION_OPTIONS --ldap-base >&2
+$srcdir/bin/smbscript $srcdir/setup/provision $PROVISION_OPTIONS "$PROVISION_ACI" --ldap-base >&2
 
 OLDPATH=$PATH
 PATH=/usr/local/sbin:/usr/sbin:/sbin:$PATH
@@ -604,8 +626,9 @@
 echo "AUTH=$AUTH"
 echo "SERVER=$SERVER"
 echo "NETBIOSNAME=$NETBIOSNAME"
-echo "LDAPI=$LDAPI"
-echo "LDAPI_ESCAPE=$LDAPI_ESCAPE"
+echo "LDAP_URI=$LDAP_URI"
+echo "LDAP_URI_ESCAPE=$LDAP_URI_ESCAPE"
+echo "FEDORA_DS_INF=$FEDORA_DS_INF"
 echo "FEDORA_DS_LDAP_URI=$FEDORA_DS_LDAP_URI"
 echo "DOMAIN=$DOMAIN"
 echo "USERNAME=$USERNAME"

Modified: branches/SAMBA_4_0/source/script/tests/selftest.sh
===================================================================
--- branches/SAMBA_4_0/source/script/tests/selftest.sh	2007-01-31 00:49:49 UTC (rev 21067)
+++ branches/SAMBA_4_0/source/script/tests/selftest.sh	2007-01-31 01:28:55 UTC (rev 21068)
@@ -72,10 +72,14 @@
 
 #Start slapd before smbd
 if [ x"$TEST_LDAP" = x"yes" ]; then
-    slapd_start || exit 1;
+    if test -z "$FEDORA_DS_PREFIX"; then
+	slapd_start || exit 1;
+    else
+	perl $FEDORA_DS_PREFIX/lib/fedora-ds/ds_newinst.pl $FEDORA_DS_INF || exit 1;
+    fi
     echo -n "LDAP PROVISIONING..."
-    $srcdir/bin/smbscript $srcdir/setup/provision $PROVISION_OPTIONS --ldap-backend=$LDAPI || {
-	echo "LDAP PROVISIONING failed: $srcdir/bin/smbscript $srcdir/setup/provision $PROVISION_OPTIONS --ldap-backend=$LDAPI"
+    $srcdir/bin/smbscript $srcdir/setup/provision $PROVISION_OPTIONS "$PROVISION_ACI" --ldap-backend=$LDAP_URI || {
+	echo "LDAP PROVISIONING failed: $srcdir/bin/smbscript $srcdir/setup/provision $PROVISION_OPTIONS $PROVISION_ACI --ldap-backend=$LDAP_URI"
 	exit 1;
     }
     #LDAP is slow
@@ -246,7 +250,11 @@
 kill `cat $PIDDIR/smbd.pid`
 
 if [ "$TEST_LDAP"x = "yesx" ]; then
-    kill `cat $PIDDIR/slapd.pid`
+    if test -z "$FEDORA_DS_PREFIX"; then
+	kill `cat $PIDDIR/slapd.pid`
+    else
+	$LDAPDIR/slapd-samba4/stop-slapd
+    fi
 fi
 
 END=`date`



More information about the samba-cvs mailing list