Add --with-db-type-preference config param

This commit is contained in:
Nicolas Williams
2015-06-01 15:29:41 -05:00
parent c6f24e99f0
commit a94dc50114
9 changed files with 62 additions and 9 deletions

View File

@@ -14,6 +14,7 @@ do_subst = sed -e 's,[@]srcdir[@],$(srcdir),g' \
-e 's,[@]top_builddir[@],$(top_builddir),g' \
-e 's,[@]objdir[@],$(top_builddir)/tests/db,g' \
-e 's,[@]default_db_type[@],$(db_type),g' \
-e 's,[@]db_type_preference[@],$(db_type_preference),g' \
-e 's,[@]EGREP[@],$(EGREP),g'
loaddump-db: loaddump-db.in Makefile

View File

@@ -48,7 +48,7 @@ R=TEST.H5L.SE
kadmin="${TESTS_ENVIRONMENT} ../../kadmin/kadmin -l"
KRB5_CONFIG="${objdir}/krb5.conf"
KRB5_CONFIG="${objdir}/krb5.conf-${db_type}"
export KRB5_CONFIG
rm -f current-db*

View File

@@ -37,7 +37,10 @@
srcdir="@srcdir@"
objdir="@objdir@"
KRB5_CONFIG="${objdir}/krb5.conf"
default_db_type=@default_db_type@
db_type=${1:-${default_db_type}}
KRB5_CONFIG="${objdir}/krb5.conf-${db_type}"
export KRB5_CONFIG
../../lib/hdb/test_dbinfo > dbinfo.out || exit 1

View File

@@ -38,6 +38,18 @@ top_builddir="@top_builddir@"
. ${top_builddir}/tests/bin/setup-env
if [ $# != 0 ]; then
for type in "$@"; do
for have_type in \
`${kdc} --builtin-hdb | sed 's/^builtin hdb backends: //'`; do
if [ "$type" = "$have_type" ]; then
exit 0
fi
done
done
exit 1
fi
list=`${kdc} --builtin-hdb | sed 's/^builtin hdb backends: //'`
oldIFS="$IFS"
IPS=,
@@ -52,6 +64,7 @@ while [ $# != 0 ] ; do
db4:*) exit 0 ;;
db3:*) exit 0 ;;
lmdb:*) exit 0 ;;
sqlite:*) exit 0 ;;
esac
shift
done

View File

@@ -58,6 +58,7 @@ do_subst = $(heim_verbose)sed $(do_dlopen) \
-e 's,[@]pwport[@],$(pwport),g' \
-e 's,[@]objdir[@],$(top_builddir)/tests/kdc,g' \
-e 's,[@]top_builddir[@],$(top_builddir),g' \
-e 's,[@]db_type[@],$(db_type),g' \
-e 's,[@]EGREP[@],$(EGREP),g'
chmod = chmod

View File

@@ -35,8 +35,7 @@ top_builddir="@top_builddir@"
env_setup="@env_setup@"
objdir="@objdir@"
default_db_type=@default_db_type@
db_type=${1:-${default_db_type}}
db_type=@db_type@
. ${env_setup}
@@ -175,6 +174,11 @@ sleep 2
KRB5_CONFIG="${objdir}/krb5-slave.conf" \
${kadmin} -l get host/bar@${R} > /dev/null 2>/dev/null && exit 1
# See note below in LMDB sanity checking
echo "Re-add host"
${kadmin} -l add --random-key --use-defaults host/foo@${R} || exit 1
${kadmin} -l add --random-key --use-defaults host/bar@${R} || exit 1
echo "kill slave and remove log and database"
> iprop-stats
sh ${leaks_kill} ipropd-slave $ipds || exit 1
@@ -337,4 +341,14 @@ ${iprop_log} last-version > slave-last.tmp
${iprop_log} last-version > master-last.tmp
cmp master-last.tmp slave-last.tmp || exit 1
if [ "$db_type" = lmdb ]; then
# Sanity check that we have the same number of principals at the HDB
# and LMDB levels.
#
echo "checking that principals in DB == entries in LMDB"
princs=`${kadmin} -l list '*' | wc -l`
entries=`mdb_stat -n current-db.mdb | grep 'Entries:' | awk '{print $2}'`
[ "`expr 1 + "$princs"`" -eq "$entries" ] || exit 1
fi
exit $ec

View File

@@ -72,14 +72,14 @@
database = {
label = {
dbname = @objdir@/current-db@kdc@
dbname = @db_type@:@objdir@/current-db@kdc@
realm = TEST.H5L.SE
mkey_file = @objdir@/mkey.file
acl_file = @srcdir@/heimdal.acl
log_file = @objdir@/current@kdc@.log
}
label2 = {
dbname = @objdir@/current-db@kdc@
dbname = @db_type@:@objdir@/current-db@kdc@
realm = TEST2.H5L.SE
mkey_file = @objdir@/mkey.file
acl_file = @srcdir@/heimdal.acl