summaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorEzra Peisach <epeisach@mit.edu>2000-08-08 19:40:01 +0000
committerEzra Peisach <epeisach@mit.edu>2000-08-08 19:40:01 +0000
commit41ef94ab9b28d71d4c3dbd8731c86c4e0eaa35ff (patch)
tree099c30f0dfa34212cabf45f37d4a49dc6680cf0f /src/tests
parent807253d6a6035e25d694314d7cd7bac499a02e3d (diff)
downloadkrb5-41ef94ab9b28d71d4c3dbd8731c86c4e0eaa35ff.tar.gz
krb5-41ef94ab9b28d71d4c3dbd8731c86c4e0eaa35ff.tar.xz
krb5-41ef94ab9b28d71d4c3dbd8731c86c4e0eaa35ff.zip
* v4standalone.exp: New set of tests for basic V4 functionality
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12615 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/dejagnu/krb-standalone/ChangeLog4
-rw-r--r--src/tests/dejagnu/krb-standalone/v4standalone.exp135
2 files changed, 139 insertions, 0 deletions
diff --git a/src/tests/dejagnu/krb-standalone/ChangeLog b/src/tests/dejagnu/krb-standalone/ChangeLog
index 4600525970..01a6e06c53 100644
--- a/src/tests/dejagnu/krb-standalone/ChangeLog
+++ b/src/tests/dejagnu/krb-standalone/ChangeLog
@@ -1,3 +1,7 @@
+2000-08-08 Ezra Peisach <epeisach@engrailed.mit.edu>
+
+ * v4standalone.exp: New set of tests for basic V4 functionality.
+
2000-07-04 Tom Yu <tlyu@mit.edu>
* rsh.exp: Drain buffers on klist test to avoid wedging rsh on
diff --git a/src/tests/dejagnu/krb-standalone/v4standalone.exp b/src/tests/dejagnu/krb-standalone/v4standalone.exp
new file mode 100644
index 0000000000..944b82319e
--- /dev/null
+++ b/src/tests/dejagnu/krb-standalone/v4standalone.exp
@@ -0,0 +1,135 @@
+# Standalone Kerberos test.
+# This is a DejaGnu test script.
+# This script tests that the Kerberos tools can talk to each other.
+
+# This mostly just calls procedures in testsuite/config/default.exp.
+
+if ![info exists KLIST] {
+ set KLIST [findfile $objdir/../../clients/klist/klist]
+}
+
+if ![info exists KDESTROY] {
+ set KDESTROY [findfile $objdir/../../clients/kdestroy/kdestroy]
+}
+
+# Set up the Kerberos files and environment.
+if {![get_hostname] || ![setup_kerberos_files] || ![setup_kerberos_env]} {
+ return
+}
+
+# If we do not have what is for a V4 test - return
+if ![v4_compatible_enctype] {
+ return
+}
+
+# Initialize the Kerberos database. The argument tells
+# setup_kerberos_db that it is being called from here.
+if ![setup_kerberos_db 1] {
+ 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 hostname
+ global tmppwd
+ global spawn_id
+
+ # Start up the kerberos and kadmind daemons.
+ if ![start_kerberos_daemons 1] {
+ return
+ }
+
+ # Use kadmin to add an host key.
+ if ![add_random_key host/$hostname 1] {
+ return
+ }
+
+ # Use ksrvutil to create a srvtab entry.
+ if ![setup_srvtab 1] {
+ return
+ }
+
+ # Use kinit to get a ticket.
+ if ![v4kinit krbtest.admin adminpass$KEY 1] {
+ return
+ }
+
+ # Make sure that klist can see the ticket.
+ spawn $KLIST -4
+ expect {
+ -re "Kerberos 4 ticket cache:\[ \]*(.+:)?$tmppwd/tkt.*Principal:\[ \]*krbtest.admin@$REALMNAME.*krbtgt\.$REALMNAME@$REALMNAME\r\n" {
+ verbose "klist started"
+ }
+ timeout {
+ fail "v4klist"
+ return
+ }
+ eof {
+ fail "v4klist"
+ return
+ }
+ }
+
+ expect {
+ "\r" { }
+ eof { }
+ }
+
+ if ![check_exit_status "klist"] {
+ return
+ }
+ pass "v4klist"
+
+ # Destroy the ticket.
+ spawn $KDESTROY -4
+ if ![check_exit_status "kdestroy"] {
+ return
+ }
+ pass "v4kdestroy"
+
+ # Double check that the ticket was destroyed.
+ spawn $KLIST -4
+ expect {
+ -re "Kerberos 4 ticket cache:\[ \]*(.+:)?$tmppwd/tkt.*klist: You have no tickets cached.*\r\n" {
+ verbose "v4klist started"
+ }
+ timeout {
+ fail "v4klist after kdestroy"
+ return
+ }
+ eof {
+ fail "v4klist after kdestroy"
+ return
+ }
+ }
+ # We can't use check_exit_status, because we expect an exit status
+ # of 1.
+ set status_list [wait -i $spawn_id]
+ verbose "wait -i $spawn_id returned $status_list (klist)"
+ if { [lindex $status_list 2] != 0 } {
+ fail "v4klist (bad exit status) $status_list"
+ return
+ } else { if { [lindex $status_list 3] != 1 } {
+ fail "v4klist (bad exit status) $status_list"
+ return
+ } else {
+ pass v4klist
+ } }
+}
+
+set status [catch doit msg]
+
+stop_kerberos_daemons
+
+if { $status != 0 } {
+ send_error "ERROR: error in standalone.exp\n"
+ send_error "$msg\n"
+ exit 1
+}