Add a sentinel to the sample gss-server after the socket is ready, and
authorGreg Hudson <ghudson@mit.edu>
Sat, 24 Apr 2010 19:12:34 +0000 (19:12 +0000)
committerGreg Hudson <ghudson@mit.edu>
Sat, 24 Apr 2010 19:12:34 +0000 (19:12 +0000)
use it in gssapi.exp in the dejagnu test suite instead of sleeping.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23934 dc483132-0cff-0310-8789-dd5450dbe970

src/appl/gss-sample/gss-server.c
src/tests/dejagnu/krb-standalone/gssapi.exp

index 0e2a27516c7b486d4e286f9ae2a047c4af6d6675..8b59eb276999bc3ab2061bf63b7b62b229cb99e1 100644 (file)
@@ -731,6 +731,7 @@ main(int argc, char **argv)
         if ((stmp = create_socket(port)) >= 0) {
             if (listen(stmp, max_threads == 1 ? 0 : max_threads) < 0)
                 perror("listening on socket");
+            fprintf(stderr, "starting...\n");
 
             do {
                 struct _work_plan *work = malloc(sizeof(struct _work_plan));
index 1f6664abd277d4cc8f646c6987db1cdf5115f567..582e087197704d84560e948d21c2e886de0ec5f6 100644 (file)
@@ -285,7 +285,11 @@ proc doit { } {
     spawn $GSSSERVER -export -logfile $tmppwd/gss-server.log -verbose -port [expr 8 + $portbase] gssservice@$hostname
     set gss_server_pid [exp_pid]
     set gss_server_spawn_id $spawn_id
-    sleep 2
+
+    expect {
+       "starting" { }
+       eof        { perror "gss-server failed to start" }
+    }
 
     run_client gssclient0 $tmppwd/gss_tk_0 gssclient0
     run_client gssclient1 $tmppwd/gss_tk_1 gssclient1