From a94ace3f4833b4bed05ff8f13e2bfb5272b06ee0 Mon Sep 17 00:00:00 2001 From: Jiri Palecek Date: Wed, 10 Jun 2009 13:05:17 +0200 Subject: [PATCH] Use custom prompt in the telnet test, to avoid timeouts in case the user's prompt doesn't contain hostname --- testcases/network/tcp_cmds/telnet/telnet01 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/testcases/network/tcp_cmds/telnet/telnet01 b/testcases/network/tcp_cmds/telnet/telnet01 index a4b37d3f..24cfd119 100755 --- a/testcases/network/tcp_cmds/telnet/telnet01 +++ b/testcases/network/tcp_cmds/telnet/telnet01 @@ -41,6 +41,7 @@ set TC telnet set TCtmp "/tmp" set SLEEPTIME 3 set TESTLOG "$TCtmp" +set PROMPT "Alpha Bravo" if [info exists env(RUSER)] { set RUSER $env(RUSER) @@ -83,20 +84,21 @@ while {$count < $LOOPCOUNT} { # telnet to the host spawn telnet $HOST expect -re "login:" - sleep 1 + send "$RUSER\r" expect -re "Password:" - sleep 1 + send "$PASSWD\r" + send "PS1=\"$PROMPT\"\r" # Wait for shell prompt - expect -re "$RUSER@" + expect "$PROMPT" # Run passwd command - and respond to its prompts send "LC_ALL=C ls -l /etc/hosts | wc -w > $TESTLOG/$RUSER.$HOST \r" # When shell prompt comes back, logout - expect -re "$RUSER@" + expect "$PROMPT" exp_send "logout\r" send_user "CHECKING TELNET STATUS\n" -- 2.11.4.GIT