Test FAST authentication during each pass
authorSam Hartman <hartmans@mit.edu>
Mon, 4 Jan 2010 19:59:12 +0000 (19:59 +0000)
committerSam Hartman <hartmans@mit.edu>
Mon, 4 Jan 2010 19:59:12 +0000 (19:59 +0000)
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
src/tests/dejagnu/krb-standalone/iprop.exp
src/tests/dejagnu/krb-standalone/standalone.exp

index 957ab873ef1be56143a1d13614f7a88ae6e6137b..c7c622f71486b2366ae8a62b4f22fb44ba341eab 100644 (file)
@@ -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
index 57506c0f803a4ccd30a640baf85dd9707eb8e321..db7cad858a6e5b33335b74371fb01dbccd418e72 100644 (file)
@@ -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"
index ca1c34d2ff04314c4aa8e3cd589f06f6bafcca9d..068495ffd0ef7a4b00e0bf85c422f7cadd570b47 100644 (file)
@@ -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"] {