source: vendor/3.6.23/examples/ad-bench/time_join.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.9 KB
Line 
1#!/bin/bash
2# AD-Bench Machine join/part 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
21ITERATIONS=100
22
23source `dirname $0`/utils.sh
24
25PRINCIPAL=$(get_principal $1)
26PASSWORD=$(get_password $1)
27REALM=$(get_realm $1)
28NT_DOM=$(get_nt_dom $1)
29
30join_domain () {
31 SERVER=$1
32 ${NET} ads join -k -s $CONFIG_FILE -S ${SERVER} > /dev/null
33 RET=$?
34 if [ $RET -ne 0 ]; then
35 echo "${NET} returned error: $RET"
36 exit 1
37 fi
38}
39
40leave_domain () {
41 SERVER=$1
42 ${NET} ads leave -k -s $CONFIG_FILE -S ${SERVER} > /dev/null
43 if [ $RET -ne 0 ]; then
44 echo "${NET} returned error: $RET"
45 exit 1
46 fi
47}
48
49set_up () {
50 set_krb_env
51 setup_kinit
52 call_kinit "${PRINCIPAL}" "${PASSWORD}"
53 write_configfile "${REALM}" "${NT_DOM}"
54}
55
56tear_down () {
57 ${KDESTROY}
58 restore_krb_env
59}
60
61set_up
62
63echo -e "\tJOIN $2"
64
65START_TIME=$(start_timer)
66
67echo -en "\t"
68for i in $( ${SEQ} 1 $ITERATIONS ); do
69 join_domain $2
70 leave_domain $2
71 echo -n "."
72done
73echo "done"
74
75STOP_TIME=$(stop_timer)
76
77TOTAL_TIME=$( total_time $START_TIME $STOP_TIME )
78
79echo -e "\t\ttotal time:\t\t${TOTAL_TIME}s"
80
81LOGINS_PER_MINUTE=$(iterations_per_minute $START_TIME $STOP_TIME $ITERATIONS)
82
83echo -e "\t\titerations/min:\t\t$LOGINS_PER_MINUTE"
84
85tear_down
Note: See TracBrowser for help on using the repository browser.