summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tests/dejagnu/krb-standalone/rcp.exp13
-rw-r--r--src/tests/dejagnu/krb-standalone/rsh.exp12
-rw-r--r--src/tests/dejagnu/krb-standalone/sample.exp29
-rw-r--r--src/tests/dejagnu/t_inetd.c1
4 files changed, 31 insertions, 24 deletions
diff --git a/src/tests/dejagnu/krb-standalone/rcp.exp b/src/tests/dejagnu/krb-standalone/rcp.exp
index 94ec240e6..ab6a2c993 100644
--- a/src/tests/dejagnu/krb-standalone/rcp.exp
+++ b/src/tests/dejagnu/krb-standalone/rcp.exp
@@ -36,7 +36,7 @@ if {![get_hostname] \
proc start_rsh_daemon { } {
global REALMNAME
- global KRSHD
+ global KRSHD T_INETD
global RCP
global tmppwd
global krshd_spawn_id
@@ -49,21 +49,20 @@ proc start_rsh_daemon { } {
}
- # The -D argument tells it to accept a single connection, so we
- # don't need to use inetd. The portbase+8 is the port to listen at.
- #
# The -L ENV_SET is for the I/S Athena brokeness in dot files where
# LD_LIBRARY_PATH will be overridden causing the "exec csh -c rcp ..."
# to fail as the .cshrc is read in. We do not use the -f option as
# a users shell might be sh...
# Later a proper fix would be to have kshd exec rcp directly
# shell indirection...
- spawn $KRSHD -k -c -D [expr 8 + $portbase] -P $tmppwd -S $tmppwd/srvtab -M $REALMNAME -L ENV_SET
+ spawn $T_INETD [expr 8 + $portbase] $KRSHD $KRSHD -k -c -P $tmppwd -S $tmppwd/srvtab -M $REALMNAME -L ENV_SET
set krshd_spawn_id $spawn_id
set krshd_pid [exp_pid]
- # Give the rsh daemon a few seconds to get set up.
- sleep 2
+ expect {
+ -ex "Ready!" { }
+ eof { error "couldn't start t_inetd helper" }
+ }
}
# A procedure to stop the rsh daemon.
diff --git a/src/tests/dejagnu/krb-standalone/rsh.exp b/src/tests/dejagnu/krb-standalone/rsh.exp
index b7c02a2a7..050a71c91 100644
--- a/src/tests/dejagnu/krb-standalone/rsh.exp
+++ b/src/tests/dejagnu/krb-standalone/rsh.exp
@@ -35,20 +35,20 @@ if {![get_hostname] \
proc start_rsh_daemon { option } {
global REALMNAME
- global KRSHD
+ global KRSHD T_INETD
global tmppwd
global krshd_spawn_id
global krshd_pid
global portbase
- # The -D argument tells it to accept a single connection, so we
- # don't need to use inetd. The portbase+8 is the port to listen at.
- spawn $KRSHD -k -c -D [expr 8 + $portbase] -S $tmppwd/srvtab -M $REALMNAME -A $option
+ spawn $T_INETD [expr 8 + $portbase] $KRSHD $KRSHD -k -c -S $tmppwd/srvtab -M $REALMNAME -A $option
set krshd_spawn_id $spawn_id
set krshd_pid [exp_pid]
- # Give the rsh daemon a few seconds to get set up.
- sleep 2
+ expect {
+ -ex "Ready!" { }
+ eof { error "couldn't start t_inetd helper" }
+ }
}
# A procedure to stop the rsh daemon.
diff --git a/src/tests/dejagnu/krb-standalone/sample.exp b/src/tests/dejagnu/krb-standalone/sample.exp
index c19c49e91..326f1848d 100644
--- a/src/tests/dejagnu/krb-standalone/sample.exp
+++ b/src/tests/dejagnu/krb-standalone/sample.exp
@@ -47,6 +47,9 @@ proc start_sserver_daemon { inetd } {
set sserver_spawn_id $spawn_id
verbose "sserver_spawn is $sserver_spawn_id" 1
+
+ # Give sserver some time to start
+ sleep 2
} else {
# Start the sserver
spawn $T_INETD [expr 8 + $portbase] $SSERVER sserver -S $tmppwd/srvtab
@@ -54,10 +57,12 @@ proc start_sserver_daemon { inetd } {
set sserver_spawn_id $spawn_id
verbose "sserver_spawn (t_inetd) is $sserver_spawn_id" 1
- }
- # Give sserver some time to start
- sleep 2
+ expect {
+ -ex "Ready!" { }
+ eof { error "couldn't start t_inetd helper" }
+ }
+ }
return 1
}
@@ -171,17 +176,19 @@ proc doit { } {
return
}
- if ![start_sserver_daemon 0 ] {
- return
- }
+ run_once sample_standalone {
+ if ![start_sserver_daemon 0 ] {
+ return
+ }
- if ![test_sclient sclient] {
- return
- }
+ if ![test_sclient sclient] {
+ return
+ }
- pass "sample - standalone"
+ pass "sample - standalone"
- stop_check_sserver_daemon
+ stop_check_sserver_daemon
+ }
if ![start_sserver_daemon 1 ] {
return
diff --git a/src/tests/dejagnu/t_inetd.c b/src/tests/dejagnu/t_inetd.c
index 6dc91cbbe..aa369d4f1 100644
--- a/src/tests/dejagnu/t_inetd.c
+++ b/src/tests/dejagnu/t_inetd.c
@@ -110,6 +110,7 @@ main(argc, argv)
exit(3);
}
+ printf("Ready!\n");
if ((acc = accept(sock, (struct sockaddr *)&f_inaddr,
&namelen)) == -1) {
com_err(progname, errno, "accepting");