From cfb308d643592835d7ec7c39ed925903ae5dd129 Mon Sep 17 00:00:00 2001 From: Kai Blin Date: Wed, 26 Aug 2009 13:37:18 +0200 Subject: [PATCH] Initial commit of the Active Directory benchmark scripts. So far, the benchmark times kinit/kdestroy cycles per minute --- README | 1 + time_kinit.sh | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 README create mode 100644 time_kinit.sh diff --git a/README b/README new file mode 100644 index 0000000..e9992a0 --- /dev/null +++ b/README @@ -0,0 +1 @@ +PRELIMINARY Active Directory benchmarks. diff --git a/time_kinit.sh b/time_kinit.sh new file mode 100644 index 0000000..828f013 --- /dev/null +++ b/time_kinit.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +TIME=time +KINIT=kinit +KDESTROY=kdestroy +DATE=date +SEQ=seq + +PRINCIPAL="${1}" +PASSWORD="${2}" + +OLD_KRB5CCNAME="${KRB5CCNAME}" +KRB5CCNAME=/tmp/ad_test_ccname +export KRB5CCNAME + +START_TIME=`${DATE} "+%s"` + +for i in `${SEQ} 1 10`; do + echo ${PASSWORD} | ${KINIT} --password-file=STDIN ${PRINCIPAL} + if [ $? -ne 0 ]; then + echo "kinit returned an error\n" + exit 1 + fi + ${KDESTROY} +done + +END_TIME=`${DATE} "+%s"` + +TOTAL_TIME=$(echo "$END_TIME - $START_TIME"| bc -l) + +LOGINS_PER_MINUTE=$(echo "scale=2; 60 * 10 / $TOTAL_TIME" | bc) + +echo "Performed $LOGINS_PER_MINUTE kinit/kdestroy cycles per minute" + +KRB5CCNAME="${OLD_KRB5CCNAME}" +export KRB5CCNAME + -- 2.34.1