source: vendor/3.6.23/examples/ad-bench/time_kinit.sh

Last change on this file was 740, checked in by Silvan Scherrer, 13 years ago

Samba Server: update vendor to 3.6.0

File size: 1.6 KB
Line 
1#!/bin/bash
2# AD-Bench Kerberos ticket benchmark
3#
4# Copyright (C) 2009 Kai Blin <kai@samba.org>
5#
6# This file is part of AD-Bench, an Active Directory benchmark tool.
7#
8# AD-Bench is free software: you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12#
13# AD-Bench is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with AD-Bench. If not, see <http://www.gnu.org/licenses/>.
20
21# Iterations are set per test, so more time-consuming tests can be run less
22# often
23ITERATIONS=100
24
25source `dirname $0`/utils.sh
26
27set_up () {
28 set_krb_env
29 setup_kinit
30}
31
32tear_down () {
33 restore_krb_env
34}
35
36set_up
37
38PRINCIPAL=$( get_principal $1)
39PASSWORD=$( get_password $1)
40
41echo -e "\tKINIT ${PRINCIPAL}"
42
43START_TIME=$( start_timer )
44
45echo -en "\t"
46for i in $(${SEQ} 1 $ITERATIONS); do
47 call_kinit "${PRINCIPAL}" "${PASSWORD}"
48 ${KDESTROY}
49 echo -n "."
50done
51echo "done"
52
53STOP_TIME=$( stop_timer )
54
55TOTAL_TIME=$( total_time $START_TIME $STOP_TIME )
56
57echo -e "\t\ttotal time:\t\t${TOTAL_TIME}s"
58
59LOGINS_PER_MINUTE=$(iterations_per_minute $START_TIME $STOP_TIME $ITERATIONS)
60
61echo -e "\t\titerations/min:\t\t$LOGINS_PER_MINUTE"
62
63tear_down
Note: See TracBrowser for help on using the repository browser.