From: Ken Raeburn Date: Fri, 7 Nov 2008 23:51:42 +0000 (+0000) Subject: Re-add repaired iprop (really, update-log creation) test case X-Git-Tag: krb5-1.7-alpha1~216 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d35c5583b230b5cbb5929ae9fd44a692fbb131d2;p=krb5.git Re-add repaired iprop (really, update-log creation) test case git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21044 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/tests/dejagnu/krb-standalone/iprop.exp b/src/tests/dejagnu/krb-standalone/iprop.exp new file mode 100644 index 000000000..f4e4be25a --- /dev/null +++ b/src/tests/dejagnu/krb-standalone/iprop.exp @@ -0,0 +1,124 @@ +# Password-changing Kerberos test. +# This is a DejaGnu test script. + +# Set up the Kerberos files and environment. +if {![get_hostname] || ![setup_kerberos_files] || ![setup_kerberos_env]} { + return +} + +# We are about to start up a couple of daemon processes. We do all +# the rest of the tests inside a proc, so that we can easily kill the +# processes when the procedure ends. + +proc doit { } { + global REALMNAME + global KLIST + global KDESTROY + global KEY + global KADMIN_LOCAL + global KTUTIL + global hostname + global tmppwd + global spawn_id + global supported_enctypes + global KRBIV + global portbase + global mode + global KPROPLOG + global ulog des3_krbtgt + + # Delete any db, ulog files + file delete $tmppwd/db $tmppwd/db.ok $tmppwd/db.ulog + + # Update config file + set ulog 1 + reset_kerberos_files + + # Initialize the Kerberos database. The argument tells + # setup_kerberos_db that it is being called from here. + if ![setup_kerberos_db 0] { + return + } + if ![start_kerberos_daemons 0] { + return + } + + # Check that ulog file does exist + if [file exists $tmppwd/db.ulog] { + pass "create update log" + } else { + fail "create update log" + } + + # Use kadmin to add a key. + if ![add_kerberos_key wakawaka 0] { + return + } + + # Run kproplog, look at output. + spawn $KPROPLOG + expect_after { + timeout { + fail "kproplog output" + break + } + eof { + fail "kproplog output" + break + } + } + catch { + expect -re "Kerberos update log" + expect -re "Update log dump" + expect -re "First serial \# : 1" + if $des3_krbtgt { + expect -re "Last serial \# : 3" + expect -re "Update Entry" + expect -re "Update serial \# : 1" + expect -re "Attributes changed : 15" + expect -re "Update Entry" + expect -re "Update serial \# : 2" + expect -re "Attributes changed : 6" + expect -re "Update Entry" + expect -re "Update serial \# : 3" + } else { + expect -re "Last serial \# : 2" + expect -re "Update Entry" + expect -re "Update serial \# : 1" + expect -re "Attributes changed : 15" + expect -re "Update Entry" + expect -re "Update serial \# : 2" + } + expect -re "Update operation : Add" + expect -re "Update principal : wakawaka@KRBTEST.COM" + expect_after { + timeout { + fail "kproplog output" + break + } + } + expect -re "Attributes changed : 15" + expect eof + } foo + pass "kproplog output" + catch expect_after + if [check_exit_status kproplog] { + pass "kproplog exit status" + } else { + fail "kproplog exit status" + } +} + +set status [catch doit msg] + +stop_kerberos_daemons + +set ulog 0 +reset_kerberos_files +file delete $tmppwd/adb $tmppwd/adb.ok $tmppwd/db.ulog + +if { $status != 0 } { + send_error "ERROR: error in iprop.exp\n" + send_error "$msg\n" + exit 1 +}