9 if {! (( [policy_exists "$test/a"]) ||
10 [create_policy "$test/a"])} {
11 error_and_restart "$test: couldn't create policy \"$test/a\""
16 kadm5_init admin admin $KADM5_CHANGEPW_SERVICE null \
17 $KADM5_STRUCT_VERSION $KADM5_API_VERSION_3 \
20 perror "$test: unexpected failure in init"
23 one_line_fail_test [format {
24 kadm5_modify_policy $server_handle [simple_policy "%s/a"] \
26 } $test] "AUTH_MODIFY"
27 if { ! [cmd {kadm5_destroy $server_handle}]} {
28 perror "$test: unexpected failure in destroy"
34 test "modify-policy 8"
38 # setup_xfail {*-*-*} $prms_id
40 if {! (( [policy_exists "$test/a"]) ||
41 [create_policy "$test/a"])} {
42 error_and_restart "$test: couldn't create policy \"$test/a\""
47 kadm5_init admin admin $KADM5_ADMIN_SERVICE null \
48 $KADM5_STRUCT_VERSION $KADM5_API_VERSION_3 \
51 perror "$test: unexpected failure in init"
55 kadm5_modify_policy $server_handle [simple_policy ""] \
58 if { ! [cmd {kadm5_destroy $server_handle}]} {
59 perror "$test: unexpected failure in destroy"
65 test "modify-policy 9"
69 if {! (( [policy_exists "$test/a"]) ||
70 [create_policy "$test/a"])} {
71 error_and_restart "$test: couldn't create policy \"$test/a\""
76 kadm5_init admin admin $KADM5_ADMIN_SERVICE null \
77 $KADM5_STRUCT_VERSION $KADM5_API_VERSION_3 \
80 perror "$test: unexpected failure in init"
84 kadm5_modify_policy $server_handle [simple_policy "%s/a"] \
91 kadm5_get_policy $server_handle "%s/a" policy
93 fail "$test: can not retrieve policy"
96 send "lindex \$policy 1\n"
98 -re "0\n$prompt$" { pass "$test" }
99 timeout { fail "$test" }
102 if { ! [cmd {kadm5_destroy $server_handle}]} {
103 perror "$test: unexpected failure in destroy"
109 test "modify-policy 10"
113 if {! (( [policy_exists "$test/a"]) ||
114 [create_policy "$test/a"])} {
115 error_and_restart "$test: couldn't create policy \"$test/a\""
119 kadm5_init admin admin $KADM5_ADMIN_SERVICE null \
120 $KADM5_STRUCT_VERSION $KADM5_API_VERSION_3 \
123 perror "$test: unexpected failure in init"
127 kadm5_modify_policy $server_handle {"%s/a" 32 0 0 0 0 0 0 0 0} \
134 kadm5_get_policy $server_handle "%s/a" policy
136 fail "$test: can not retrieve policy"
139 send "lindex \$policy 1\n"
141 -re "32\n$prompt$" { pass "$test" }
142 timeout { fail "$test" }
144 if { ! [cmd {kadm5_destroy $server_handle}]} {
145 perror "$test: unexpected failure in destroy"
152 test "modify-policy 11"
157 if {! (( [policy_exists "$test/a"]) ||
158 [create_policy "$test/a"])} {
159 error_and_restart "$test: couldn't create policy \"$test/a\""
164 kadm5_init admin admin $KADM5_ADMIN_SERVICE null \
165 $KADM5_STRUCT_VERSION $KADM5_API_VERSION_3 \
168 perror "$test: unexpected failure in init"
172 kadm5_modify_policy $server_handle [simple_policy "%s/a"] \
179 kadm5_get_policy $server_handle "%s/a" policy
181 fail "$test: can not retrieve policy"
184 send "lindex \$policy 2\n"
186 -re "0\n$prompt$" { pass "$test" }
187 timeout { fail "$test" }
189 if { ! [cmd {kadm5_destroy $server_handle}]} {
190 perror "$test: unexpected failure in destroy"
196 test "modify-policy 12"
201 if {! (( [policy_exists "$test/a"]) ||
202 [create_policy "$test/a"])} {
203 error_and_restart "$test: couldn't create policy \"$test/a\""
208 kadm5_init admin admin $KADM5_ADMIN_SERVICE null \
209 $KADM5_STRUCT_VERSION $KADM5_API_VERSION_3 \
212 perror "$test: unexpected failure in init"
216 kadm5_modify_policy $server_handle {"%s/a" 0 32 0 0 0 0 0 0 0} \
223 kadm5_get_policy $server_handle "%s/a" policy
225 fail "$test: can not retrieve policy"
228 send "lindex \$policy 2\n"
230 -re "32\n$prompt$" { pass "$test" }
231 timeout { fail "$test" }
233 if { ! [cmd {kadm5_destroy $server_handle}]} {
234 perror "$test: unexpected failure in destroy"
240 test "modify-policy 13"
243 if {! (( [policy_exists "$test/a"]) ||
244 [create_policy "$test/a"])} {
245 error_and_restart "$test: couldn't create policy \"$test/a\""
250 kadm5_init admin admin $KADM5_ADMIN_SERVICE null \
251 $KADM5_STRUCT_VERSION $KADM5_API_VERSION_3 \
254 perror "$test: unexpected failure in init"
257 one_line_fail_test [format {
258 kadm5_modify_policy $server_handle [simple_policy "%s/a"] \
259 {KADM5_PW_MIN_LENGTH}
260 } $test] "BAD_LENGTH"
261 if { ! [cmd {kadm5_destroy $server_handle}]} {
262 perror "$test: unexpected failure in destroy"
268 test "modify-policy 14"
273 if {! (( [policy_exists "$test/a"]) ||
274 [create_policy "$test/a"])} {
275 error_and_restart "$test: couldn't create policy \"$test/a\""
280 kadm5_init admin admin $KADM5_ADMIN_SERVICE null \
281 $KADM5_STRUCT_VERSION $KADM5_API_VERSION_3 \
284 perror "$test: unexpected failure in init"
288 kadm5_modify_policy $server_handle {"%s/a" 0 0 8 0 0 0 0 0 0} \
289 {KADM5_PW_MIN_LENGTH}
295 kadm5_get_policy $server_handle "%s/a" policy
297 fail "$test: can not retrieve policy"
300 send "lindex \$policy 3\n"
302 -re "8\n$prompt$" { pass "$test" }
303 timeout { fail "$test" }
305 if { ! [cmd {kadm5_destroy $server_handle}]} {
306 perror "$test: unexpected failure in destroy"
312 test "modify-policy 15"
315 if {! (( [policy_exists "$test/a"]) ||
316 [create_policy "$test/a"])} {
317 error_and_restart "$test: couldn't create policy \"$test/a\""
322 kadm5_init admin admin $KADM5_ADMIN_SERVICE null \
323 $KADM5_STRUCT_VERSION $KADM5_API_VERSION_3 \
326 perror "$test: unexpected failure in init"
329 one_line_fail_test [format {
330 kadm5_modify_policy $server_handle [simple_policy "%s/a"] \
331 {KADM5_PW_MIN_CLASSES}
333 if { ! [cmd {kadm5_destroy $server_handle}]} {
334 perror "$test: unexpected failure in destroy"
340 test "modify-policy 16"
345 if {! (( [policy_exists "$test/a"]) ||
346 [create_policy "$test/a"])} {
347 error_and_restart "$test: couldn't create policy \"$test/a\""
352 kadm5_init admin admin $KADM5_ADMIN_SERVICE null \
353 $KADM5_STRUCT_VERSION $KADM5_API_VERSION_3 \
356 perror "$test: unexpected failure in init"
360 kadm5_modify_policy $server_handle {"%s/a" 0 0 0 1 0 0 0 0 0} \
361 {KADM5_PW_MIN_CLASSES}
367 kadm5_get_policy $server_handle "%s/a" policy
369 fail "$test: can not retrieve policy"
372 send "lindex \$policy 4\n"
374 -re "1\n$prompt$" { pass "$test" }
375 timeout { fail "$test" }
379 if { ! [cmd {kadm5_destroy $server_handle}]} {
380 perror "$test: unexpected failure in destroy"
386 test "modify-policy 17"
391 if {! (( [policy_exists "$test/a"]) ||
392 [create_policy "$test/a"])} {
393 error_and_restart "$test: couldn't create policy \"$test/a\""
398 kadm5_init admin admin $KADM5_ADMIN_SERVICE null \
399 $KADM5_STRUCT_VERSION $KADM5_API_VERSION_3 \
402 perror "$test: unexpected failure in init"
406 kadm5_modify_policy $server_handle {"%s/a" 0 0 0 5 0 0 0 0 0} \
407 {KADM5_PW_MIN_CLASSES}
413 kadm5_get_policy $server_handle "%s/a" policy
415 fail "$test: can not retrieve policy"
418 send "lindex \$policy 4\n"
420 -re "5\n$prompt$" { pass "$test" }
421 timeout { fail "$test" }
424 if { ! [cmd {kadm5_destroy $server_handle}]} {
425 perror "$test: unexpected failure in destroy"
431 test "modify-policy 18"
436 if {! (( [policy_exists "$test/a"]) ||
437 [create_policy "$test/a" ])} {
438 error_and_restart "$test: couldn't create policy \"$test/a\""
443 kadm5_init admin admin $KADM5_ADMIN_SERVICE null \
444 $KADM5_STRUCT_VERSION $KADM5_API_VERSION_3 \
447 perror "$test: unexpected failure in init"
450 one_line_fail_test [format {
451 kadm5_modify_policy $server_handle {"%s/a" 0 0 0 6 0 0 0 0 0} \
452 {KADM5_PW_MIN_CLASSES}
454 if { ! [cmd {kadm5_destroy $server_handle}]} {
455 perror "$test: unexpected failure in destroy"
461 test "modify-policy 19"
465 if {! (( [policy_exists "$test/a"]) ||
466 [create_policy "$test/a" ])} {
467 error_and_restart "$test: couldn't create policy \"$test/a\""
472 kadm5_init admin admin $KADM5_ADMIN_SERVICE null \
473 $KADM5_STRUCT_VERSION $KADM5_API_VERSION_3 \
476 perror "$test: unexpected failure in init"
479 one_line_fail_test [format {
480 kadm5_modify_policy $server_handle [simple_policy "%s/a"] \
481 {KADM5_PW_HISTORY_NUM}
482 } $test] "BAD_HISTORY"
483 if { ! [cmd {kadm5_destroy $server_handle}]} {
484 perror "$test: unexpected failure in destroy"
490 test "modify-policy 20"
495 if {! (( [policy_exists "$test/a"]) ||
496 [create_policy "$test/a" ])} {
497 error_and_restart "$test: couldn't create policy \"$test/a\""
502 kadm5_init admin admin $KADM5_ADMIN_SERVICE null \
503 $KADM5_STRUCT_VERSION $KADM5_API_VERSION_3 \
506 perror "$test: unexpected failure in init"
510 kadm5_modify_policy $server_handle {"%s/a" 0 0 0 0 1 0 0 0 0} \
511 {KADM5_PW_HISTORY_NUM}
517 kadm5_get_policy $server_handle "%s/a" policy
519 fail "$test: can not retrieve policy"
522 send "lindex \$policy 5\n"
524 -re "1\n$prompt$" { pass "$test" }
525 timeout { fail "$test" }
528 if { ! [cmd {kadm5_destroy $server_handle}]} {
529 perror "$test: unexpected failure in destroy"
535 test "modify-policy 21"
540 if {! (( [policy_exists "$test/a"]) ||
541 [create_policy "$test/a" ])} {
542 error_and_restart "$test: couldn't create policy \"$test/a\""
547 kadm5_init admin admin $KADM5_ADMIN_SERVICE null \
548 $KADM5_STRUCT_VERSION $KADM5_API_VERSION_3 \
551 perror "$test: unexpected failure in init"
555 kadm5_modify_policy $server_handle {"%s/a" 0 0 0 0 10 0 0 0 0} \
556 {KADM5_PW_HISTORY_NUM}
562 kadm5_get_policy $server_handle "%s/a" policy
564 fail "$test: can not retrieve policy"
567 send "lindex \$policy 5\n"
569 -re "10\n$prompt$" { pass "$test" }
570 timeout { fail "$test" }
573 if { ! [cmd {kadm5_destroy $server_handle}]} {
574 perror "$test: unexpected failure in destroy"
580 test "modify-policy 22"
583 if {! (( [policy_exists "$test/a"]) ||
584 [create_policy "$test/a" ])} {
585 error_and_restart "$test: couldn't create policy \"$test/a\""
590 kadm5_init admin/none admin $KADM5_ADMIN_SERVICE null \
591 $KADM5_STRUCT_VERSION $KADM5_API_VERSION_3 \
594 perror "$test: unexpected failure in init"
597 one_line_fail_test [format {
598 kadm5_modify_policy $server_handle [simple_policy "%s/a"] \
600 } $test] "AUTH_MODIFY"
601 if { ! [cmd {kadm5_destroy $server_handle}]} {
602 perror "$test: unexpected failure in destroy"
608 test "modify-policy 23"
611 if {! (( [policy_exists "$test/a"]) ||
612 [create_policy "$test/a" ])} {
613 error_and_restart "$test: couldn't create policy \"$test/a\""
618 kadm5_init admin/get admin $KADM5_ADMIN_SERVICE null \
619 $KADM5_STRUCT_VERSION $KADM5_API_VERSION_3 \
622 perror "$test: unexpected failure in init"
625 one_line_fail_test [format {
626 kadm5_modify_policy $server_handle [simple_policy "%s/a"] \
628 } $test] "AUTH_MODIFY"
629 if { ! [cmd {kadm5_destroy $server_handle}]} {
630 perror "$test: unexpected failure in destroy"
636 test "modify-policy 26"
639 if {! (( [policy_exists "$test/a"]) ||
640 [create_policy "$test/a" ])} {
641 error_and_restart "$test: couldn't create policy \"$test/a\""
646 kadm5_init admin/modify admin $KADM5_ADMIN_SERVICE null \
647 $KADM5_STRUCT_VERSION $KADM5_API_VERSION_3 \
650 perror "$test: unexpected failure in init"
653 one_line_succeed_test [format {
654 kadm5_modify_policy $server_handle [simple_policy "%s/a"] \
657 if { ! [cmd {kadm5_destroy $server_handle}]} {
658 perror "$test: unexpected failure in destroy"
664 test "modify-policy 30"
668 one_line_fail_test [format {
669 kadm5_modify_policy null [simple_policy "%s/a"] \
671 } $test] "BAD_SERVER_HANDLE"
675 test "modify-policy 31"
678 if {! (( [policy_exists "$test/a"]) ||
679 [create_policy "$test/a" ])} {
680 error_and_restart "$test: couldn't create policy \"$test/a\""
685 kadm5_init admin/modify admin $KADM5_ADMIN_SERVICE null \
686 $KADM5_STRUCT_VERSION $KADM5_API_VERSION_3 \
689 perror "$test: unexpected failure in init"
692 one_line_succeed_test [format {
693 kadm5_modify_policy $server_handle {"%s/a" 0 0 0 0 0 0 2 0 0} \
694 {KADM5_PW_MAX_FAILURE}
696 one_line_succeed_test [format {
697 kadm5_modify_policy $server_handle {"%s/a" 0 0 0 1 0 0 0 90 0} \
698 {KADM5_PW_FAILURE_COUNT_INTERVAL}
700 one_line_succeed_test [format {
701 kadm5_modify_policy $server_handle {"%s/a" 0 0 0 1 0 0 0 0 180} \
702 {KADM5_PW_LOCKOUT_DURATION}
704 if { ! [cmd {kadm5_destroy $server_handle}]} {
705 perror "$test: unexpected failure in destroy"