From ea9dc5759de0dd7f59eed27def805d6218f5af5e Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Fri, 30 Jun 2006 23:22:32 +0000 Subject: [PATCH] test kdb5_util dump/load functionality in dejagnu 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: new target_version: 1.5 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18308 dc483132-0cff-0310-8789-dd5450dbe970 --- .../dejagnu/krb-standalone/standalone.exp | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) 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 -- 2.26.2