From d214cb1ccf1b30cd5cb81f98382626c609b23fa3 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 2 Mar 2007 09:16:26 +0000 Subject: [PATCH] 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 --- source/script/tests/mk-fedora-ds.sh | 56 +++++++++++++-------------- source/script/tests/selftest.sh | 2 +- source/script/tests/test_functions.sh | 7 ++++ 3 files changed, 35 insertions(+), 30 deletions(-) diff --git a/source/script/tests/mk-fedora-ds.sh b/source/script/tests/mk-fedora-ds.sh index b10d46881c3..28b9fe29abe 100644 --- a/source/script/tests/mk-fedora-ds.sh +++ b/source/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 <&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/source/script/tests/selftest.sh b/source/script/tests/selftest.sh index 92fba70c4a5..7af5891abb9 100755 --- a/source/script/tests/selftest.sh +++ b/source/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/source/script/tests/test_functions.sh b/source/script/tests/test_functions.sh index 9b869782cd5..7f363fd04a8 100755 --- a/source/script/tests/test_functions.sh +++ b/source/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