From ac91c2f4c88ec96f1b058a7c7547c0e386a5e048 Mon Sep 17 00:00:00 2001 From: Sam Hartman Date: Mon, 4 Jan 2010 19:59:12 +0000 Subject: [PATCH] Test FAST authentication during each pass Because a new principal is added to the database, the iprop test expected output is updated. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23580 dc483132-0cff-0310-8789-dd5450dbe970 --- src/tests/dejagnu/config/default.exp | 45 +++++++++++++++++++ src/tests/dejagnu/krb-standalone/iprop.exp | 14 +++--- .../dejagnu/krb-standalone/standalone.exp | 10 +++++ 3 files changed, 62 insertions(+), 7 deletions(-) diff --git a/src/tests/dejagnu/config/default.exp b/src/tests/dejagnu/config/default.exp index 957ab873e..c7c622f71 100644 --- a/src/tests/dejagnu/config/default.exp +++ b/src/tests/dejagnu/config/default.exp @@ -1339,6 +1339,16 @@ proc setup_kerberos_db { standalone } { "Principal or policy already exists while creating*" { } } expect "kadmin.local: " + send "ank +requires_preauth krbtest/fast@$REALMNAME\r" + expect "Enter password for principal \"krbtest/fast@$REALMNAME\":" + send "adminpass$KEY\r" + expect "Re-enter password for principal \"krbtest/fast@$REALMNAME\":" + send "adminpass$KEY\r" + expect { + "Principal \"krbtest/fast@$REALMNAME\" created" { } + "Principal or policy already exists while creating*" { } + } + expect "kadmin.local: " send "quit\r" expect eof catch expect_after @@ -2189,6 +2199,41 @@ proc kinit { name pass standalone } { return 1 } +# Retrieve a ticket using FAST armor +proc kinit_fast { name pass standalone } { + global REALMNAME + global KINIT + global spawn_id + global env + + # Use kinit to get a ticket. + # + spawn $KINIT -5 -f -T $env(KRB5CCNAME) $name@$REALMNAME + expect { + "Password for $name@$REALMNAME:" { + verbose "kinit started" + } + timeout { + fail "kinit" + return 0 + } + eof { + fail "kinit" + return 0 + } + } + send "$pass\r" + expect eof + if ![check_exit_status kinit] { + return 0 + } + + if {$standalone} { + pass "kinit" + } + + return 1 +} proc kinit_kt { name keytab standalone testname } { global REALMNAME diff --git a/src/tests/dejagnu/krb-standalone/iprop.exp b/src/tests/dejagnu/krb-standalone/iprop.exp index 57506c0f8..db7cad858 100644 --- a/src/tests/dejagnu/krb-standalone/iprop.exp +++ b/src/tests/dejagnu/krb-standalone/iprop.exp @@ -106,28 +106,28 @@ proc doit { } { expect -re "Update log dump" expect -re "First serial \# : 1" if $des3_krbtgt { - expect -re "Last serial \# : 8" + expect -re "Last serial \# : 9" expect -re "Update Entry" expect -re "Update serial \# : 1" expect -re "Attributes changed : 12" expect -re "Update Entry" - expect -re "Update serial \# : 2" + expect -re "Update serial \# : 3" expect -re "Attributes changed : 6" expect -re "Update Entry" - expect -re "Update serial \# : 3" + expect -re "Update serial \# : 5" expect -re "Attributes changed : 12" expect -re "Update Entry" - expect -re "Update serial \# : 4" + expect -re "Update serial \# : 5" } else { - expect -re "Last serial \# : 7" + expect -re "Last serial \# : 8" expect -re "Update Entry" expect -re "Update serial \# : 1" expect -re "Attributes changed : 12" expect -re "Update Entry" - expect -re "Update serial \# : 2" + expect -re "Update serial \# : 3" expect -re "Attributes changed : 12" expect -re "Update Entry" - expect -re "Update serial \# : 3" + expect -re "Update serial \# : 4" } expect -re "Update operation : Add" expect -re "Update principal : wakawaka@KRBTEST.COM" diff --git a/src/tests/dejagnu/krb-standalone/standalone.exp b/src/tests/dejagnu/krb-standalone/standalone.exp index ca1c34d2f..068495ffd 100644 --- a/src/tests/dejagnu/krb-standalone/standalone.exp +++ b/src/tests/dejagnu/krb-standalone/standalone.exp @@ -204,6 +204,16 @@ proc doit { } { return } +# Get a ticket to later use with FAST + if ![kinit krbtest/fast adminpass$KEY 1] { + return + } + + # Use fast to get a ticket + if ![kinit_fast krbtest/fast adminpass$KEY 1] { + return + } + # Destroy the ticket. spawn $KDESTROY -5 if ![check_exit_status "kdestroy"] { -- 2.26.2