From 4895349431549e42d673fa84992d7209ebf97756 Mon Sep 17 00:00:00 2001 From: Love Hornquist Astrand Date: Sun, 19 Jul 2009 17:59:23 -0700 Subject: [PATCH] allow testing sqlite hdb backend --- tests/db/Makefile.am | 9 +++++++-- tests/db/krb5.conf.in | 6 +++--- tests/db/loaddump-db.in | 12 +++++++++--- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/tests/db/Makefile.am b/tests/db/Makefile.am index 97111024f..9615ac95e 100644 --- a/tests/db/Makefile.am +++ b/tests/db/Makefile.am @@ -2,7 +2,7 @@ include $(top_srcdir)/Makefile.am.common -noinst_DATA = krb5.conf +noinst_DATA = krb5.conf krb5.conf-sqlite noinst_SCRIPTS = have-db @@ -40,9 +40,13 @@ have-db: have-db.in Makefile mv have-db.tmp have-db 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 +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= \ $(TESTS) \ @@ -54,6 +58,7 @@ CLEANFILES= \ out-current-* \ mkey.file* \ krb5.conf krb5.conf.tmp \ + krb5.conf-sqlite krb5.conf-sqlite.tmp \ tempfile \ log.current-db* \ messages.log diff --git a/tests/db/krb5.conf.in b/tests/db/krb5.conf.in index 446db316c..0e91fee7b 100644 --- a/tests/db/krb5.conf.in +++ b/tests/db/krb5.conf.in @@ -10,15 +10,15 @@ database = { label = { realm = LABEL.TEST.H5L.SE - dbname = @objdir@/label-db + dbname = @type@@objdir@/label-db mkey_file = @objdir@/mkey.file } label2 = { - dbname = @objdir@/lable2-db + dbname = @type@@objdir@/lable2-db realm = LABEL2.TEST.H5L.SE mkey_file = @objdir@/mkey2.file } - dbname = @objdir@/current-db + dbname = @type@@objdir@/current-db realm = EXAMPLE.ORG mkey_file = @objdir@/mkey.file log_file = @objdir@/log.current-db.log diff --git a/tests/db/loaddump-db.in b/tests/db/loaddump-db.in index 4a2073f3b..23be62e08 100644 --- a/tests/db/loaddump-db.in +++ b/tests/db/loaddump-db.in @@ -47,11 +47,15 @@ kstash="../../kdc/kstash" hprop="../../kdc/hprop" hpropd="../../kdc/hpropd" -propdb="${hprop} --database=./current-db -n" -propddb="${hpropd} --database=./current-db -n" +type="${1}" +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 rm -f current-db* @@ -78,6 +82,8 @@ rm -f current-db* ${kadmin} load ${srcdir}/text-dump-0.7 || exit 1 ${propdb} > db-dump.tmp|| exit 1 rm -f current-db* +echo "${propddb} < db-dump.tmp" +bash ${propddb} < db-dump.tmp || exit 1 ${kadmin} dump | sort | sed 's/[0-9]* -$//' > out-text-dump-0.7 || exit 1 sort < ${srcdir}/text-dump-0.7 | \