allow testing sqlite hdb backend

This commit is contained in:
Love Hornquist Astrand
2009-07-19 17:59:23 -07:00
parent 82150be255
commit 4895349431
3 changed files with 19 additions and 8 deletions

View File

@@ -2,7 +2,7 @@
include $(top_srcdir)/Makefile.am.common include $(top_srcdir)/Makefile.am.common
noinst_DATA = krb5.conf noinst_DATA = krb5.conf krb5.conf-sqlite
noinst_SCRIPTS = have-db noinst_SCRIPTS = have-db
@@ -40,9 +40,13 @@ have-db: have-db.in Makefile
mv have-db.tmp have-db mv have-db.tmp have-db
krb5.conf: krb5.conf.in Makefile krb5.conf: krb5.conf.in Makefile
$(do_subst) < $(srcdir)/krb5.conf.in > krb5.conf.tmp $(do_subst) -e 's,[@]type[@],,g' < $(srcdir)/krb5.conf.in > krb5.conf.tmp
mv krb5.conf.tmp krb5.conf mv krb5.conf.tmp krb5.conf
krb5.conf-sqlite: krb5.conf.in Makefile
$(do_subst) -e 's,[@]type[@],sqlite:,g' < $(srcdir)/krb5.conf.in > krb5.conf-sqlite.tmp
mv krb5.conf-sqlite.tmp krb5.conf-sqlite
CLEANFILES= \ CLEANFILES= \
$(TESTS) \ $(TESTS) \
@@ -54,6 +58,7 @@ CLEANFILES= \
out-current-* \ out-current-* \
mkey.file* \ mkey.file* \
krb5.conf krb5.conf.tmp \ krb5.conf krb5.conf.tmp \
krb5.conf-sqlite krb5.conf-sqlite.tmp \
tempfile \ tempfile \
log.current-db* \ log.current-db* \
messages.log messages.log

View File

@@ -10,15 +10,15 @@
database = { database = {
label = { label = {
realm = LABEL.TEST.H5L.SE realm = LABEL.TEST.H5L.SE
dbname = @objdir@/label-db dbname = @type@@objdir@/label-db
mkey_file = @objdir@/mkey.file mkey_file = @objdir@/mkey.file
} }
label2 = { label2 = {
dbname = @objdir@/lable2-db dbname = @type@@objdir@/lable2-db
realm = LABEL2.TEST.H5L.SE realm = LABEL2.TEST.H5L.SE
mkey_file = @objdir@/mkey2.file mkey_file = @objdir@/mkey2.file
} }
dbname = @objdir@/current-db dbname = @type@@objdir@/current-db
realm = EXAMPLE.ORG realm = EXAMPLE.ORG
mkey_file = @objdir@/mkey.file mkey_file = @objdir@/mkey.file
log_file = @objdir@/log.current-db.log log_file = @objdir@/log.current-db.log

View File

@@ -47,11 +47,15 @@ kstash="../../kdc/kstash"
hprop="../../kdc/hprop" hprop="../../kdc/hprop"
hpropd="../../kdc/hpropd" hpropd="../../kdc/hpropd"
propdb="${hprop} --database=./current-db -n" type="${1}"
propddb="${hpropd} --database=./current-db -n" typesep="${type+:}"
typeconf="${type+-}"
KRB5_CONFIG="${objdir}/krb5.conf" propdb="${hprop} --database=${type}${typesep}./current-db -n"
propddb="${hpropd} --database=${type}${typesep}./current-db -n"
KRB5_CONFIG="${objdir}/krb5.conf${typeconf}${type}"
export KRB5_CONFIG export KRB5_CONFIG
rm -f current-db* rm -f current-db*
@@ -78,6 +82,8 @@ rm -f current-db*
${kadmin} load ${srcdir}/text-dump-0.7 || exit 1 ${kadmin} load ${srcdir}/text-dump-0.7 || exit 1
${propdb} > db-dump.tmp|| exit 1 ${propdb} > db-dump.tmp|| exit 1
rm -f current-db* rm -f current-db*
echo "${propddb} < db-dump.tmp"
bash
${propddb} < db-dump.tmp || exit 1 ${propddb} < db-dump.tmp || exit 1
${kadmin} dump | sort | sed 's/[0-9]* -$//' > out-text-dump-0.7 || exit 1 ${kadmin} dump | sort | sed 's/[0-9]* -$//' > out-text-dump-0.7 || exit 1
sort < ${srcdir}/text-dump-0.7 | \ sort < ${srcdir}/text-dump-0.7 | \