2 # AD-Bench Machine join/part benchmark
4 # Copyright (C) 2009 Kai Blin <kai@samba.org>
6 # This file is part of AD-Bench, an Active Directory benchmark tool
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.
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.
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/>.
23 source `dirname $0`/utils.sh
25 PRINCIPAL
=$
(get_principal
$1)
26 PASSWORD
=$
(get_password
$1)
28 NT_DOM
=$
(get_nt_dom
$1)
32 ${NET} ads
join -k -s $CONFIG_FILE -S ${SERVER} > /dev
/null
34 if [ $RET -ne 0 ]; then
35 echo "${NET} returned error: $RET"
42 ${NET} ads leave
-k -s $CONFIG_FILE -S ${SERVER} > /dev
/null
43 if [ $RET -ne 0 ]; then
44 echo "${NET} returned error: $RET"
52 call_kinit
"${PRINCIPAL}" "${PASSWORD}"
53 write_configfile
"${REALM}" "${NT_DOM}"
65 START_TIME
=$
(start_timer
)
68 for i
in $
( ${SEQ} 1 $ITERATIONS ); do
75 STOP_TIME
=$
(stop_timer
)
77 TOTAL_TIME
=$
( total_time
$START_TIME $STOP_TIME )
79 echo -e "\t\ttotal time:\t\t${TOTAL_TIME}s"
81 LOGINS_PER_MINUTE
=$
(iterations_per_minute
$START_TIME $STOP_TIME $ITERATIONS)
83 echo -e "\t\titerations/min:\t\t$LOGINS_PER_MINUTE"