4 |
# it under the terms of the GNU General Public License as published by |
# it under the terms of the GNU General Public License as published by |
5 |
# the Free Software Foundation; either version 2 of the License, or |
# the Free Software Foundation; either version 2 of the License, or |
6 |
# (at your option) any later version. |
# (at your option) any later version. |
7 |
# |
# |
8 |
# This program is distributed in the hope that it will be useful, |
# This program is distributed in the hope that it will be useful, |
9 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11 |
# GNU General Public License for more details. |
# GNU General Public License for more details. |
12 |
# |
# |
13 |
# You should have received a copy of the GNU General Public License |
# You should have received a copy of the GNU General Public License |
14 |
# along with this program; if not, write to the Free Software |
# along with this program; if not, write to the Free Software |
15 |
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
16 |
|
|
17 |
# Please email any bugs, comments, and/or additions to this file to: |
# Please email any bugs, comments, and/or additions to this file to: |
18 |
# bug-dejagnu@gnu.org |
# bug-dejagnu@gnu.org |
45 |
} else { |
} else { |
46 |
set shell_prompt [board_info $arg shell_prompt] |
set shell_prompt [board_info $arg shell_prompt] |
47 |
} |
} |
48 |
|
|
49 |
if [board_info $arg exists fileid] { |
if [board_info $arg exists fileid] { |
50 |
unset board_info($arg,fileid) |
unset board_info($arg,fileid) |
51 |
} |
} |
55 |
} else { |
} else { |
56 |
set RLOGIN [board_info $arg rlogin_prog] |
set RLOGIN [board_info $arg rlogin_prog] |
57 |
} |
} |
58 |
|
|
59 |
# start connection and store the spawn_id |
# start connection and store the spawn_id |
60 |
verbose "Opening a $RLOGIN connection to $hostname" 2 |
verbose "Opening a $RLOGIN connection to $hostname" 2 |
61 |
spawn $RLOGIN $hostname |
spawn $RLOGIN $hostname |
64 |
return |
return |
65 |
} |
} |
66 |
set board_info($arg,fileid) $spawn_id |
set board_info($arg,fileid) $spawn_id |
67 |
|
|
68 |
# Try to connect to the target. We give up after 3 attempts. |
# Try to connect to the target. We give up after 3 attempts. |
69 |
while { $tries <= 3 } { |
while { $tries <= 3 } { |
70 |
expect { |
expect { |
107 |
-re "Sorry, this system is engaged.*Connection closed.*$" { |
-re "Sorry, this system is engaged.*Connection closed.*$" { |
108 |
warning "rlogin: system engaged." |
warning "rlogin: system engaged." |
109 |
} |
} |
110 |
timeout { |
timeout { |
111 |
warning "rlogin: timed out trying to connect." |
warning "rlogin: timed out trying to connect." |
112 |
} |
} |
113 |
eof { |
eof { |
153 |
set prefix "shell " |
set prefix "shell " |
154 |
set ok 1 |
set ok 1 |
155 |
} |
} |
156 |
-re ".*$shell_prompt" { |
-re ".*$shell_prompt" { |
157 |
set ok 1 |
set ok 1 |
158 |
} |
} |
159 |
default { } |
default { } |