summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-03-02 09:16:26 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:49:04 -0500
commitb9df742fb4499563a7fc456f29039e1de9198d1e (patch)
treee18481b5dba1d48b6fba6367b8ad14aa8c4b4e94
parent0fff7ba143022d36064433e4494d83f9ba7d9944 (diff)
downloadsamba-b9df742fb4499563a7fc456f29039e1de9198d1e.tar.gz
samba-b9df742fb4499563a7fc456f29039e1de9198d1e.tar.bz2
samba-b9df742fb4499563a7fc456f29039e1de9198d1e.zip
r21649: Update self test scripts to start Fedora DS. This requires current
Fedora DS CVS, plus changes to split up 00core.ldif. Now we 'just' need to work to make the tests pass... Andrew Bartlett (This used to be commit d214cb1ccf1b30cd5cb81f98382626c609b23fa3)
-rw-r--r--source4/script/tests/mk-fedora-ds.sh56
-rwxr-xr-xsource4/script/tests/selftest.sh2
-rwxr-xr-xsource4/script/tests/test_functions.sh7
3 files changed, 35 insertions, 30 deletions
diff --git a/source4/script/tests/mk-fedora-ds.sh b/source4/script/tests/mk-fedora-ds.sh
index b10d46881c..28b9fe29ab 100644
--- a/source4/script/tests/mk-fedora-ds.sh
+++ b/source4/script/tests/mk-fedora-ds.sh
@@ -1,48 +1,37 @@
FEDORA_DS_INF=$LDAPDIR/fedorads.inf
export FEDORA_DS_INF
-FEDORA_DS_INITIAL_LDIF=$LDAPDIR/fedorads-initial-ldif.inf
-FEDORA_DS_LDAP_PORT=3389
+FEDORA_DS_INITIAL_LDIF=$LDAPDIR/fedorads-initial.ldif
-LDAP_URI="ldap://127.0.0.1:$FEDORA_DS_LDAP_PORT"
-
-$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
+#Make the subdirectory be as fedora DS would expect
+FEDORA_DS_DIR=$LDAPDIR/slapd-samba4
cat >$FEDORA_DS_INF <<EOF
-
[General]
SuiteSpotUserID = $ROOT
FullMachineName= localhost
ServerRoot= $LDAPDIR
-ConfigDirectoryLdapURL= $FEDORA_DS_LDAP_URI/o=NetscapeRoot
-ConfigDirectoryAdminID= $USERNAME
-AdminDomain= localdomain
-ConfigDirectoryAdminPwd= $PASSWORD
-
-Components= svrcore,base,slapd
[slapd]
-ServerPort= $FEDORA_DS_LDAP_PORT
+ldapifilepath=$LDAPDIR/ldapi
Suffix= $BASEDN
RootDN= cn=Manager,$BASEDN
RootDNPwd= $PASSWORD
-Components= slapd
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
+inst_dir= $FEDORA_DS_DIR
+config_dir= $FEDORA_DS_DIR
+schema_dir= $FEDORA_DS_DIR/schema
+lock_dir= $FEDORA_DS_DIR/lock
+log_dir= $FEDORA_DS_DIR/logs
+run_dir= $FEDORA_DS_DIR/logs
+db_dir= $FEDORA_DS_DIR/db
+bak_dir= $FEDORA_DS_DIR/bak
+tmp_dir= $FEDORA_DS_DIR/tmp
+ldif_dir= $FEDORA_DS_DIR/ldif
+cert_dir= $FEDORA_DS_DIR
-[base]
-Components= base
+start_server= 0
EOF
@@ -55,16 +44,25 @@ objectclass: top
objectclass: extensibleObject
objectclass: nsMappingTree
nsslapd-state: backend
-nsslapd-backend: UserData
+nsslapd-backend: userData
cn: $BASEDN
-dn: cn=UserData,cn=ldbm database,cn=plugins,cn=config
+dn: cn=userData,cn=ldbm database,cn=plugins,cn=config
objectclass: extensibleObject
objectclass: nsBackendInstance
nsslapd-suffix: $BASEDN
EOF
+perl $FEDORA_DS_PREFIX/bin/ds_newinst.pl $FEDORA_DS_INF || exit 1;
+
+(
+ cd $FEDORA_DS_DIR/schema
+ ls | grep -v ^00core | xargs rm
+)
+
+$srcdir/bin/ad2oLschema $CONFIGURATION -H $PRIVATEDIR/sam.ldb --option=convert:target=fedora-ds -I $srcdir/setup/schema-map-fedora-ds-1.0 -O $FEDORA_DS_DIR/schema/99_ad.ldif >&2
+
LDAP_URI_ESCAPE=$LDAP_URI;
PROVISION_OPTIONS="$PROVISION_OPTIONS --ldap-module=nsuniqueid"
#it is easier to base64 encode this than correctly escape it:
diff --git a/source4/script/tests/selftest.sh b/source4/script/tests/selftest.sh
index 92fba70c4a..7af5891abb 100755
--- a/source4/script/tests/selftest.sh
+++ b/source4/script/tests/selftest.sh
@@ -75,7 +75,7 @@ if [ x"$TEST_LDAP" = x"yes" ]; then
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;
+ fedora_ds_start || exit 1;
fi
echo -n "LDAP PROVISIONING..."
$srcdir/bin/smbscript $srcdir/setup/provision $PROVISION_OPTIONS "$PROVISION_ACI" --ldap-backend=$LDAP_URI || {
diff --git a/source4/script/tests/test_functions.sh b/source4/script/tests/test_functions.sh
index 9b869782cd..7f363fd04a 100755
--- a/source4/script/tests/test_functions.sh
+++ b/source4/script/tests/test_functions.sh
@@ -77,6 +77,13 @@ slapd_start() {
return $?;
}
+fedora_ds_start() {
+# running slapd in the background means it stays in the same process group, so it can be
+# killed by timelimit
+ $FEDORA_DS_PREFIX/sbin/ns-slapd -D $FEDORA_DS_DIR -d0 &
+ return $?;
+}
+
testit() {
name=$1
shift 1