Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / src / kauth / test / testlocking.general.tcl
1 # Copyright 2000, International Business Machines Corporation and others.
2 # All Rights Reserved.
3 #
4 # This software has been released under the terms of the IBM Public
5 # License. For details, see the LICENSE file in the top-level source
6 # directory or online at http://www.openafs.org/dl/license10.html
7
8 # Quickly tests a subset of the authentication attempts limits changes to the
9 # kaserver.
10
11 # invent a bunch of temporary users (delete, then create them)
12 # setfields their attempts and locktimes: Note -- I don't verify that
13 # kas exam reports the correct thing as doing the conversion from text
14 # to numeric and the math and the conversion in expect would be more likely
15 # to be wrong than the C code in admin_tools.c and kaprocs.c and kaauxdb.c
16
17 # fail to authenticate once
18 # verify that klog does not report locked
19 # verify that exam reports not locked
20 # fail to authenticate many times - 1.
21 # verify that klog does not report locked
22 # verify that exam reports locked (unless -attempts is 0)
23 # fail to authenticate once more.
24 # verify that klog does report locked (unless -attempts is 0)
25 # verify that exam reports locked (unless -attempts is 0)
26
27 # check that kas unlock works (implicit)
28 # check that the correct # of attempts remain after some # of failures? (implicit)
29 source testlocking.utils.tcl
30
31 for { set i 0 } { $i<10 } { set i [expr $i+1] } {
32 set usr lyletest$i
33 create_user $usr
34 }
35
36 verify_auto_reset $usr
37
38 for { set i 9 } { $i>=0 } { set i [expr $i-1] } {
39 set usr lyletest$i
40
41 spawn $kas setfields $usr -attempts $i -locktime [expr $i*10] -admin_user $admin -password_for_admin $adminpass -cell $cell
42
43 expect_nothing 0
44 wait_for $spawn_id
45 verify_attempts $usr $i
46 verify_lock $usr $i
47 }
48
49
50