From 489919e774645f990116ea5f0063a9b009fa962f Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Sat, 24 Apr 2010 19:24:36 +0000 Subject: [PATCH] Add a sentinel line to sim_server after the socket is ready, and use 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 | 2 ++ src/tests/dejagnu/krb-standalone/simple.exp | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/appl/simple/server/sim_server.c b/src/appl/simple/server/sim_server.c index d06c25539..07cb01d5f 100644 --- a/src/appl/simple/server/sim_server.c +++ b/src/appl/simple/server/sim_server.c @@ -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 diff --git a/src/tests/dejagnu/krb-standalone/simple.exp b/src/tests/dejagnu/krb-standalone/simple.exp index 7f2763c78..fa749035f 100644 --- a/src/tests/dejagnu/krb-standalone/simple.exp +++ b/src/tests/dejagnu/krb-standalone/simple.exp @@ -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 } -- 2.26.2