Add a sentinel line to sim_server after the socket is ready, and use
authorGreg Hudson <ghudson@mit.edu>
Sat, 24 Apr 2010 19:24:36 +0000 (19:24 +0000)
committerGreg Hudson <ghudson@mit.edu>
Sat, 24 Apr 2010 19:24:36 +0000 (19:24 +0000)
it in simple.exp in the dejagnu test suite instead of sleeping.

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

src/appl/simple/server/sim_server.c
src/tests/dejagnu/krb-standalone/simple.exp

index d06c2553933e96b7e5201d3df4fac5f742f9e3fe..07cb01d5f3794663277dc79af7c2e77ba020ff55 100644 (file)
@@ -172,6 +172,8 @@ main(int argc, char *argv[])
         exit(1);
     }
 
+    printf("starting...\n");
+
 #ifdef DEBUG
     printf("socket has port # %d\n", ntohs(s_sock.sin_port));
 #endif
index 7f2763c783fdda4726246790dfec893534b6eb38..fa749035fc051b005bdd5f7582d5200c0996228d 100644 (file)
@@ -46,8 +46,10 @@ proc start_sim_server_daemon { } {
 
     verbose "sim_server_spawn is $sim_server_spawn_id" 1
 
-    # Give sim_server some time to start
-    sleep 2
+    expect {
+       "starting"      { }
+       eof             { perror "sim_server failed to start" }
+    }
 
     return 1
 }