From: Tom Yu Date: Fri, 30 Jun 2006 23:34:40 +0000 (+0000) Subject: pull up r18308 from trunk X-Git-Tag: krb5-1.5-final~7 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=72f9439a00d5f1af3145123668b2d4d499fa3a20;p=krb5.git pull up r18308 from trunk r18308@cathode-dark-space: raeburn | 2006-06-30 19:22:32 -0400 ticket: new subject: test kdb5_util dump/load functionality in dejagnu target_version: 1.5 tags: pullup This new test just dumps and reloads the database. It doesn't examine the resulting database, but kinit and other tests are run after it, using the reloaded database. * standalone.exp (dump_and_reload): New proc. (doit): Invoke it. ticket: 3970 version_fixed: 1.5 git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-5@18309 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/tests/dejagnu/krb-standalone/standalone.exp b/src/tests/dejagnu/krb-standalone/standalone.exp index 554906e44..3799a51ab 100644 --- a/src/tests/dejagnu/krb-standalone/standalone.exp +++ b/src/tests/dejagnu/krb-standalone/standalone.exp @@ -19,6 +19,61 @@ if ![setup_kerberos_db 1] { # the rest of the tests inside a proc, so that we can easily kill the # processes when the procedure ends. +proc dump_and_reload {} { + global KDB5_UTIL + global tmppwd + + set dumpfile $tmppwd/dump-file + set dumpokfile $dumpfile.dump_ok + + set test1name "kdb5_util dump" + set test2name "kdb5_util load" + + if [file exists $dumpfile] { file delete $dumpfile } + if [file exists $dumpokfile] { file delete $dumpokfile } + + spawn $KDB5_UTIL dump $dumpfile + expect { + -re "..*" { + fail $test1name + untested $test2name + return + } + timeout { + fail $test1name + untested $test2name + return + } + eof { } + } + if ![check_exit_status $test1name] { + untested $test2name + return + } + if ![file exists $dumpfile]||![file exists $dumpokfile] { + fail $test1name + untested $test2name + return + } + pass $test1name + + spawn $KDB5_UTIL load $dumpfile + expect { + -re "..*" { + fail $test2name + return + } + timeout { + fail $test2name + return + } + eof { } + } + if [check_exit_status $test2name] { + pass $test2name + } +} + proc doit { } { global REALMNAME global KLIST @@ -49,6 +104,9 @@ proc doit { } { return } + # Test dump and load. Continue on, whatever the result. + dump_and_reload + # Use kinit to get a ticket. if ![kinit krbtest/admin adminpass$KEY 1] { return