+Fri Mar 29 01:34:47 1996 Marc Horowitz <marc@mit.edu>
+
+ * telnet.exp (start_telnet_daemon) use sh -c around telnetd
+ invocation to avoid having the rlogin die when the first telnetd
+ exits.
+ (telnet_test) If telnet finishes (prints connection closed), but
+ doesnt exit by an expect timeout, then kill the telnet so the
+ tests can go on.
+
+Fri Mar 29 01:09:14 1996 Ken Raeburn <raeburn@cygnus.com>
+
+ * rlogin.exp (rlogin_test): Make connection-closed patterns the
+ same, so the correct matching will happen when that message is
+ really expected.
+
+Thu Mar 28 18:17:31 1996 Ken Raeburn <raeburn@cygnus.com>
+
+ * rlogin.exp (rlogin_test), telnet.exp (telnet_test): Handle
+ failures from closed connections.
+
+ * telnet.exp (telnet_test): Move -- before hostname.
+
+Thu Mar 28 16:37:36 1996 Mark Eichin <eichin@cygnus.com>
+
+ * telnet.exp (telnet_test): use -- to end the getopt arguments.
+
Tue Mar 19 10:03:01 1996 Ezra Peisach <epeisach@kangaroo.mit.edu>
* telnet.exp: Put back in the encrypted telnet tests.
# The -p argument tells it to accept a single connection, so we
# don't need to use inetd. The 3543 is the port to listen at.
# Note that tmppwd here is a shell variable, which is set in
- # setup_root_shell, not a TCL variable.
- send -i $rlogin_spawn_id "$KRLOGIND -k -c -D 3543 -S \$tmppwd/srvtab -M $REALMNAME -L $LOGINKRB5 $option &\r"
+ # setup_root_shell, not a TCL variable. The sh -c is to workaround
+ # the broken controlling tty handling in hpux, and shouldn't hurt
+ # anything else.
+ send -i $rlogin_spawn_id "sh -c \"$KRLOGIND -k -c -D 3543 -S \$tmppwd/srvtab -M $REALMNAME -L $LOGINKRB5 $option\" &\r"
expect {
-i $rlogin_spawn_id
-re "$ROOT_PROMPT" { }
catch "expect_after"
return
}
+ "onnection closed." {
+ fail "$testname (connection closed)"
+ catch "expect_after"
+ return
+ }
eof {
fail "$testname (eof)"
catch "expect_after"
expect -re "$SHELL_PROMPT"
send "exit\r"
expect {
- "Connection closed.\r" {
+ "onnection closed." {
pass $testname
}
}
catch "expect_after"
return
}
+ "onnection closed" {
+ fail "$testname (connection closed)"
+ catch "expect_after"
+ return
+ }
eof {
fail "$testname (eof)"
catch "expect_after"
"Closed connection.\r" {
pass $testname
}
+ "onnection closed" {
+ pass $testname
+ }
}
expect_after
# we don't need to use inetd. The 3023 is the port to listen at.
# Note that tmppwd here is a shell variable, which is set in
# setup_root_shell, not a TCL variable.
- send -i $rlogin_spawn_id "$TELNETD -debug -t \$tmppwd/srvtab -R $REALMNAME -L $LOGINKRB5 -X KERBEROS_V4 3023 &\r"
+ send -i $rlogin_spawn_id "sh -c \"$TELNETD -debug -t \$tmppwd/srvtab -R $REALMNAME -L \\\r$LOGINKRB5 -X KERBEROS_V4 3023\" &\r"
expect {
-i $rlogin_spawn_id
-re "$ROOT_PROMPT" { }
# Start up our telnet connection. We first try it without
# authentication, so the daemon should prompt for a login.
- spawn $TELNET $hostname -3023
+ spawn $TELNET -- $hostname -3023
+ set telnet_pid [exp_pid]
expect_after {
timeout {
- fail $testname
+ fail "$testname (timeout)"
catch "expect_after"
return
}
eof {
- fail $testname
+ fail "$testname (eof)"
catch "expect_after"
return
}
expect_after
+# on hpux 10.x, the child telnet will hang in an ioctl(). This will
+# wait a while for an EOF, and kill the process if it doesn't exit by
+# itself. The hang doesn't happen when telnet is run at the shell.
+
+ expect {
+ eof { }
+ timeout {
+ stop_telnet_daemon
+ }
+ }
+
if ![check_exit_status "exit status"] {
return
}
# Try an authenticated connection.
start_telnet_daemon
- spawn $TELNET -a -k $REALMNAME $hostname -3023
+ spawn $TELNET -a -k $REALMNAME -- $hostname -3023
expect_after {
timeout {
catch "expect_after"
return
}
+ "Connection closed by foreign host.\r" {
+ fail "$testname (connection closed)"
+ catch "expect_after"
+ return
+ }
eof {
fail "$testname (eof)"
catch "expect_after"
# Try an authenticated encrypted connection.
start_telnet_daemon
- spawn $TELNET -a -x -k $REALMNAME $hostname -3023
+ spawn $TELNET -a -x -k $REALMNAME -- $hostname -3023
expect_after {
timeout {