summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorBarry Jaspan <bjaspan@mit.edu>1996-10-18 17:22:18 +0000
committerBarry Jaspan <bjaspan@mit.edu>1996-10-18 17:22:18 +0000
commit8c8460927d8b7152abd8327988a368bdee6ab72b (patch)
treed01868f22b9870b80e09a8fa604e8e81b8caf6d7 /src/lib
parent954cb25f58cdc6984efd3afe6a0516426af57a25 (diff)
* api.2/init-v2.exp: add test 117, for default max_life
[krb5-admin/18] git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9195 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/kadm5/unit-test/ChangeLog5
-rw-r--r--src/lib/kadm5/unit-test/api.2/init-v2.exp62
2 files changed, 67 insertions, 0 deletions
diff --git a/src/lib/kadm5/unit-test/ChangeLog b/src/lib/kadm5/unit-test/ChangeLog
index d304338eb..f3413bba6 100644
--- a/src/lib/kadm5/unit-test/ChangeLog
+++ b/src/lib/kadm5/unit-test/ChangeLog
@@ -1,3 +1,8 @@
+Fri Oct 18 13:21:08 1996 Barry Jaspan <bjaspan@mit.edu>
+
+ * api.2/init-v2.exp: add test 117, for default max_life
+ [krb5-admin/18]
+
Thu Oct 17 16:14:11 1996 Barry Jaspan <bjaspan@mit.edu>
* config/unix.exp, lib/lib.t: begin in process of making these
diff --git a/src/lib/kadm5/unit-test/api.2/init-v2.exp b/src/lib/kadm5/unit-test/api.2/init-v2.exp
index 38ddcf5d6..8927e6b5b 100644
--- a/src/lib/kadm5/unit-test/api.2/init-v2.exp
+++ b/src/lib/kadm5/unit-test/api.2/init-v2.exp
@@ -427,6 +427,68 @@ proc test116 {} {
}
}
if {$RPC} test116
+
+test "init 117"
+proc test117 {} {
+ global test env prompt
+
+ if {[catch "exec grep max_life $env(KRB5_KDC_PROFILE)"] != 1} {
+ warning \
+ "$test: max_life in $env(KRB5_KDC_PROFILE), cannot perform test"
+ return
+ }
+
+ if {! (( ! [principal_exists "$test/a"]) ||
+ [delete_principal "$test/a"])} {
+ error_and_restart "$test: couldn't delete principal \"$test/a\""
+ return
+ }
+
+ if {! [cmd {
+ kadm5_init admin admin $KADM5_ADMIN_SERVICE null \
+ $KADM5_STRUCT_VERSION $KADM5_API_VERSION_2 \
+ server_handle
+ }]} {
+ fail "$test: unexpected failure in init"
+ return
+ }
+
+ if {! [cmd [format {
+ kadm5_create_principal $server_handle [simple_principal "%s/a"] \
+ {KADM5_PRINCIPAL} "%s/a"
+ } $test $test]]} {
+ error "$test: unexpected failure creating principal"
+ }
+ if {! [cmd [format {
+ kadm5_get_principal $server_handle "%s/a" principal KADM5_MAX_LIFE
+ } $test]]} {
+ error_and_restart "$test: could not retrieve principal"
+ return
+ }
+ send "lindex \$principal 4\n"
+ expect {
+ -re "(\[0-9\]+)\n$prompt" {set max_life $expect_out(1,string) }
+ timeout {
+ error_and_restart "$test: timeout getting max_life"
+ return
+ }
+ eof {
+ error_and_restart "$test: eof getting max_life"
+ return
+ }
+ }
+
+ if {$max_life == 36000} {
+ pass "$test"
+ } else {
+ fail "$test: max_life $max_life should be 36000"
+ }
+
+ if {! [cmd {kadm5_destroy $server_handle}]} {
+ error_and_restart "$test: couldn't close server_handle"
+ }
+}
+test117
send "puts \$KADM5_ADMIN_SERVICE\n"
expect {