1
# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software
4
# This file is part of DejaGnu.
6
# DejaGnu is free software; you can redistribute it and/or modify it
7
# under the terms of the GNU General Public License as published by
8
# the Free Software Foundation; either version 2 of the License, or
9
# (at your option) any later version.
11
# DejaGnu is distributed in the hope that it will be useful, but
12
# WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
# General Public License for more details.
16
# You should have received a copy of the GNU General Public License
17
# along with DejaGnu; if not, write to the Free Software Foundation,
18
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20
# This file was written by J.T. Conklin. (jtc@cygnus.com)
23
# load support libraries
27
# set target variables only if needed
29
proc ${board}_init { args } {
31
if ![info exists NLMCONV] then {
32
set NLMCONV [findfile "$rootme/../binutils/nlmconv"]
35
if ![info exists LD] then {
36
set LD [findfile "$rootme/../ld/ld-new" "$rootme/../ld/ld-new" [transform "ld"]]
39
set shell_prompt "Password:"
40
set shell_id [remote_open target]
41
if [target_info exists passwd] {
42
set passwd [target_info passwd]
47
warning "Couldn't connect to target"
51
if [string match "" $passwd] then {
53
send_user "Password: "
54
expect_user -re "(.*)\n"
56
set passwd "$expect_out(1,string)"
60
send -i $shell_id "$passwd\n"
63
verbose "Got termtype prompt" 0
66
-i $shell_id timeout {
67
warning "Connection timed out"
73
set shell_prompt "[string toupper [target_info name]]:"
74
send -i $shell_id "1\n"
77
-i $shell_id -re "$shell_prompt" {}
78
-i $shell_id timeout {
79
warning "Connection timed out"
87
# ${board}_load -- load the program and execute it
89
# See default.exp for explanation of arguments and results.
92
proc ${board}_load { dest prog args } {
97
if [board_info $dest exists fileid] {
98
set shell_id [board_info $dest fileid]
105
if $shell_id<0 then {
106
verbose -log "$prog not executed because there is no target" 3
111
set exe [file tail $prog]
113
# We can't blindly append a suffix to the object name, because the
114
# result may not be valid on netware's 8.3 filesystem.
115
set nlm "$tmpdir/x.nlm"
116
set lnk "$tmpdir/x.lnk"
120
puts $fd "description \"$exe\""
121
puts $fd "screenname \"System Console\""
122
puts $fd "module clib.nlm"
123
puts $fd "module mathlib.nlm"
124
puts $fd "stack 65536"
126
# FIXME: don't hardcode location of prelude.o
127
puts $fd "input /s1/cygnus/dejagnu/i386-netware/lib/prelude.o"
128
puts $fd "input $prog"
129
puts $fd "output $nlm"
133
verbose "Executing: $NLMCONV -l$LD -T$lnk" 1
134
catch "exec $NLMCONV -l$LD -T$lnk" output
135
if ![string match "" $output] then {
138
if ![string match "NONE" $errorCode] {
139
verbose -log "Can't link $prog" 3
144
verbose "Downloading $nlm" 1
145
catch "exec cp $nlm /.NetWare/[board_info $dest name].nws/sys.nwv/tmp/x.nlm" output
146
if ![string match "" $output] then {
148
verbose -log "cp failed for $nlm" 3
152
# Wait a second for the file to "settle" on the NetWare server.
153
# I've encountered unexplained failures without this delay.
157
# The NetWare remote console expects to be connected to a vt100
158
# compatible terminal. It isn't very efficent, and it seems to
159
# send screen repaints for no reason. So we have to clear the
160
# screen as we run each test, otherwise a shell prompt or abort
161
# message from a previous test could cause incorrect results.
162
send -i $shell_id "CLS\r\n"
165
-i $shell_id -re "$shell_prompt" {
172
# Netware does not support exit status. The best we can do to
173
# detect failures is to look for the "ABNORMAL NLM TERMINATION"
174
# message printed by abort().
176
send -i $shell_id "LOAD X.NLM\r\n"
178
-i $shell_id "ABNORMAL NLM TERMINATION" {
182
-i $shell_id "Unable to find load file" {
183
perror "Couldn't execute program"
184
verbose -log "Couldn't execute program" 3
187
-i $shell_id timeout {
188
perror "Couldn't execute program (timed out)"
189
verbose -log "Couldn't execute program (timed out)" 3
192
-i $shell_id -re "[format "%sLOAD" $shell_prompt]" {
195
-i $shell_id -re "$shell_prompt" {}
198
catch [exec rm -f $lnk]
199
catch [exec rm -f $nlm]
209
# ${tool}_exit -- shutdown the connection
212
proc ${board}_exit {} {