From abadaf73403d579f3d351bebe4157b15054360b1 Mon Sep 17 00:00:00 2001 From: Barry Jaspan Date: Fri, 1 Nov 1996 18:24:40 +0000 Subject: [PATCH] * api.2/get-principal-v2.exp, api.2/mod-principal-v2.exp: update for new tl_data semantics [krb5-admin/140] git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9271 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/kadm5/unit-test/ChangeLog | 5 +++ .../unit-test/api.2/get-principal-v2.exp | 32 ++++++++++++++----- .../unit-test/api.2/mod-principal-v2.exp | 15 ++++++--- 3 files changed, 40 insertions(+), 12 deletions(-) diff --git a/src/lib/kadm5/unit-test/ChangeLog b/src/lib/kadm5/unit-test/ChangeLog index ec764c114..55293c413 100644 --- a/src/lib/kadm5/unit-test/ChangeLog +++ b/src/lib/kadm5/unit-test/ChangeLog @@ -1,3 +1,8 @@ +Fri Nov 1 13:15:37 1996 Barry Jaspan + + * api.2/get-principal-v2.exp, api.2/mod-principal-v2.exp: update + for new tl_data semantics [krb5-admin/140] + Thu Oct 31 08:42:18 1996 Ezra Peisach * Makefile.in (check): Only run tests is Perl, tcl, runtest. diff --git a/src/lib/kadm5/unit-test/api.2/get-principal-v2.exp b/src/lib/kadm5/unit-test/api.2/get-principal-v2.exp index c29b61ea0..0e3e1b5a8 100644 --- a/src/lib/kadm5/unit-test/api.2/get-principal-v2.exp +++ b/src/lib/kadm5/unit-test/api.2/get-principal-v2.exp @@ -84,8 +84,8 @@ proc test100 {} { fail "$test: key_data $key_data should be {}" set failed 1 } - if {$tl_data != {}} { - fail "$test: tl_data $tl_data should be {}" + if {$tl_data != "{}"} { + fail "$test: tl_data $tl_data should be empty" set failed 1 } if {$failed == 0} { @@ -172,6 +172,12 @@ test "get-principal 103" proc test103 {} { global test prompt + if {! (( [principal_exists "$test/a"]) || + [create_principal "$test/a"])} { + error_and_restart "$test: couldn't create principal \"$test/a\"" + return + } + if {! [cmd { kadm5_init admin admin $KADM5_ADMIN_SERVICE null \ $KADM5_STRUCT_VERSION $KADM5_API_VERSION_2 \ @@ -180,10 +186,20 @@ proc test103 {} { error "$test: unexpected failure in init" return } - if {! [cmd { - kadm5_get_principal $server_handle testuser p \ + + if { ! [cmd [format { + kadm5_modify_principal $server_handle \ + "{%s/a} 0 0 0 0 {%s/a} 0 0 0 0 null 0 0 0 0 0 0 1 {} {{999 6 foobar}}" \ + {KADM5_TL_DATA} + } $test $test]]} { + fail "$test: cannot set TL_DATA" + return + } + + if {! [cmd [format { + kadm5_get_principal $server_handle {%s/a} p \ {KADM5_PRINCIPAL_NORMAL_MASK KADM5_TL_DATA} - }]} { + } $test]]} { error "$test: unexpected failure in get_principal" } send "lindex \$p 17\n" @@ -214,10 +230,10 @@ proc test103 {} { if {$num_tl == 0} { fail "$test: num_tl $num_tl should not be 0" - } elseif {$tl_data == {}} { - fail "$test: tl_data $tl_data should not be {}" - } else { + } elseif {$tl_data == "{{999 6 foobar}}"} { pass "$test" + } else { + fail "$test: tl_data $tl_data should be {{999 6 foobar}}" } if { ! [cmd {kadm5_destroy $server_handle}]} { diff --git a/src/lib/kadm5/unit-test/api.2/mod-principal-v2.exp b/src/lib/kadm5/unit-test/api.2/mod-principal-v2.exp index 102332dba..1692aa7c2 100644 --- a/src/lib/kadm5/unit-test/api.2/mod-principal-v2.exp +++ b/src/lib/kadm5/unit-test/api.2/mod-principal-v2.exp @@ -2,7 +2,7 @@ load_lib lib.t api_exit api_start -test "modify-principal 100-104" +test "modify-principal 100-105" proc test100_104 {} { global test global prompt @@ -49,10 +49,17 @@ proc test100_104 {} { {KADM5_KEY_DATA} } "BAD_MASK" + # test 105 + one_line_fail_test [format { + kadm5_modify_principal $server_handle \ + "{%s/a} 0 0 0 0 {%s/a} 0 0 0 0 null 0 0 0 0 0 0 1 {} {{1 1 x}}" \ + {KADM5_TL_DATA} + } $test $test] "BAD_TL_TYPE" + # test 100,104 if { ! [cmd [format { kadm5_modify_principal $server_handle \ - "{%s/a} 0 0 0 0 {%s/a} 0 0 0 0 null 0 88 0 0 0 0 1 {} {{999 6 foobar}}" \ + "{%s/a} 0 0 0 0 {%s/a} 0 0 0 0 null 0 88 0 0 0 0 1 {} {{990 6 foobar}}" \ {KADM5_MAX_RLIFE KADM5_TL_DATA} } $test $test]]} { fail "$test: cannot set MAX_RLIFE or TL_DATA" @@ -88,10 +95,10 @@ proc test100_104 {} { return } } - if {($rlife == 88) && ([string match "*{999 6 foobar}*" $tl])} { + if {($rlife == 88) && ($tl == "{{990 6 foobar}}")} { pass "$test" } else { - fail "$test: $rlife should be 88, $tl should contain {999 6 foobar}" + fail "$test: $rlife should be 88, $tl should be {{990 6 foobar}}" } if { ! [cmd {kadm5_destroy $server_handle}]} { -- 2.26.2