krb5 commit: Fix slow kprop dejagnu test

Greg Hudson ghudson at MIT.EDU
Wed Oct 10 13:14:20 EDT 2012


https://github.com/krb5/krb5/commit/fd243aa274c6ba315280703aac9bd653f76197c4
commit fd243aa274c6ba315280703aac9bd653f76197c4
Author: Greg Hudson <ghudson at mit.edu>
Date:   Wed Oct 10 13:11:46 2012 -0400

    Fix slow kprop dejagnu test
    
    Fix kpropd -S -t to actually exit after processing one connection (it
    was breaking out of the switch statement, not the while loop).  Use
    the -t when invoking kpropd from the dejagnu test framework;
    previously it was unnecessary because kpropd -S -d exited after one
    connection.  Clear up some confusion in the kprop.exp comments about
    whether kpropd is expected to exit.

 src/slave/kpropd.c                         |    2 +-
 src/tests/dejagnu/config/default.exp       |    2 +-
 src/tests/dejagnu/krb-standalone/kprop.exp |    6 ++----
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/slave/kpropd.c b/src/slave/kpropd.c
index 83af0f8..afa02f4 100644
--- a/src/slave/kpropd.c
+++ b/src/slave/kpropd.c
@@ -432,7 +432,7 @@ do_standalone()
             close(s);
 
             if (runonce)
-                break;
+                exit(0);
         }
     }
     exit(0);
diff --git a/src/tests/dejagnu/config/default.exp b/src/tests/dejagnu/config/default.exp
index 67963c5..bd45ece 100644
--- a/src/tests/dejagnu/config/default.exp
+++ b/src/tests/dejagnu/config/default.exp
@@ -1510,7 +1510,7 @@ proc start_kpropd {} {
 
     envstack_push
     setup_kerberos_env slave
-    spawn $KPROPD -S -d -P [expr 10 + $portbase] -s $tmppwd/srvtab -f $tmppwd/incoming-slave-datatrans -p $KDB5_UTIL -a $tmppwd/kpropd-acl
+    spawn $KPROPD -S -d -t -P [expr 10 + $portbase] -s $tmppwd/srvtab -f $tmppwd/incoming-slave-datatrans -p $KDB5_UTIL -a $tmppwd/kpropd-acl
     set kpropd_pid [exp_pid]
     set kpropd_spawn_id $spawn_id
 #    send_user [list $KPROPD -S -d -P [expr 10 + $portbase] -s $tmppwd/srvtab -f $tmppwd/incoming-slave-datatrans -p $KDB5_UTIL -a $tmppwd/kpropd-acl]\n
diff --git a/src/tests/dejagnu/krb-standalone/kprop.exp b/src/tests/dejagnu/krb-standalone/kprop.exp
index ed7ed68..cc1a26a 100644
--- a/src/tests/dejagnu/krb-standalone/kprop.exp
+++ b/src/tests/dejagnu/krb-standalone/kprop.exp
@@ -24,13 +24,11 @@ proc setup_slave {} {
 proc scan_kpropd_output {} {
     global kpropd_spawn_id kpropd_pid
 
-    # See if kpropd logged anything.
+    # See if kpropd logged anything.  It should exit after processing
+    # one kprop connection.
     expect {
 	-i $kpropd_spawn_id
 	eof {
-	    # I think kpropd is supposed to run a loop in standalone
-	    # mode, but exiting seems to be normal behavior.
-#	    fail "kprop (server exited)"
 	    wait -i $kpropd_spawn_id
 	    unset kpropd_spawn_id kpropd_pid
 	}


More information about the cvs-krb5 mailing list