|
Packit |
fd8b60 |
load_lib lib.t
|
|
Packit |
fd8b60 |
api_exit
|
|
Packit |
fd8b60 |
api_start
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
test "randkey-principal 1"
|
|
Packit |
fd8b60 |
proc test1 {} {
|
|
Packit |
fd8b60 |
global test
|
|
Packit |
fd8b60 |
if {! (( ! [principal_exists "$test/a"]) ||
|
|
Packit |
fd8b60 |
[delete_principal "$test/a"])} {
|
|
Packit |
fd8b60 |
error_and_restart "$test: couldn't create principal \"$test/a\""
|
|
Packit |
fd8b60 |
return
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
if {! [create_principal_pol "$test/a" once-a-min]} {
|
|
Packit |
fd8b60 |
error_and_restart "$test: creating principal"
|
|
Packit |
fd8b60 |
return
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
if {! [cmd [format {
|
|
Packit |
fd8b60 |
kadm5_init "%s/a" "%s/a" $KADM5_ADMIN_SERVICE null \
|
|
Packit |
fd8b60 |
$KADM5_STRUCT_VERSION $KADM5_API_VERSION_3 \
|
|
Packit |
fd8b60 |
server_handle
|
|
Packit |
fd8b60 |
} $test $test]]} {
|
|
Packit |
fd8b60 |
perror "$test: unexpected failure in init"
|
|
Packit |
fd8b60 |
return
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
one_line_fail_test [format {
|
|
Packit |
fd8b60 |
kadm5_randkey_principal $server_handle "%s/a" keys num_keys
|
|
Packit |
fd8b60 |
} $test] "PASS_TOOSOON"
|
|
Packit |
fd8b60 |
if { ! [cmd {kadm5_destroy $server_handle}]} {
|
|
Packit |
fd8b60 |
perror "$test: unexpected failure in destroy"
|
|
Packit |
fd8b60 |
return
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
if {$RPC} { test1 }
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
test "randkey-principal 3"
|
|
Packit |
fd8b60 |
proc test3 {} {
|
|
Packit |
fd8b60 |
global test
|
|
Packit |
fd8b60 |
if {! (( ! [principal_exists "$test/a"]) ||
|
|
Packit |
fd8b60 |
[delete_principal "$test/a"])} {
|
|
Packit |
fd8b60 |
error_and_restart "$test: couldn't create principal \"$test/a\""
|
|
Packit |
fd8b60 |
return
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
if {! [create_principal_pol "$test/a" once-a-min]} {
|
|
Packit |
fd8b60 |
error_and_restart "$test: creating principal"
|
|
Packit |
fd8b60 |
return
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
if {! [cmd [format {
|
|
Packit |
fd8b60 |
kadm5_init "%s/a" "%s/a" $KADM5_CHANGEPW_SERVICE null \
|
|
Packit |
fd8b60 |
$KADM5_STRUCT_VERSION $KADM5_API_VERSION_3 \
|
|
Packit |
fd8b60 |
server_handle
|
|
Packit |
fd8b60 |
} $test $test]]} {
|
|
Packit |
fd8b60 |
perror "$test: unexpected failure in init"
|
|
Packit |
fd8b60 |
return
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
one_line_fail_test [format {
|
|
Packit |
fd8b60 |
kadm5_randkey_principal $server_handle "%s/a" keys num_keys
|
|
Packit |
fd8b60 |
} $test] "PASS_TOOSOON"
|
|
Packit |
fd8b60 |
if { ! [cmd {kadm5_destroy $server_handle}]} {
|
|
Packit |
fd8b60 |
perror "$test: unexpected failure in destroy"
|
|
Packit |
fd8b60 |
return
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
if ${RPC} { test3 }
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
test "randkey-principal 13"
|
|
Packit |
fd8b60 |
proc test13 {} {
|
|
Packit |
fd8b60 |
global test
|
|
Packit |
fd8b60 |
if {! (( [principal_exists "$test/a"]) ||
|
|
Packit |
fd8b60 |
[create_principal "$test/a"])} {
|
|
Packit |
fd8b60 |
error_and_restart "$test: couldn't create principal \"$test/a\""
|
|
Packit |
fd8b60 |
return
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
if {! [cmd {
|
|
Packit |
fd8b60 |
kadm5_init admin admin $KADM5_ADMIN_SERVICE null \
|
|
Packit |
fd8b60 |
$KADM5_STRUCT_VERSION $KADM5_API_VERSION_3 \
|
|
Packit |
fd8b60 |
server_handle
|
|
Packit |
fd8b60 |
}]} {
|
|
Packit |
fd8b60 |
perror "$test: unexpected failure in init"
|
|
Packit |
fd8b60 |
return
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
if {! [cmd [format {
|
|
Packit |
fd8b60 |
kadm5_modify_principal $server_handle [princ_w_pol "%s/a" \
|
|
Packit |
fd8b60 |
once-a-min] KADM5_POLICY
|
|
Packit |
fd8b60 |
} $test]]} {
|
|
Packit |
fd8b60 |
perror "$test: failed modify"
|
|
Packit |
fd8b60 |
return
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
one_line_succeed_test [format {
|
|
Packit |
fd8b60 |
kadm5_randkey_principal $server_handle "%s/a" keys num_keys
|
|
Packit |
fd8b60 |
} $test]
|
|
Packit |
fd8b60 |
if { ! [cmd {kadm5_destroy $server_handle}]} {
|
|
Packit |
fd8b60 |
perror "$test: unexpected failure in destroy"
|
|
Packit |
fd8b60 |
return
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
test13
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
test "randkey-principal 15"
|
|
Packit |
fd8b60 |
proc test15 {} {
|
|
Packit |
fd8b60 |
global test
|
|
Packit |
fd8b60 |
if {! (( ! [principal_exists "$test/a"]) ||
|
|
Packit |
fd8b60 |
[delete_principal "$test/a"])} {
|
|
Packit |
fd8b60 |
error_and_restart "$test: couldn't create principal \"$test/a\""
|
|
Packit |
fd8b60 |
return
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
if {! [create_principal_pol "$test/a" once-a-min]} {
|
|
Packit |
fd8b60 |
error_and_restart "$test: creating principal"
|
|
Packit |
fd8b60 |
return
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
if {! [cmd {
|
|
Packit |
fd8b60 |
kadm5_init admin admin $KADM5_CHANGEPW_SERVICE null \
|
|
Packit |
fd8b60 |
$KADM5_STRUCT_VERSION $KADM5_API_VERSION_3 \
|
|
Packit |
fd8b60 |
server_handle
|
|
Packit |
fd8b60 |
}]} {
|
|
Packit |
fd8b60 |
perror "$test: unexpected failure in init"
|
|
Packit |
fd8b60 |
return
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
one_line_fail_test [format {
|
|
Packit |
fd8b60 |
kadm5_randkey_principal $server_handle "%s/a" keys num_keys
|
|
Packit |
fd8b60 |
} $test] "AUTH_CHANGEPW"
|
|
Packit |
fd8b60 |
if { ! [cmd {kadm5_destroy $server_handle}]} {
|
|
Packit |
fd8b60 |
perror "$test: unexpected failure in destroy"
|
|
Packit |
fd8b60 |
return
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
if { $RPC } { test15 }
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
test "randkey-principal 28"
|
|
Packit |
fd8b60 |
proc test28 {} {
|
|
Packit |
fd8b60 |
global test
|
|
Packit |
fd8b60 |
if {! (( [principal_exists "$test/a"]) ||
|
|
Packit |
fd8b60 |
[create_principal "$test/a"])} {
|
|
Packit |
fd8b60 |
error_and_restart "$test: couldn't create principal \"$test/a\""
|
|
Packit |
fd8b60 |
return
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
if {! [cmd {
|
|
Packit |
fd8b60 |
kadm5_init admin admin $KADM5_ADMIN_SERVICE null \
|
|
Packit |
fd8b60 |
$KADM5_STRUCT_VERSION $KADM5_API_VERSION_3 \
|
|
Packit |
fd8b60 |
server_handle
|
|
Packit |
fd8b60 |
}]} {
|
|
Packit |
fd8b60 |
perror "$test: unexpected failure in init"
|
|
Packit |
fd8b60 |
return
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
one_line_succeed_test [format {
|
|
Packit |
fd8b60 |
kadm5_randkey_principal $server_handle "%s/a" keys num_keys
|
|
Packit |
fd8b60 |
} $test]
|
|
Packit |
fd8b60 |
if { ! [cmd {kadm5_destroy $server_handle}]} {
|
|
Packit |
fd8b60 |
perror "$test: unexpected failure in destroy"
|
|
Packit |
fd8b60 |
return
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
test28
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
test "randkey-principal 28.25"
|
|
Packit |
fd8b60 |
proc test2825 {} {
|
|
Packit |
fd8b60 |
global test
|
|
Packit |
fd8b60 |
if {! (( [principal_exists "$test/a"]) ||
|
|
Packit |
fd8b60 |
[create_principal "$test/a"])} {
|
|
Packit |
fd8b60 |
error_and_restart "$test: couldn't create principal \"$test/a\""
|
|
Packit |
fd8b60 |
return
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
if {! [cmd {
|
|
Packit |
fd8b60 |
kadm5_init admin admin $KADM5_CHANGEPW_SERVICE null \
|
|
Packit |
fd8b60 |
$KADM5_STRUCT_VERSION $KADM5_API_VERSION_3 \
|
|
Packit |
fd8b60 |
server_handle
|
|
Packit |
fd8b60 |
}]} {
|
|
Packit |
fd8b60 |
perror "$test: unexpected failure in init"
|
|
Packit |
fd8b60 |
return
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
one_line_fail_test [format {
|
|
Packit |
fd8b60 |
kadm5_randkey_principal $server_handle "%s/a" keys num_keys
|
|
Packit |
fd8b60 |
} $test] "AUTH"
|
|
Packit |
fd8b60 |
if { ! [cmd {kadm5_destroy $server_handle}]} {
|
|
Packit |
fd8b60 |
perror "$test: unexpected failure in destroy"
|
|
Packit |
fd8b60 |
return
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
if {$RPC} { test2825 }
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
test "randkey-principal 28.5"
|
|
Packit |
fd8b60 |
proc test285 {} {
|
|
Packit |
fd8b60 |
global test
|
|
Packit |
fd8b60 |
if {! (( [principal_exists "$test/a"]) ||
|
|
Packit |
fd8b60 |
[create_principal "$test/a"])} {
|
|
Packit |
fd8b60 |
error_and_restart "$test: couldn't create principal \"$test/a\""
|
|
Packit |
fd8b60 |
return
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
if {! [cmd {
|
|
Packit |
fd8b60 |
kadm5_init admin/modify admin $KADM5_ADMIN_SERVICE null \
|
|
Packit |
fd8b60 |
$KADM5_STRUCT_VERSION $KADM5_API_VERSION_3 \
|
|
Packit |
fd8b60 |
server_handle
|
|
Packit |
fd8b60 |
}]} {
|
|
Packit |
fd8b60 |
perror "$test: unexpected failure in init"
|
|
Packit |
fd8b60 |
return
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
one_line_succeed_test [format {
|
|
Packit |
fd8b60 |
kadm5_randkey_principal $server_handle "%s/a" keys num_keys
|
|
Packit |
fd8b60 |
} $test]
|
|
Packit |
fd8b60 |
if { ! [cmd {kadm5_destroy $server_handle}]} {
|
|
Packit |
fd8b60 |
perror "$test: unexpected failure in destroy"
|
|
Packit |
fd8b60 |
return
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
test285
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
test "randkey-principal 30"
|
|
Packit |
fd8b60 |
proc test30 {} {
|
|
Packit |
fd8b60 |
global test
|
|
Packit |
fd8b60 |
if {! (( ! [principal_exists "$test/a"]) ||
|
|
Packit |
fd8b60 |
[delete_principal "$test/a"])} {
|
|
Packit |
fd8b60 |
error_and_restart "$test: couldn't delete principal \"$test/a\""
|
|
Packit |
fd8b60 |
return
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
if {! [create_principal "$test/a"]} {
|
|
Packit |
fd8b60 |
error_and_restart "$test: creating principal"
|
|
Packit |
fd8b60 |
return
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
if {! [cmd [format {
|
|
Packit |
fd8b60 |
kadm5_init "%s/a" "%s/a" $KADM5_CHANGEPW_SERVICE null \
|
|
Packit |
fd8b60 |
$KADM5_STRUCT_VERSION $KADM5_API_VERSION_3 \
|
|
Packit |
fd8b60 |
server_handle
|
|
Packit |
fd8b60 |
} $test $test]]} {
|
|
Packit |
fd8b60 |
perror "$test: unexpected failure in init"
|
|
Packit |
fd8b60 |
return
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
one_line_succeed_test [format {
|
|
Packit |
fd8b60 |
kadm5_randkey_principal $server_handle "%s/a" keys num_keys
|
|
Packit |
fd8b60 |
} $test]
|
|
Packit |
fd8b60 |
if { ! [cmd {kadm5_destroy $server_handle}]} {
|
|
Packit |
fd8b60 |
perror "$test: unexpected failure in destroy"
|
|
Packit |
fd8b60 |
return
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
test30
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
test "randkey-principal 31"
|
|
Packit |
fd8b60 |
proc test31 {} {
|
|
Packit |
fd8b60 |
global test
|
|
Packit |
fd8b60 |
if {! (( ! [principal_exists "$test/a"]) ||
|
|
Packit |
fd8b60 |
[delete_principal "$test/a"])} {
|
|
Packit |
fd8b60 |
error_and_restart "$test: couldn't create principal \"$test/a\""
|
|
Packit |
fd8b60 |
return
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
if {! [create_principal "$test/a"]} {
|
|
Packit |
fd8b60 |
error_and_restart "$test: creating principal"
|
|
Packit |
fd8b60 |
return
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
if {! [cmd [format {
|
|
Packit |
fd8b60 |
kadm5_init "%s/a" "%s/a" $KADM5_ADMIN_SERVICE null \
|
|
Packit |
fd8b60 |
$KADM5_STRUCT_VERSION $KADM5_API_VERSION_3 \
|
|
Packit |
fd8b60 |
server_handle
|
|
Packit |
fd8b60 |
} $test $test]]} {
|
|
Packit |
fd8b60 |
perror "$test: unexpected failure in init"
|
|
Packit |
fd8b60 |
return
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
one_line_succeed_test [format {
|
|
Packit |
fd8b60 |
kadm5_randkey_principal $server_handle "%s/a" keys num_keys
|
|
Packit |
fd8b60 |
} $test]
|
|
Packit |
fd8b60 |
if { ! [cmd {kadm5_destroy $server_handle}]} {
|
|
Packit |
fd8b60 |
perror "$test: unexpected failure in destroy"
|
|
Packit |
fd8b60 |
return
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
test31
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
test "randkey-principal 33"
|
|
Packit |
fd8b60 |
proc test33 {} {
|
|
Packit |
fd8b60 |
global test
|
|
Packit |
fd8b60 |
if {! (( [principal_exists "$test/a"]) ||
|
|
Packit |
fd8b60 |
[create_principal "$test/a"])} {
|
|
Packit |
fd8b60 |
error_and_restart "$test: couldn't create principal \"$test/a\""
|
|
Packit |
fd8b60 |
return
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
if { ! [cmd {
|
|
Packit |
fd8b60 |
kadm5_init admin admin $KADM5_ADMIN_SERVICE null \
|
|
Packit |
fd8b60 |
$KADM5_STRUCT_VERSION $KADM5_API_VERSION_3 \
|
|
Packit |
fd8b60 |
server_handle
|
|
Packit |
fd8b60 |
}]} {
|
|
Packit |
fd8b60 |
perror "$test: unexpected failure in init"
|
|
Packit |
fd8b60 |
return
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
one_line_fail_test [format {
|
|
Packit |
fd8b60 |
kadm5_randkey_principal null "%s/a" keys num_keys
|
|
Packit |
fd8b60 |
} $test] "BAD_SERVER_HANDLE"
|
|
Packit |
fd8b60 |
if { ! [cmd {kadm5_destroy $server_handle}]} {
|
|
Packit |
fd8b60 |
perror "$test: unexpected failure in destroy"
|
|
Packit |
fd8b60 |
return
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
}
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
test33
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
return ""
|